Method | Type | Description | Params | Support |
|
|
|
|
|
Close | SUB | Close the stream
Comment: If you close the memorystream, you reset the whole stream.
No need
to open it again (there isn't even an open method for qmemorystream),
just write to the memorystream again. Alain 22 Aug 2002 | 0 | WXG |
CopyFrom | SUB (Stream, Bytes%) | Copy from another stream Either QFileStream or QMemoryStream | 2 | WXG |
| Use CopyFrom to copy a QFILESTREAM or a QMEMORYSTREAM to the current memorystream.
Details:
If Bytes% = 0 then the Stream is reset to position 0 and the whole stream is then copied.
Example:
$INCLUDE "RAPIDQ.INC"
DIM File1 AS QFILESTREAM
DIM Mem AS QMEMORYSTREAM
File1.Open("test.txt", fmOpenRead)
Mem.CopyFrom(File1, 123) '-- Copy 123 bytes from File1
|
ExtractRes | SUB (Resource AS LONG) | Extract resource to memorystream | 1 | WXG |
| Extracts a resource from your program to the memorystream.
Details:
The parameter Resource is not the resource handle, but the absolute position of the resource within your file.
This requires that you use the keyword Resource(n) to specify the resource number.
Example (dumping all resources):
$INCLUDE "RAPIDQ.INC"
$RESOURCE res_1 as "res.1"
$RESOURCE res_2 as "res.2"
DIM Mem AS QMEMORYSTREAM
FOR I = 0 TO ResourceCount-1
Mem.ExtractRes(Resource(I))
NEXT
|
LoadArray | SUB (Array(), NumElements&) | Load data into array | 2 | WXG |
MemCopyFrom | SUB (Address&, Bytes&) | Copies contents of Address& to memorystream | 2 | WXG |
MemCopyTo | SUB (Address&, Bytes&) | Copies contents to Address& | 2 | WXG |
Read | SUB (variable) | Generic Read, determines the storage space and saves data in variable | 1 | WXG |
ReadLine | FUNCTION () AS STRING | Reads an entire line | 0 | W |
ReadNum | FUNCTION (n) AS DOUBLE | Read n bytes, returns number | 1 | WXG |
ReadStr | FUNCTION (n) AS STRING | Read n bytes, returns the string | 1 | WXG |
ReadBinStr | FUNCTION (n) AS STRING | Read n bytes, returns the binary string | 1 | W |
ReadUDT | SUB (MyType) | Read and store data in a MyType structure | 1 | WXG |
SaveArray | SUB (Array(), NumElements&) | Save array | 2 | WXG |
Seek | SUB (Position%, From%) | Seek to Position%, From% see RAPIDQ.INC | 2 | WXG |
Write | SUB (variable) | Generic Write, determines the storage space and saves data to memory | 1 | WXG |
WriteLine | SUB (S AS STRING) | Writes string with CR+LF | 1 | W |
WriteNum | SUB (number, bytes%) | Writes a number to memory | 2 | WXG |
WriteBinStr | SUB (string, bytes%) | Writes a binary string to file (slow) | 2 | W |
WriteStr | SUB (string, bytes%) | Writes string to memory | 2 | WXG |
WriteUDT | SUB (MyType) | Write data stored in a MyType structure | 1 | WXG |