Navigation: ABC Library Reference > FileManager > FileManager Methods >====== RestoreFile (restore a previously saved file state) ====== | ![]() ![]() |
RestoreFile( **//filestateid,dorestore //)**
| 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





