write()
Purpose
Write to a file
Description
Write a string of text to the file specified by handle
Syntax
write( handle, text )
Arguments
handle The handle of the file
text The string of text to be written
Example
string = "Hello World"
printAt( 0, 0, "Open file" )
handle = open()
printAt( 0, 1, "Write to file: ", string )
write( handle, string )
printAt( 0, 2, "Close file" )
close(handle)
printAt( 0, 3, "Open file" )
handle = open()
message = read( handle, 11 )
printAt( 0, 4, "Read from file: ", message )
printAt( 0, 5, "Seek to position 6" )
seek( handle, 6 )
message = read( handle, 5 )
printAt( 0, 6, "Read from file: ", message )
printAt( 0, 7, "Close file" )
update()
close( handle )
for i = 1 to 500 loop
update()
repeat
Associated Commands