Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Mumps > Peculiarities o...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 902 of 959
Post > Topic >>

Peculiarities of ascii file processing with GT.M

by =?iso-8859-1?q?S=E9bastien_de_Mapias?= <sglrigaud@[EMAIL PROTECTED] > Oct 22, 2007 at 03:29 AM

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




 4 Posts in Topic:
Peculiarities of ascii file processing with GT.M
=?iso-8859-1?q?S=E9bastie  2007-10-22 03:29:21 
Re: Peculiarities of ascii file processing with GT.M
=?iso-8859-1?q?S=E9bastie  2007-10-22 04:11:50 
Re: Peculiarities of ascii file processing with GT.M
=?iso-8859-1?q?S=E9bastie  2007-10-23 06:55:58 
Re: Peculiarities of ascii file processing with GT.M
rodd@[EMAIL PROTECTED] (  2007-10-23 18:11:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 18:49:53 CDT 2008.