|
OCSetTextParam(p_EventId;p_ParamN;p_Value)
Used to set a value of an event parameter from within the 4D event handling method.
The parameter must be of type String, and the event assigned with the OCSetEventHandler command.
"p_EventId" is the event id, "p_ParamN" is the number of parameter, and "p_Value" is the value that you want to assign to the parameter .
The numbering of
the parameters starts from 0.
The event id is sent as a parameter to the 4D method that handles the event.
Parameters
| Parameter |
Type |
|
Description |
| p_EventId |
String |
-> |
Event identifier.
This value is given as a first parameter to the 4D event handling method.
|
| p_ParamN |
Integer |
-> |
Number of the parameter you want to set, starting from 0. |
| p_Value |
String |
-> |
String type value that you want to assign to the parameter. |
Return Values
0 – The method call was successful.
If the method call was not successful the
return value is not zero. For more information call OCLastError.
Remarks
This command will not work in events assigned using the OCSetAsyncHandler command.
Example
$i:=OCSetTextParam($1;0;"Hello")
is equivalent to the following sequence of code:
$i:=OCRunScript ("ExampleHost";"SHost.SetParam "+$1+", 0 , "+char(34)+"Hello"+char(34))
,which assigns the "Hello" string value to the first parameter of the event.
The "ExampleHost" script host must be already created.
|