_COMPUTE_

Invokes a method on an OLE automation object and returns a value.

Syntax

CALL NOTIFY(OLE-object-name,'_COMPUTE_',in-OLE-method<,in-parm…,in-parm> ,out-value);
CALL SEND(OLE-object-id,'_COMPUTE_',in-OLE-method<,in-parm…,in-parm> ,out-value);

Details

OLE Arguments
Argument
Character (C) or Numeric (N)
Description
in-OLE-method
C
specifies the OLE method name.
in-parm
C or N
provides a parameter to the OLE method.
out-value
C or N
contains the value returned by the OLE method.
The _COMPUTE_ method invokes a method (with parameters) that is exposed by an OLE automation server. The number of parameters (in-parm arguments) needed varies among different objects and methods. Only methods that have a return value should be used with the _COMPUTE_ method. For methods with no return values, use the _DO_ method.

Example

The following example stores the contents of the item in position 2 of an OLE control in the variable item2obj:
length item2obj $ 200;
call notify('oleobj', '_COMPUTE_', 
            'GetItem', 2, item2obj);
The following example uses the cells method of a spreadsheet object to compute the location of the cell at row 2, column 5, and then sets the value of that cell to 100:
call send(oleobj, '_COMPUTE_', 'Cells', 
          2, 5, cellobj1);
call send(cellobj1, '_SET_PROPERTY_', 
          'Value', 100);