All messages should be posted in plain text. HTML will be converted to
attachments. The meditech-l web site is MTUsers.com
======================================
Hi Mitch,
How about the following:
@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) @Memory.read.text(MEM)^TEXT,
IF{TEXT;" "}^/TEXT[-/TEXT[""]+1]},
@Memory.free(MEM)},
@CLEAN.UP
DELETE.TEXT.ARRAY
""^X,
DO{>/TEXT[X]^X ""^/TEXT[X]}
CLEAN.UP
""^FILE^MEM^TEXT
The only modifications are in the DO loop. I have added the use of the NPR
Macro called @Memory.more. It should return a non-nil value if there is
anything more to read in the Memory buffer (even blank lines). I have also
added an IF statement so that a blank space is assigned to the /TEXT array if
there is no value in the local variable called TEXT.
I have not had a chance to try this out, but I think it should work for you.
Please let me know if it doesn't.
Thanks,
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: Lawrence, Mitchell [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 04, 2006 10:04 AM
To: Brian Schmit; 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)
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
_______________________________________________
meditech-l mailing list
[email protected]
http://mtusers.com/mailman/listinfo/meditech-l