Close (close the file)

Top  Previous  Next

 

Close, VIRTUAL, PROC

The Close method tells the FileManager the calling procedure is done with the file, then closes the file if no other procedure is using it. The Close method handles any errors that occur while closing the file.

Implementation:

The Close method returns a value of Level:Benign (EQUATE declared in ABERROR.INC). See Error Class for more information on Level:Benign and other severity levels.

Return Data Type:     BYTE

Example:

PROGRAM

INCLUDE('ABFILE.INC')            !declare FileManager class

MAP                              !program map

END

 

GlobalErrors ErrorClass           !declare GlobalErrors object

Access:Client CLASS(FileManager)  !derive Access:Client object

Init      PROCEDURE               !prototype Access:File init

             END

 

Client    FILE,DRIVER('TOPSPEED'),PRE(CLI),CREATE,BINDABLE,THREAD

!file declaration

         END

CODE

GlobalErrors.Init                !initialize GlobalErrors object

Access:Client.Init               !initialize Access:Client object

Access:Client.Open               !open the Client file

 

!program code

 

Access:Client.Close              !close the Client file

Access:Client.Kill               !shut down the Access:Client object

GlobalErrors.Kill                !shut down the GlobalErrors object