Ole4D Methods

OCSetRealParam(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 Real, 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 Real -> Real 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:=OCSetRealParam($1;0;3.14)

is equivalent to the following sequence of code:

$i:=OCRunScript ("ExampleHost";"SHost.SetParam "+$1+", 0 , 3.14")

,which assigns the 3.14 value to the 1'st event parameter.
The "ExampleHost" script host must be already created.