A file variable is the symbolic way to access a file after being previously opened in a BASIC program. File variables are assigned with the open statement.
open filename to file.var... read var from file.var... write var on file.var...
A file variable contains the assigned file pointers and are used by subsequent BASIC file input and output statements.
Once explicitly assigned, using these statements references the given file by its file variable.
clearfile
delete
matread
matreadu
matwrite
matwriteu
open
read
readu
readv
readvu
release
select
write
writev
writevu
Unlike numeric and string variables, a file variable cannot be output with a print or crt statement, used in a string or arithmetic expression, or displayed in the FlashBASIC or BASIC debugger. A file variable can be assigned to other variables in a standard assignment statement or copied to other variables, in the form:
file.var.b= file.var.a
This opens the invoices file to a file variable called inv.f. Throughout the rest of the program, inv.f is used for any reference to the invoices file.
open "invoices" to inv.f else...
An item is read from the inv.f (the file variable opened in the first example).
readu item from inv.f,"cust.345" else...