This function will return the requested amount of subsequent bytes, ie. it reads data from the specified buffer starting at the current buffer position and continuing until the requested amount of bytes was read or until the buffer end, whichever case is first. The function will return the data as is, hence including all control chars. The operation is in that very similar to GET when reading from files.
The current buffer position is updated accordingly and is on the first byte behind the just read data after the call. Hence, sequential reading is easily possible with subsequent calls. You may use EndOfBuf() to check, whether the buffer end is reached or not.
SYNTAX:
rawData$ = ReadBufRawData$ (buf$(), size&)
INPUTS:
buf$() (STRING array)
- This is the array of any existing and initialized buffer, from which you wanna read.
size& (LONG)
- The amount of bytes to read from the buffer.
- Note there's an intended side effect on this argument. If the read reaches the buffer end, then size& is adjusted to the remaining amount of bytes.
RESULT:
rawData$ (STRING)
- The raw data read from the buffer inclusive all control chars. You may get back numbers using the various _CV functions or VAL, depending on the method you used to write those numbers.
- Will be an empty string, if you try to read past the buffer end. However, no error is thrown in such a case.
NOTES:
- If required, the following functions may be used to set the current buffer position in advance:
- SeekBuf() with an appropriate displacement and seek mode.
- GotoBufMark() to restore to an earlier marked position.
- FindBufFwd() or FindBufRev() to move to the next or previous occurrence of the designated find data (starting from the current position).