close()
Purpose
Closes a file
Description
Closes a file previously opened with Open
Syntax
close( handle )
Arguments
handle The handle of the file
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