Scripting Additions Guide
Table Of Contents
CHAPTER 2
Scripting Addition Commands
Command Definitions 69
startingByte Specifies the offset of the byte at which to begin writing. A
positive integer indicates the offset from the beginning of the
file, and a negative integer indicates the offset from the end of
the file.
Class: Integer
RESULT
None
EXAMPLES
This example writes “abcde” to the file MyFile.
write "abcde" to file "Hard Disk:MyFile"
The next example returns an error because fewer bytes are specified for the
dataToWrite parameter than are specified for the for bytesToWrite parameter:
write "abcde" to file "Hard Disk:MyFile" for 8
If the data to write is longer than the bytes specified by the bytesToWrite
parameter, the Write command truncates the data. For example, this Write
command writes the number 5 to the file MyFile as a short integer (2 bytes)
rather than an integer (4 bytes):
write 5 to file "Hard Disk:MyFile" for 2
The next example specifies a negative value for the startingByte parameter. It
writes the number 5 as a short integer starting at the 8th byte before the end of
the file.
write 5 to file "Hard Disk:MyFile" starting at -8 for 2
NOTES
The file mark is a marker used by the File Manager that indicates the byte at
which the Read command expects to begin reading data. By default, the file
mark is the first byte of the file. The Write command begins writing at the
current file mark and sets the file mark to the byte after the last byte written.
The Read command can also reset the file mark.