Equinox Online Help - Language Reference - A to Z
FileInput |
|
---|---|
Applies to | |
Syntax | FileInput HandleItem, Item1[, Item2, Item3 ... ] |
Action | [Statement] Reads a delimited list of items from a sequential file. |
Scope | Usable anywhere |
Notes | Data is read from the file directly into the items specified in the parameter list, taking account of the delimiters specified in the statement. During the input operation, all quotes are stripped and no account is taken of data types in the file. The items are treated as strings and converted automatically into the destination data types passed as parameters. Arrays and vector expressions are allowable destination types, although the array must be of fixed size. Each item is read up to the item delimiter specified after it in the statement. The delimiters recognised are:
If no delimiter is supplied after the last item, end-of-line is assumed. The delimiters are set up via the FileDelimiters statement. The HandleItem parameter must be of Equinox variable type Handle and is the handle of the file which was opened with the FileOpen statement. This statement is only supported for files opened for sequential access. After the call, the system workarea SysReply contains the number of items read. The system workarea SysError is set to one of the following values
|
Category | File IO |
See Also | FileClose, FileCloseAll, FileDelimiters, FileInput, FileInputLine, FileLock, FileMovePosition, FileOpen, FilePosition, FilePrint, FileRead, FileReadLine, FileReadBinary, FileReadFile, FileUnlock, FileWrite, FileWriteBinary, FileWriteFile |
Example | This example reads records from a sequential file containing names and telephone numbers and creates records in a table. handle hnd The next examples demonstrate the different ways items can read from a file into arrays. The first example is successful if each array element is on a separate line int a[4], n This example is successful if the array elements are comma seperated on one line. int a[4], n |