The Stream class has the handy instance methods arrayIn and arrayOut.
To read the content of a stream into an array the following statements are
necessary:
s=.stream~new(streamFileName)
s~open( [read|both] )
arr=s~arrayIn( [Lines|Chars] )
s~close
To write the content of an array into a stream the following statements are
necessary:
s=.stream~new(streamFileName)
s~open( [write | both [append|replace]] )
s~arrayOut(arr [,Lines|Chars])
s~close
---
It would be very handy, if the Stream class also offered as class methods arrayIn and arrayOut that
would allow one single statement to read from any stream (file) into an array or to write an array
to any stream (file).
class method arrayIn:
arr=.stream~arrayIn( streamFileName [,Lines|Chars] ) -- default: Lines
and
class method arrayOut:
.stream~arrayOut(streamFileName , arr [,append|replace] [,Lines|Chars] ) --
default: append, Lines
What do you think?
Would you see any problems and if so which ones?
---rony
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel