| FILE | Index Level | FILELOCK |
| Syntax |
OPEN filename TO file.variable ...
READ variable FROM file.variable... WRITE variable ON file.variable... |
| Category | BASIC |
| Type | Definition |
| Description |
is the symbolic way to access a file after being previously opened in a FlashBASIC progam. "file.variables" are assigned with the "open" statement.
"file.variables" contain the assigned file pointers and are used by subsequent FlashBASIC 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 FlashBASIC 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 |
| Options | |
| See Also | READ MATREAD READV WRITE MATWRITE SELECT WRITEVU DELETE CLEARFILE WRITEV CLOSE RELEASE OPEN data representation COMMON |
| 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. |
| Warnings | |
| Compatibility | D3 7.0 AP R83 |
| FILE | Index Level | FILELOCK |