TriggerPBEvent
PowerScript function
Description
Triggers the specified user event in the child window contained in a
PowerBuilder window ActiveX control.
Applies to
Window ActiveX controls
Syntax
|
1 |
activexcontrol.TriggerPBEvent ( name {, numarguments {, arguments } } ) |
|
Argument |
Description |
|---|---|
|
activexcontrol |
Identifier for the instance of the PowerBuilder window |
|
name |
String specifying the name of the user event. This |
|
numarguments (optional) |
Integer specifying the number of elements in the arguments |
|
arguments (optional) |
Variant array containing event arguments. In PowerBuilder, If you specify this argument, you must also specify JavaScript cannot use this argument. |
Return value
Integer.
Returns 1 if the function succeeds and -1 if an error occurs.
Usage
Call this function to trigger a user event in the child window
contained in a PowerBuilder window ActiveX control.
To check the PowerBuilder function’s return value, call the
GetLastReturn function.
JavaScript cannot use the arguments argument.
Examples
This JavaScript example calls the TriggerPBEvent function:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
function triggerEvent(f) { var retcd; var rc; var numargs; var theEvent; var theArg; retcd = 0; numargs = 1; theArg = f.textToPB.value; PBRX1.SetArgElement(1, theArg); theEvent = "ue_args"; retcd = PBRX1.TriggerPBEvent(theEvent, numargs); rc = parseInt(PBRX1.GetLastReturn()); if (rc != 1) { alert("Error. Empty string."); } PBRX1.ResetArgElements(); } |
This VBScript example calls the TriggerPBEvent function:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Sub TrigEvent_OnClick() Dim retcd Dim myForm Dim args(1) Dim rc Dim numargs Dim theEvent retcd = 0 numargs = 1 rc = 0 theEvent = "ue_args" Set myForm = Document.buttonForm args(0) = buttonForm.textToPB.value retcd = PBRX1.TriggerPBEvent(theEvent, & numargs, args) rc = PBRX1.GetLastReturn() if rc <> 1 then msgbox "Error. Empty string." end if end sub |
See also