Equinox Online Help - Language Reference - A to Z
FileWriteBinary |
|
---|---|
Applies to | |
Syntax | FileWriteBinary HandleItem, Item, LengthExpression |
Action | [Statement] Writes a specified number of bytes from a string to a random file. |
Scope | Usable anywhere |
Notes | This statement was formerly known as FileWriteString. Any existing calls to FileWriteString will automatically be updated to FileWriteBinary, unless they are contained in a Macro, in which case you will need to manually update these calls. This statement writes data of specified length from strings within the method language to a random file. Whereas the FileWrite statement writes formatted binary data, this statement writes unformatted data up to the length specified in LengthExpression. If LengthExpression is less than the size of the item, Equinox writes the specified amount only. Note that this may lead to unexpected and environment-specific results if the item is not a string. This statement will not work if the file has been opened as a sequential file. The HandleItem parameter must be of Equinox variable type Handle and is the handle of the file which was opened with the FileOpen statement. The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero. |
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 creates a log in a random file of certain database operations. It uses the function Len to determine the length of the string to output. string Routine |