Page 1 of 1

Seq file

Posted: Thu Aug 11, 2005 6:03 pm
by bdixon
Hi,

I am writing a before subroutine to read a sequential file however under certain circumstances I need to reset the pointer to the top of the file. Is there any way to do this or do I need to close the file and re-open it?

Thanks
Brad

Posted: Thu Aug 11, 2005 9:28 pm
by chulett
Check out the SEEK command. I would think you can use that to get back to the beginning of the file.

Posted: Fri Aug 12, 2005 1:40 am
by ray.wurlod

Code: Select all

Seek filevariable, offset, position
Then
   * statements if Seek successful
End
Else
   * statements if Seek failed
End
The position argument is 0 for current position, 1 for beginning of file, 2 for end of file. Therefore, to position to beginning of file you need

Code: Select all

Seek filevariable,0,1 ...