seek()
Purpose
Seek to a position in the file
Description
Move the position to the point specified in the file specified by handle
Syntax
Seek( handle, position )
Arguments
handle handle of the file
position position to seek to (0 is the start)
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