Equinox Online Help - Language Reference - A to Z

Home

FileReadFile

Applies to
SyntaxFileReadFile FileNameExpression, MemoItem
Action[Statement] Reads a file into an Equinox memo
ScopeUsable anywhere
Notes

This statement reads all the data, unformatted, from the filename specified in FileNameExpression into the item specified in the MemoItem parameter. The memo is resized if necessary to accommodate the data.

In order to read data from the server, prepend "SERVER:" (in any case) to the FileNameExpression. This prefix is ignored by the single user version. If the path specification is a relative one, it will start from the program directory - the Eqserver.exe directory for server files, and the Equinox.exe or Equinet.exe directory for everything else.

The system workarea SysError is set to 1 if an error occurs, otherwise zero.

CategoryFile 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 the contents of an HTML file, makes a backup of the file, changes all dates equal to a workarea LastUpdate and formatted like 24th January 21 to a new value contained in the workarea NextUpdate, then rewrites the file.

memo m
string yesterday, tomorrow

yesterday = StrDate(LastUdate, "%nth %m %0y")
tomorrow = StrDate(ThisUpdate, "%nth %m %0y")
path = "C:\HTMLFiles\Master.htm"

FileReadFile path, m

if not syserror then
FileWriteFile path & ".bak", m
Replace m, yesterday, tomorrow
FileWriteFile path, m
end if