| **Navigation:**  [[abc library reference.htm|ABC Library Reference]] > FileManager > FileManager Methods >====== TryOpen (try to open the file) {{c6h0009.jpg|C6H0009.jpg}} ====== | [[trynext try to get next record in sequence .htm|{{btn_prev_n.gif|Previous page}}]][[abc library reference.htm|{{btn_home_n.gif|Return to chapter overview}}]][[tryprevious try to get previous record in sequence .htm|{{btn_next_n.gif|Next page}}]] | | || **TryOpen, PROC** {{blk2blue.jpg|blk2blue.jpg}} The **TryOpen **method tells the FileManager the calling procedure is using the file, then OPENs the file if it is not already open. The TryOpen method does not attempt to handle errors that occur while opening the file. The Open method provides a slightly different (automatic) alternative for opening files. **Implementation:** TryOpen tries to open the file. If it succeeds, it returns Level:Benign (declared in ABERROR.INC). If it fails, it returns the severity level of the error it encountered while trying to open the file. See //Error Class// for more information on severity levels. **Return Data Type:**     BYTE **Example:** ** PROGRAM** ** INCLUDE('ABFILE.INC')            !declare FileManager class** ** MAP .                            !program map** **GlobalErrors ErrorClass           !declare GlobalErrors object** **Access:Client CLASS(FileManager)  !derive Access:Client object** **Init      PROCEDURE               !prototype Access:File init** **       END** **!file declaration** **Client  FILE,DRIVER('TOPSPEED'),PRE(CLI),CREATE,BINDABLE,THREAD** **        END** ** CODE** ** GlobalErrors.Init                !initialize GlobalErrors object** ** Access:Client.Init               !initialize Access:Client object** ** IF Access:Client.TryOpen         !try to open the Client file** **  MESSAGE('Could not open the Client file')   !handle the error yourself** **  RETURN** ** END** ** !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** **See Also:**     [[open open the file .htm|Open]] , [[open open a data structure .htm|OPEN]]