A call to charout (or lineout) with no arguments sort of became the idiom
for 'Hard Close ["I am done with this file/stream"]'  so, yes, sounds like
not ideal behaviour.    In any case, charout and lineout with no args should
behave identically.
 
Mike


  _____  

From: Erich Steinböck [mailto:[email protected]] 
Sent: 20 August 2016 10:42
To: Open Object Rexx Developer Mailing List
Subject: [Oorexx-devel] CHAROUT() w/o args will close R/W, but not R/O file


We have an open [documentation:200]
<https://sourceforge.net/p/oorexx/documentation/200/>  bug identifying a
quirk with CHAROUT(), which is supposed to close a file, if neither string
nor start arg is given.  But as you can see from below test case, CHAROUT()
will only close the file if it was opened in R/W mode; it will raise
NOTREADY and not close a file if it was opened as R/O.


(The equivalent .Stream methods show the same issue as above).

Is this behavior intended, and as such we should document it?

Or is this an interpreter bug?


call on notready


f = "\temp\inputfile.txt"

say "open" stream(f, "c", "open")      --> open READY:     
say "charout" charout(f)               --> charout 0       
say "close" stream(f, "c", "close")    --> close
           
say "open" stream(f, "c", "open read") --> open READY:     
say "charout" charout(f)               --> charout 0       
                                       --> notready raised 
say "close" stream(f, "c", "close")    --> close READY:    

exit

notready:
say "notready raised"
return



------------------------------------------------------------------------------
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to