dlgEvent__action__AfterBarcode
Function called by relation event after scanning a barcode.
Syntax
PUBLIC FUNCTION dlgEvent__action_action_AfterBarcode(
dlg ui.DIALOG, errNo INTEGER, errMsg STRING, barcode STRING)
The action part of the function name is defined by the Action property of the relation (under Source UI Settings) . If the Action property is not set, an error will occur at compile time.
The function has four parameters:
dlg. This is aui.DIALOGobject referencing the current dialog. The dialog can implement anINPUT,INPUT ARRAY,DISPLAY ARRAY,MENU, orCONSTRUCT. For more information, see The Dialog class in Genero Business Development Language User Guide.errNo. This is anSQLCA.SQLCODEerror.errMsg. This is theSQLERRMESSAGEmessage.barcode. This is the barcode string.
Usage
When you select the After Barcode Scan property for the creation of the event, a function shell is created. Enter your code in the function.
This function is called when a barcode is scanned.
Example: After Barcode Scan
This example uses the After Barcode Scan code event on a relation. The Action property of the relation is set to scan. Every time a user scans a barcode, a message is displayed.
PUBLIC FUNCTION dlgEvent__action_scan_AfterBarcode(dlg ui.DIALOG, errNo INTEGER, errMsg STRING, barcode STRING)
IF errNo == ERROR_SUCCESS THEN
DISPLAY "Barcode scanned: " || barcode
ELSE
DISPLAY "ERROR: [" || errNo || "] " || errMsg
END IF
END FUNCTION