|
OCGetRealParam(p_EventId;p_ParamN;p_4DVar)
Used to retrieve the value of an event parameter from within the 4D event handling method.
The parameter must be of type Real.
"p_EventId" is the event id, "p_ParamN" is the number of parameter, and "p_4DVar" is the 4D variable that will receive the value of 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.
The "p_4DVar" variable must be a process or interprocess of type Real, and already declared.
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 which value you want to retrieve, starting from 0. |
| p_4DVar |
Real |
<- |
4D process or interprocess variable of type Real which has to be declared before executing this command. |
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
C_Real(RealVar)
$i:=OCGetRealParam($1;0;RealVar)
is equivalent to the following sequence of code:
C_Real(RealVar)
$i:=OCRunScript ("ExampleHost";"realVariable = SHost.GetParam("+$1+",0)")
$i:=OCRunScript ("ExampleHost";"SHost.SetReal "+Char(34)+"RealVar"+Char(34)+", realVariable")
,which assigns to the "RealVar" 4D variable the value of the first parameter.
The "ExampleHost" script host must be already created.
|