All messages should be posted in plain text. HTML will be converted to attachments. The meditech-l web site is MTUsers.com ======================================
This works very well. Brian, Is there a way to check for end of file instead of a nil line in the input routine? If the imported text file has a line with nothing on it (blank line), the import stops at that point, and does not continue to the end of the file. (I used the enclosed text file as an import file). The NPR I used is also enclosed (C/S 5.4). Thank you, Mitch Lawrence Senior Applications Analyst - Advanced Report Writer General Financials Support CHRISTUS Information Management Tel 361.881.3408 Fax 361.888.6117 Mob 361.549.8456 [EMAIL PROTECTED] If someone has "Made your day", send them a Spirit Buck! -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian Schmit Sent: Monday, April 03, 2006 9:15 AM To: Henry Hansen; [email protected] Subject: RE: [MEDITECH-L] RE: Can an NPR report read the contents of anASCIItext file from disk? (Client Server 5.5) All messages should be posted in plain text. HTML will be converted to attachments. The meditech-l web site is MTUsers.com ====================================== Hi Henry, It is possible to do this in Client Server. I am not aware of a handy Z program for doing this, so you have to basically write out the code yourself. You can use the following code in a macro: @DELETE.TEXT.ARRAY, [EMAIL PROTECTED]("C:\","*","")^FILE_.=.; @Memory.allocate(1)^MEM, @Memory.clear(MEM), @Memory.beginning(MEM), @Memory.load.file(MEM,FILE), [EMAIL PROTECTED](MEM)^TEXT TEXT^/TEXT[-/TEXT[""]+1]}, @Memory.free(MEM)}, @CLEAN.UP DELETE.TEXT.ARRAY ""^X, DO{>/TEXT[X]^X ""^/TEXT[X]} CLEAN.UP ""^FILE^MEM^TEXT @File.open.dialog is an NPR Macro that opens up the Windows Open File dialog window. If you select a file, it will be stored in the local variable called FILE. Then a Memory Buffer is allocated using @Memory.allocate (MEM is a local variable for storing the buffer's handle), @Memory.clear wipes out any contents of the buffer, @Memory.beginning moves your cursor to the beginning of the buffer, @Memory.load.file loads the contents of FILE into the buffer, @Memory.read.text reads each line of the buffer and they are then stored in an array called /TEXT. Lastly, @Memory.free wipes out the buffer. I usually call the macro from a Footnote: AL START macro.name Once you have the contents of your file in /TEXT, you can then incorporate it into your report in a variety of ways. Good luck, Brian Schmit Sr. Programmer, Picis Direct: 781 557 3315 Fax: 781 557 3140 100 Quannapowitt Parkway Suite 405 Wakefield, MA 01880 [EMAIL PROTECTED] www.picis.com Please visit www.picis.com/meditech for additional information about our NPR Report Writing Trainings. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access or use by any other person to this internet email is not authorized and may be unlawful. If you are not the intended recipient, please delete or destroy this email. If you do not wish to receive future emails from the sender, please reply directly to this email requesting you be removed from any mailing list. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Henry Hansen Sent: Friday, March 31, 2006 4:16 PM To: [email protected] Subject: [MEDITECH-L] RE: Can an NPR report read the contents of an ASCIItext file from disk? (Client Server 5.5) All messages should be posted in plain text. HTML will be converted to attachments. The meditech-l web site is MTUsers.com ====================================== First off, thanks for all the posts. Sadly, from what I can determine, Client Server doesn't support the Z.dos functions to read files. Is anyone aware if there are Client Server equivalents for these functions? Thank you, Henry Hansen @ Palliser. _______________________________________________ meditech-l mailing list [email protected] http://mtusers.com/mailman/listinfo/meditech-l _______________________________________________ meditech-l mailing list [email protected] http://mtusers.com/mailman/listinfo/meditech-l
Test File Line 1 Test File Line 2 Test File Line 3 Test File Line 4 Test File Line 5 Test File Line 6 Test File Line 7 Test File Line 8 Blank line below this one Blank line above this one line with more than 199 characters (205) ******************************************************************************************************************************************************************* Line below the long line Line 14 End of File
filetest.npr
Description: filetest.npr
_______________________________________________ meditech-l mailing list [email protected] http://mtusers.com/mailman/listinfo/meditech-l
