basic.file.variable Definition/BASIC Program

basic.file.variable

Command basic.file.variable Definition/BASIC Program
Applicable release versions: AP, R83
Category BASIC Program (486)
Description is the symbolic way to access a file after being previously opened in a Pick/BASIC progam. "file.variables" are assigned with the "open" statement.

"file.variables" contain the assigned file pointers and are used by subsequent Pick/BASIC file input and output statements.

Once explicitly assigned, all subsequent "{mat}read{u}", "readv{u}", "{mat}write{u}", "delete", "clearfile", "release", "select" and "close" statements reference the given file by its "file.variable".

Unlike numeric and string variables, file.variables cannot be output with a "print" or "crt" statement. Nor can they be used in a string or arithmetic expression, nor displayed in the Pick/BASIC debugger. "file.variables" can be assigned to other variables in a standard assignment statement. They may, however, be copied to other variables, in the form:

file.variable.b = file.variable.a
Syntax open filename to file.variable ...
read variable from file.variable...
write variable on file.variable...
Options
Example
open "invoices" to inv.f else ...

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.

readu item from inv.f,"cust.345" else ...

An item is read from the "inv.f" (a file.variable opened in the first 
example).

old.invoice.file = inv.f

Both "inv.f" and "old.invoice.file" are file.variables 
which reference the same file.
Purpose
Related basic.read
basic.matread
basic.readv
basic.write
basic.matwrite
basic.select
basic.writevu
basic.delete.statement
basic.clearfile
basic.writev
basic.close
basic.release
basic.open
data.representation
basic.common