User Tools

Site Tools


geterror_return_the_current_error_id_.htm
Navigation:  ABC Library Reference > FileManager > FileManager Methods >====== GetError (return the current error ID) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

GetError

blk2blue.jpg

The GetError method returns the current error ID for the managed file. See Error Class for more information on error IDs.

Return Data Type:     SIGNED

Example:

PROGRAM

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

MAP                                       !program map

LogError   (STRING filename, SHORT error)  !prototype LogError procedure

END

GlobalErrors ErrorClass                    !declare GlobalErrors object

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

             END

ErrorLog  FILE,DRIVER('TopSpeed'),PRE(LOG),CREATE,THREAD!declare log file

Record     RECORD

Date        LONG

Time        LONG

File        STRING(20)

ErrorId     SHORT

          END

         END

CODE

!program code

IF Access:Client.Open()           !if error occurs

 LogError(Access:Client.GetName(),Access:Client.GetError())!log name and error id

END

!program code

LogError PROCEDURE(STRING filename, SHORT error)

CODE

LOG:Date   = TODAY()              !store date

LOG:Time   = CLOCK()              !store time

LOG:File   = filename             !store filename

LOG:ErrorId = error               !store error id

ADD(ErrorLog)                     !write logfile

geterror_return_the_current_error_id_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1