File handling Mumps

73 views
Skip to first unread message

Prabhjot Singh

unread,
Apr 27, 2020, 3:53:11 AM4/27/20
to intersystems...@googlegroups.com
Hi All,

I need a simple example (with code) of Read and Write operations on a text file, handling eof exception. Can anyone provide me the same ?

Thanks

Andrew Makinson

unread,
Apr 27, 2020, 4:00:20 AM4/27/20
to intersystems...@googlegroups.com
Yes I can do this - let me get a code example to you. 

Sent from my iPhone

On 27 Apr 2020, at 08:53, Prabhjot Singh <prabh...@gmail.com> wrote:


Hi All,

I need a simple example (with code) of Read and Write operations on a text file, handling eof exception. Can anyone provide me the same ?

Thanks

--
--
IRIS, Caché, Ensemble
---
You received this message because you are subscribed to the Google Groups "IRIS, Caché, Ensemble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-publi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/intersystems-public-cache/CAFJAAx0r14VwQdhmO0k04P-RVXtBdBVdPE1JV9%2B1XfjYTa-5%2Bg%40mail.gmail.com.

lverhulst

unread,
Apr 27, 2020, 9:36:06 AM4/27/20
to intersystems...@googlegroups.com
I use the following a lot in the Legacy Cache code that I write to read in files.

 S FILEIN=<directory and filename>
 O FILEIN:"RS"
 ;$ZUTIL(68,40,1) eliminates the <ENDOFFILE> error for sequential files for the current process.
 ;Test $ZEOF equal to -1 for EOF. 
 S X=$ZUTIL(68,40,1)
 F  U FILEIN R REC Q:$ZEOF=-1  D <something>
 C FILEIN


--
L. Verhulst






Reply all
Reply to author
Forward
0 new messages