© MCS Electronics, 1995-2007
Syntax
GET #channel, var
GET #channel, var , [pos] [, length]
Remarks
GET in combination with the software/hardware UART reads one byte fromthe UART.
GET in combination with the AVR-DOS file system is very flexible and versatile. It works on files opened in BINARY mode and you can reads all data types.
#channel |
A channel number, which identifies an opened file. This can be a hard coded |
|
constant or a variable. |
Var |
The variable or variable array that will be assigned with the data fromthe |
|
file |
Pos |
This is an optional parameter that may be used to specify the position where |
|
the reading must start from. This must be a long variable. |
Length |
This is an optional parameter that may be used to specify how many bytes |
|
must be read from the file. |
|
|
By default you only need to provide the variable name. When the variable is a byte, 1 byte will be read. When the variable is a word or integer, 2 bytes will be read. When the variable is a long or single, 4 bytes will be read. When the variable is a string, the number of bytes that will be read is equal to the dimensioned size of the string. DIM S as string * 10 , would read 10 bytes.
Note that when you specify the length for a string, the maximum length is 254. The maximum length for a non-string array is 65535.
Partial Example:
GET #1 , var ,,2 ' read 2 bytes, start at current position GET #1, var , PS ' start at position stored in long PS
GET #1, var , PS, 2 ' start at position stored in long PS and read 2 bytes
See also
INITFILESYSTEM , OPEN , CLOSE, FLUSH , PRINT, LINE INPUT, LOC, LOF , EOF , FREEFILE , FILEATTR , SEEK , BSAVE , BLOAD , KILL , DISKFREE , DISKSIZE , PUT , FILEDATE , FILETIME , FILEDATETIME , DIR , FILELEN , WRITE , INPUT
ASM
current position |
goto new position first |
Byte: |
|
_FileGetRange_1 |
_FileGetRange_1 |
Input: |
Input: |
r24: File number |
r24: File number |
X: Pointer to variable |
X: Pointer to variable |
T-Flag cleared |
r16-19 (A): New position (1-based) |