SetArgElement PowerScript function
Description
Sets the value in the specified argument element.
Controls
Window ActiveX controls
Syntax
|
1 |
<span>activexcontrol</span>.<span>SetArgElement</span> ( <span>index</span>, <span>argument</span> ) |
|
Argument |
Description |
|---|---|
|
activexcontrol |
Identifier for the instance of the PowerBuilder |
|
index |
Integer specifying argument placement. |
|
argument |
Any specifying the argument value. |
Return Values
Integer. Returns 1 if the function succeeds
and -1 if an error occurs.
Usage
Call this function before calling InvokePBFunction or TriggerPBEvent to
specify an argument for the passed function.
JavaScript scripts must use this function to specify function
and event arguments. VBScript scripts can either use this function
or specify the arguments array directly.
Examples
This JavaScript example calls the SetArgElement 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.<span>SetArgElement</span>(1, theArg); |
|
1 |
theEvent = "ue_args"; |
|
1 |
retcd = PBRX1.TriggerPBEvent(theEvent, numargs); |
|
1 |
... |