User Tools

Site Tools


preupdate_trigger_update_action_pre_processing_.htm
Navigation:  ABC Library Reference > FileManager > FileManager Methods >====== PreUpdate(trigger update action pre-processing) ====== Previous pageReturn to chapter overviewNext page

PreUpdate( Pointer, PutLength, ErrCode, ErrMsg ), returncode

blk2blue.jpg

PreUpdate Returns confirmation that valid dictionary trigger activity has occurred before an attempted action, and optionally sets an error code and message to be processed.
Pointer A LONG that represents the file pointer to be written if PUT ( File, Pointer) or PUT (File, Pointer, Length) is used.
PutLength An UNSIGNED integer that represents the number of bytes to write to the file when PUT (File, Pointer, Length) is used.
ErrCode A string constant, variable, EQUATE, or expression that represents an error code.
ErrMsg A string constant, variable, EQUATE, or expression that represents an error message.
returncode Indicates if an error occurs.

The PreUpdate method is a virtual method that returns a TRUE value by default if pre-update trigger activity was processed normally. The developer must set the return level to FALSE if any problems occurred in the pre-update trigger activity code. When PreUpdate returns FALSE, an ERRORCODE 100 (trigger error) is posted. If ErrCode is set, then FILEERRORCODE will be set to the contents of ErrCode when the error is processed by the ErrorClass object for the associated file (table). Similarly, FILEERROR will be set to ErrMsg.

The PreUpdate method is accessible from a table's trigger properties located in the Dictionary Editor, or, in the Global Embeds of a target application

Implementation:

PreUpdate is implemented using the file driver callback mechanism, therefore, this method will have access to all variables that the File Manager has access to. These variables and the ones added in the Data section of the method will allow the developer to insert code that will be executed after a CHANGE action for a file.

Return Data Type:     BYTE

Example:

 CODE

!Push any pending errors on stack, to allow trigger error detection

 PUSHERRORS()

 ReturnValue = PARENT.PreUpdate(ErrCode,ErrMsg) !returns TRUE by default

 !trigger processing here ' optionally set ErrCode, ErrMsg and ReturnValue

 POPERRORS()

!restore errors saved on the stack

 RETURN ReturnValue

See Also:     PreDelete , PostDelete , PostInsert

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