| System Functions |
|
| Format | FFN(filename$ [ FROM fileno ]
[ FOR
OBJECT
| EXCEPT
OBJECT
] [ ,ERR=stmtref ] )
|
|||||||
| Returns | Integer, channel/file number for open file or -1, if not open or accessible. In all cases, only files currently accessible will be returned. | |||||||
| Description | This
function checks all open files for any reference to the filename$
specified. The function returns the file number as an
integer, if the file is open. If the file is not
currently open on any channel, FFN( )
returns a value of -1. The filename specified in FFN( ) must match the name used to OPEN the file; e.g.,
If a FROM fileno option is specified, the search starts with the file number provided. By default, files that are open but reserved for use by an Object will not be checked unless the FFN function is executed within the object that has the file reserved. The FOR OBJECT or EXCEPT OBJECT clauses can be used within an object to alter this behaviour. The FOR OBJECT will only return files numbers that are reserved for the current object whereas the EXCEPT OBJECT will return files that are generally accessible (i.e. not reserved exclusively by the current object). Use of the FOR/EXCEPT OBJECT clause when not in an object will generate an "Error #95: Bad Object Identifier" |
|||||||
| Examples | Read
a record from the CUSTDBfile. If the file is not open,
then open it on a Global file number.
FFN( ) is case-sensitive (as is necessary in UNIX). To perform a case-insensitive search for the filename, set either 'FL' (lower case) or 'FU' (upper case) parameters.
Forward slashes may be used in place of backslashes.
A leading ./ or .\ is ignored by the FFN( ) function.
|
|||||||