Ole4D Methods

OCGetRealOfSender(p_EventId;p_Propery;p_4DVar)


Used to retrieve the value of a Ole object property from within the 4D event handling method.
The property must be of type Real.
"p_EventId" is the event id, "p_Property" is the name of the OleObject property that you want to retrieve, and "p_4DVar" is the 4D variable to which will be assigned the value of the property.
This command can be used only in 4D event handling methods, in other methods you should use instead the OCGetRealProperty command .
The p_4DVar variable must be of type Real, and already declared before calling this method.
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_Property String -> Name of the property to which you want to assign a value.
p_4DVarValue Real <- Process or interprocess 4D variable to which will be assigned the value of the property.



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.

Example

` declaring the 4D variable
C_Real(RealVar)
$i:=OCGetRealOfSender($1;"RealProperty";RealVar)

is equivalent to the following sequence of code:

` declaring the 4D variable
C_Real(RealVar)
` using the SHOst.SetReal command we are transferring to the
4D variable named "RealVar" the value of the Ole object's "RealProperty" property
$i:=OCRunScript ("ExampleHost";"Set OleObj=SHost.Sender("+$1+")")
$i:=OCRunScript ("ExampleHost";"SHost.SetReal "+Char(34)+"RealVar"+Char(34)+", OleObj.RealProperty")
  
The "ExampleHost" script host must be already created.