Ole4D Methods

OCSetLongOfSender(p_EventId;p_Propery;p_Value)


Used to set a property of the Ole object from within the 4D event handling method.
The property must be of type Long Integer.
"p_EventId" is the event id, "p_Property" is the name of the OleObject property that you want to set, and "p_Value" is the value that you want to assign to the property .
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_Value Long -> Long type value that you want to assign to 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
$i:=OCSetLongOfSender($1;"LongProperty";314)
If ($i#0)
  OCLastError ($i;$sys_msg;$plug_in_msg;$line;$char;$Codeline)
  Alert($sys_msg+Char(13)+$plug_in_msg)
End if


is equivalent to the following sequence of code:

$i:=OCRunScript ("ExampleHost";"Set OleObj=SHost.Sender("+$1+")")
$i:=OCRunScript ("ExampleHost";"OleObj.LongProperty = 314")
If ($i#0)
  OCLastError ($i;$sys_msg;$plug_in_msg;$line;$char;$Codeline)
  Alert($sys_msg+Char(13)+$plug_in_msg)
End if

The "ExampleHost" script host must be already created.