variableName data type | Get statement's behavior |
Variant | The Get statement interprets the first two bytes as the DataType of the data to be read.
If the DataType is EMPTY or NULL, the Get statement stops reading data and sets variableName to EMPTY or NULL.
If the DataType is numeric, the Get statement reads the appropriate number of bytes used to store data of that Data Type:
Byte: 1 byte
Boolean: 2 bytes
Integer: 2 bytes
Long: 4 bytes
Single: 4 bytes
Double: 8 bytes
Currency: 8 bytes
Date/time: 8 bytes |
Fixed-length string | The Get statement reads the specified number of characters. For example, if a variable is declared as String*10, the Get statement reads exactly 10 characters. |
Variable-length string | The Get statement behaves differently, depending on the type of file you're using.
Random file: The first two bytes read indicate the string's length. The Get statement reads exactly that number of characters. If variableName is larger than a random file record, data is read from the file until variableName is filled. After variableName is filled, the file position is advanced to the next record.
Binary file: The number of bytes read from the file is equal to the length of the string currently assigned to variableName. If variableName has not been initialized, no data is read from the file. |
A variable of a user-defined type | The number of bytes required to read the data is the sum of the number of bytes required to read all members of the used-defined data type, which cannot contain a dynamic array, a list, or an object. |