Rewinding a sequential file to the beginning

rewind #

Rewind a sequential file to the beginning


SYNTAX

rewind #channel [, #channel]…

Rewinds the sequential file(s) open on the channel(s) specified.

If the file is open in read mode, the next get[field] # command reads from the beginning of the file. If the file is open in create or append mode, the next put[field] # overwrites the beginning of the file. Rewinding a file does not truncate it.

#channel

The channel number must be an integer expression in the range 1-64. It is the number that was allocated to the file when it was opened (using open #). It may be a constant, field name or expression.


NOTES

  • The seek # command is used to position a file at any point.

  • The wind # command positions a file at the end.

  • If the channel is closed the command is ignored.


EXAMPLE

rewind #2, #3

RELATED TOPICS

open #

seek #

wind #

fseek

frewind

Sequential files

Traps