|
Class Reference
%Stream.NullBinary
|
|
![]() |
|||
Private Storage |
This is a null binary stream, so although you can write to it the length will always be zero bytes.
|
|
Properties | ||||
---|---|---|---|---|
%Location | AtEnd | Attributes | Id | LastModified |
LineTerminator | Size |
|
Returns true if this is a "NULL" stream; that is, a stream which has never been written to and saved. This is used by the Caché ODBC server.
Move to the end of the stream so the nextWrite will be appended to the end. This allows you to read from a stream, then MoveToEnd() and append new data, where just calling Write after a read will clear the stream before writing new data.Returns a
%Status value indicating success or failure.
Reads up to len characters from the current position in the stream. The current position is advanced by the number of characters read. Upon exit, len is set to the actual number of characters read. If a read occurs when the stream position is at the end of the stream, len will be set to -1 andRead will return a null string ("").You must call
Rewind if you want to read a stream from the beginning again. CallingRead afterWrite implicitly ends theWrite operation and rewinds to the start of the stream.Returns a string up to len characters long. The byref argument sc will return a %Status if any error occurred during the read.
Read a line from the stream. This will look for the line terminator in the stream and once it finds the terminator it will return the string minus the terminator character/s. If it reaches the end of the stream before it finds a terminator it will return the data it has so far, and if you specify a maximum size in len it will only read up to this number of characters. On exit len will contain the actual number of characters read. The byref argument sc will return a %Status if any error occured during the read and the byref argument eol is true if it found the line terminator and false otherwise. So for example you can read in a stream a line at a time and output the results to the current device with:While 'stream.AtEnd { Write stream.ReadLine(,.sc,.eol) If $$$ISERR(sc) { Write "ERROR" Quit } If eol { Write ! } }
Deprecated method, use%Save instead. Saves the temporary copy of the stream data to a persistent location. Note that any locking or transaction handling must be done by the caller.Returns a
%Status value indicating success or failure.
This is a Get accessor method for theSize property.
Appends the string data to the stream and advances the current stream position by the number of characters in data.Note that a write operation immediately following a read or rewind will clear out the existing data in the stream.
Returns a
%Status value indicating success or failure.
Appends the string data along with a line terminator to the stream and advances the current stream position by the number of characters in data plus the line terminator.Returns a
%Status value indicating success or failure.