Description: This function sets the number of extra bytes stored in the log file header and returns an error code.
Returns: Numeric
Usage: Script
Format: SetLogHeader(FileName, Size)
Parameters: FileName { text } { required } { no default: }
Any text expression for the file name.
Size { numeric } { required } { no default: }
Any numeric expression for the number of extra bytes.
Comments: This function returns true (1) if successful and false (0) otherwise. It must not be executed when an active Save statement is running with the same file name.
The basic file header size of any file created with a Save statement is 25 bytes; execution of this function adds additional bytes to the end of this standard header.
Example:
If 1 SaveData;
[
headChanged = SetLogHeader("File6.DAT", StrLen(title) + 1);
FWrite("File6.DAT", 0, 25, "%s\000", title);
]
When this script executes, the file called File6.DAT will have its header enlarged to a size able to contain the string title plus the terminating null character. Note that StrLen returns the number of bytes in the string, and that the additional byte in the second parameter is for the null character. The FWrite statement then writes the contents of variable title to the file, beginning at the standard offset size of 25.