freestate_free_resources_.htm
Navigation: Language Reference > 13 - Built-in Functions >====== FREESTATE (free resources) ====== | |
FREESTATE(file, savedstate)
FREESTATE | Releases all resources allocated by GETSTATE |
file | The label of a FILE declaration. |
savedstate | A LONG numeric variable which represents the value returned by the GETSTATE procedure. |
FREESTATE releases all resources allocated by GETSTATE.
Example:
MyFunction PROCEDURE(FILE MyFile)
CurState LONG
CODE
! File will be in the same state on exit of this procedure as it was on entry
CurState = GETSTATE(MyFile) !save current state of file
SET(MyFile) !ready to access file
NEXT(MyFile) !read a record
CLEAR(MyFile) !clear record buffer
RESTORESTATE(MyFile, CurState) !restore file to initial state
FREESTATE(MyFile, CurState) !release resources
See Also:
freestate_free_resources_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1