|
OCGetTextOfSender(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 String.
"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 OCGetTextProperty command .
The p_4DVar variable must be of type Text, 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 |
Text |
<- |
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_Text(TextVar)
` using the OCGetTextOfSender command we are transferring to the 4D variable named "TextVar" the value of the Ole object's "TextProperty" property
$i:=OCGetTextOfSender($1;"TextProperty";TextVar)
is equivalent to the following sequence of code:
` declaring the 4D variable
C_Text(TextVar)
` using the SHost.SetText command we are transferring to the 4D variable named "TextVar" the value of the Ole object's "TextProperty" property
$i:=OCRunScript ("ExampleHost";"Set OleObj=SHost.Sender("+$1+")")
$i:=OCRunScript ("ExampleHost";"SHost.SetText "+Char(34)+"TextVar"+Char(34)+", OleObj.TextProperty")
The "ExampleHost" script host must be already created.
|