21. 4GL Statement Glossary : RewindFile( )
 
Share this page                  
RewindFile( )
Positions the file to offset 0.
Syntax
[returnfield = ] [callproc] rewindfile(handle =
  handle )
returnfield
Specifies the name of field to which the result is returned. Integer.
handle
Specifies the file identifier used by the 4GL file access functions. Integer.
Description
The rewindfile() function positions an open file to the beginning (offset 0). The file must have been previously opened with the openfile() function and the file's handle must be known to 4GL.
You can rewind all file types. For file types that allow the positionfile() statement, the rewindfile() statement is the same as the statement:
positionfile (handle = handle, offset = 0)
You cannot rewind files opened with the append or create modes.
The procedure returns 0 if the function completes without error.
Example
Rewind the file identified by the handle in the variable fileno.
status = callproc rewindfile(handle = fileno)