Get Instruction
Syntax
Get [#]StreamNum, [RecordNum], var
Group
Description
Get a variable's value from StreamNum.
Parameters
Parameters | Description |
---|---|
StreamNum | Streams 1 through 255 are private to each macro. Streams 256 through 511 are shared by all macros. |
RecordNum | For Random mode files this is the record number. The first record is 1. Otherwise, it is the byte position. The first byte is 1. If this is omitted then the current position (or record number) is used. |
var |
This variable value is read from the file.
For a fixed length variable (like Long) the number of
bytes required to restore the variable are read.
For a
Variant
variable two bytes are read which describe its type
and then the variable value is read accordingly.
For a
user type
variable each field is read in sequence.
For an array variable each element is read in sequence.
For a dynamic array variable the number of dimensions and range of
each dimension is read prior to reading the array values.
All binary data values are read from the file in little-endian
format.
NOTE: When reading a string (or a dynamic array) from a Binary mode file
the length (or array dimension) information is not read.
The current string length determines how much string data is read.
The current array dimension determines how may array elements are read.
|
Example
Sub Main Dim V As Variant Open MacroDir & "\SAVE_V.DAT" For Binary Access Read As #1 Get #1, , V Close #1 End Sub
See also