TriggerPBEvent PowerScript function
Description
Triggers the specified user event in the child window contained
in a PowerBuilder window ActiveX control.
Controls
Window ActiveX controls
Syntax
|
1 |
<span>activexcontrol</span>.<span>TriggerPBEvent</span> ( <span>name</span> {, <span>numarguments </span>{, <span>arguments</span> } } ) |
|
Argument |
Description |
|---|---|
|
activexcontrol |
Identifier for the instance of the PowerBuilder |
|
name |
String specifying the name of the user |
|
numarguments (optional) |
Integer specifying |
|
arguments (optional) |
Variant array containing event arguments. If you specify this argument, you must also specify numarguments. JavaScript cannot use this argument. |
Return Values
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 |
function triggerEvent(f) { |
|
1 |
var retcd; |
|
1 |
var rc; |
|
1 |
var numargs; |
|
1 |
var theEvent; |
|
1 |
var theArg; |
|
1 |
retcd = 0; |
|
1 |
numargs = 1; |
|
1 |
theArg = f.textToPB.value; |
|
1 |
PBRX1.SetArgElement(1, theArg); |
|
1 |
theEvent = "ue_args"; |
|
1 |
retcd = PBRX1.<span>TriggerPBEvent</span>(theEvent, numargs); |
|
1 |
rc = parseInt(PBRX1.GetLastReturn()); |
|
1 |
if (rc != 1) { |
|
1 |
alert("Error. Empty string."); |
|
1 |
} |
|
1 |
PBRX1.ResetArgElements(); |
|
1 |
} |
This VBScript example calls the TriggerPBEvent function:
|
1 |
Sub TrigEvent_OnClick() |
|
1 |
Dim retcd |
|
1 |
Dim myForm |
|
1 |
Dim args(1) |
|
1 |
Dim rc |
|
1 |
Dim numargs |
|
1 |
Dim theEvent |
|
1 |
retcd = 0 |
|
1 |
numargs = 1 |
|
1 |
rc = 0 |
|
1 |
theEvent = "ue_args" |
|
1 |
Set myForm = Document.buttonForm |
|
1 |
args(0) = buttonForm.textToPB.value |
|
1 |
retcd = PBRX1.<span>TriggerPBEvent</span>(theEvent, & <br> numargs, args) |
|
1 |
rc = PBRX1.GetLastReturn() |
|
1 |
if rc <> 1 then |
|
1 |
msgbox "Error. Empty string." |
|
1 |
end if |
|
1 |
end sub |