User guide
67
VTB USER GUIDE
.OpenCreate(handle as int, path as *char) as char
Creates a new file opening it in write mode, if it already exists it is overwritten.
Parameters
handle Number to assign to file for any reference
path Name of the file, it can contain also the complete path
Example
Used variables:
err char
err=disk.OpenRead(1,”\data\table.dat”) ‘ open table.dat in the directory data
if err
...
endif
CLOSE
Closes the file with the selected HANDLE freeing it to successive use.
Syntax
.Close(handle as int) as char
Parameters
handle Reference number of the file
Example
Used variables:
err char
err=disk.OpenRead(1,”\data\table.dat”) ‘ open table.dat in the directory data
if err
...
endif
...
disk.Close(1) ‘ close the file
READ
Reads data from the file with the selected HANDLE. LEN bytes will be read but if the end of file will be found before
reading will be stopped. In NB will be written the effective number of bytes read.
Syntax
.Read(handle as int, dati as *char, len as long, nb as *long) as char
Parameters
handle Reference number of the file
dati Pointer to buffer in which data will be written
len Number of bytes to read
nb Pointer to the variable in which the effective number of bytes read will be written
Example
Used variables:
err char
dati(100) char
nbyte long










