Hello,
Taking the code from the user's guide I wrote the
following:
readfile
w "in test rf",!
n f
s f=3D"gtm/t.txt"
o f:(exception=3D"g BADOPEN")
w "OK file open",!
u f:exception=3D"g EOF"
f u f r line u $p w line,!
c f
u 0
w "ok out of loop now",!
w "ok file closed",!
q
EOF if '$ZEOf zm +$ZS
close f
q
BADOPEN if $P($ZS,",",1)=3D2 d q
.write !,"The file ",f," does not exist."
if $P($ZS,",",1)=3D13 d q
. w !,"The file ",f," is not accessible."
ZM +$ZS
q
I have a few questions:
1/ is there a way to tell the 'mumps' program not to
remove the carriage returns from the text lines ?
how come I have to add a '!' to the 'write' function ?
2/ 'r[ead] line' processes an entire line - is it possible
to deal with characters one at a time only when
reading from a file ?
3/ at the GTM prompt I do see my "in test rf" but
once I'm out of the 'for' loop I don't see my 2
other 'write' instructions ("ok out of loop now" and
"ok file closed"): what's wrong ? (I tried with 'use 0'
and 'use $p')
Thanks !
Regards,
S=E9bastien


|