callx subroutine

callx subroutine


call Index Level character update
Syntax callx {cataloged.subroutine}
Category Processing Codes
Type Processing Code
Description a FlashBASIC subroutine call which is specified on attribute 8 (the "correlative" attribute) of the file-defining item and is used to maintain data integrity.

Subroutines invoked with the "callx" processing code are executed when an item in Pick is updated, regardless of which process does the updating, i.e.: the Update processor, FlashBASIC "write" statement, TCL "copy" command, or the "t-load" command.

This processing code differs from the "call" subroutine in that it is called any time an item in the file is updated, versus being called when the item is updated from the Update processor.

The FlashBASIC subroutine must adhere to the following:

The parameter passed is the entire item, which may be updated by the subroutine.

access(3) is identical to the parameter upon entry to the subroutine and CANNOT be updated by the subroutine.

access(1) is the file.variable for the data portion of the file.

access(2) is the file.variable for the dictionary portion of file.

access(10) is the item-id and can not be changed by the subroutine.

access(11) is the name of the file.

Note: access(11) returns the name of the data portion of the file only. If the data file name is different from the dictionary name, the designer must program in the dictionary name in order to use this function.

access(12) is the deleted item flag.

access(16) is the new item flag.

access(20) is the "item changed" flag. This works only in releases higher than 5.2.0. In releases prior to 5.2.0, the only way to identify a changed item is by reading the current version from the file, using access(1) for the "file.variable" and access(10) for the item-id.
Options
See Also call processing codes INPUTERR ACCESS file-defining item correlative Processing Codes WRITE
Example
Warnings If a routine writes, deletes, or modifies an item in a file using a "callx" FlashBASIC program to validate the data, and the validation fails, the item is NOT written to the file. This will affect commands like "clear-file", "delete-file", and "t-load".  Since the FlashBASIC "write" command has no "then/else" clause, the program cannot trap the write failure.
Compatibility D3 7.0 AP
call Index Level character update