User Tools

Site Tools


restorefile_restore_a_previously_saved_file_state_.htm
Navigation:  ABC Library Reference > FileManager > FileManager Methods >====== RestoreFile (restore a previously saved file state) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

RestoreFile( filestateid,dorestore )

blk2blue.jpg

RestoreFile Restores a previously saved file state.
filestateid A USHORT returned by the SaveFile method that identifies the file state to restore.
dorestore An boolean integer constant, variable, EQUATE, or expression to indicate whether or not to perform the restoration. If omitted, the default of TRUE (1) is implied.

The RestoreFile method restores the specified file state for the managed file. RestoreFile restores from states previously saved by the SaveFile method.

Implementation:

The RestoreFile method restores file position, as well as any active HOLD or WATCH. RestoreFile calls the RestoreBuffer method to restore the managed file's record buffer contents.

Example:

SaveState USHORT               !must be a USHORT

CODE

SaveState = Access:MyFile.SaveFile()  !save the file state

SET(MyKey,MyKey)              !access the file (change the file state)

LOOP UNTIL Access:MyFile.Next()

 !Check range limits here

 !Process the record here

END

Access:MyFile.RestoreFile(SaveState)  !restore the previously saved file state

See Also:     SaveFile, RestoreBuffer

restorefile_restore_a_previously_saved_file_state_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1