FileGet
Previous Top Next

FileGet reads a number or a string from a specific position in an opened file connection.
Syntax: FileGet (Connection name, Position [,String length])
Position is the number of bytes from the beginning of the file where the data is taken from.
If you don't provide String Length then FileGet returns a number.
Each number is saved in 8 bytes format.
If you provide the String Length then FileGet returns a string in the specific length.
To get the file size (in bytes) use FileSize keyword.
Example:
FileOpen (c1, "data.dat",cRandom)
x = FileGet (c1, 16) 'x value will be of the third number stored in the file
FileClose(c1)

Example:
FileOpen (c1, "text.dat",cRandom)
s = FileGet (c1, 5,10) 's will be a string with 10 characters starting from the sixth character in the file.
FileClose(c1)