$ObjErrDescription

Provides a description of the error that triggered an exception.

Syntax

$ObjErrDescription

Return Value

Character string (VARALPHA). Can be reset by an application program.

Comments

The variable gives a meaningful description of the error that triggered an exception in the component. This variable is set to $null when a component operation triggers a Zim error but is set to a meaningful value when a Zim 5207 error is encountered.

Warning

COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.

$acos

Calculates the arccosine of a number.

Syntax

$acos(number)

where

numbera number, or an expression that evaluates to a number

Return Value

Number, with the same number of decimal places as number.

Comments

Use $acos to calculate the arccosine (in radians) of a number. The value returned by this function has the same number of decimal places as number. The absolute value of the number must be between 0 and 1.

Example

let vAngle[3] = $acos(0.500)

The preceding command sets the third element of array variable vAngle to 1.047.

$ObjErrHelpFile

Provides the name of the help file that the component provided when an exception was raised.

Syntax

$ObjErrHelpFile

Return Value

Character string (VARALPHA). Can be reset by an application program.

Comments

The variable provides the name of the help file that the component provided when an exception was raised because of an  improper operation. This variable is set to $null when a component operation triggers a Zim error but is set to a meaningful value when a Zim 5207 error is encountered.

Warning

COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.

$ObjException

A variable set when an exception occurs.

Syntax

$ObjException

Return Value

Number (LONGINT) Can be reset by an application program.

Comments

This variable is set only when a Zim error 5207 is generated (when the component application wishes to raise an exception). When an exception is raised, this variable is set as well as $ObjErrCode, $ObjErrDescription, $ObjErrHelpFile, $ObjErrHelpTopic and $ObjErrObjectType.

Warning

COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.

$ObjErrHelpTopic

Provides a topic number for the help file provided by $ObjErrHelpFile.

Syntax

$ObjErrHelpTopic

Return Value

Number (LONGINT). Can be reset by an application program.

Comments

The variable provides a topic number for the help file provided by the $ObjErrHelpFile. This topic number does not apply to all help files formats. This variable is set to $null when a component operation triggers a Zim error but is set to a meaningful value when a Zim 5207 error is encountered.

Warning

COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.

$ObjErrParameter

Provides the number of the parameter that caused an error.

Syntax

$ObjErrParameter

Return Value

Number (INT). Can be reset by an application program.

Comments

If a Zim error of 5201 (Unknown Parameter) or 5202 (Type Mismatch) occurs, the $ObjErrParameter is set to the number of the parameter that caused the error. If the 5201 error occurs and the $ObjErrParameter is $null, the method or property name is unknown. This variable is reset when an error is triggered that was caused by a component operation.

Warning

COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.

$ObjGetEvent

Obtain the oldest event generated by a COM component.

Syntax

$ObjGetEvent (Object)

Parameters

Objectan object variable or formfield of type OLE

Return Value

Returns a result as per the specification of the object.

Note: Zim attempts to convert to the assigned type. Ensure a proper variable type is assigned.

Comments

COM objects can generate synchronous or asynchronous events. In any case, they will be stacked up until removed by a $ObjGetEvent function invocation. Later, the parameters associated to this event can be queried using the $ObjEventParameter function.

Is up to the programmer’s responsibility to know whether the object raises events and what is the structure of these events.

Example

This example creates a component, runs a specific method and then queries the events by retrieving its parameters:

let vObject = $ObjCreate('MyObject.Anything')
let vResponse = $ObjRunMethod(vObject, 'MyMethod', 'AParameter')
let vResponse = $ObjGetEvent(vObject)
if ($ObjEventName = 'MyEvent')
out $objeventparameter(1)
out $objeventparameter(2)
else
...
endif
let vResponse = $ObjDestroy(vObject)

Warning

COM objects are being discontinued by Microsoft and may not be available in future releases of Zim-X.

pt_BRPortuguese