FREESTATE (free resources)

Top  Previous  Next

 

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:

GETSTATE

RESTORESTATE