Muokkaa

Jaa


Variant.IsAutomation() Method

Version: Available or changed with runtime version 1.0.

Indicates whether an AL variant contains an Automation variable.

Syntax

Ok :=   Variant.IsAutomation()

Note

This method can be invoked using property access syntax.

Parameters

Variant
 Type: Variant
An instance of the Variant data type.

Return Value

Ok
 Type: Boolean
true if the AL variant contains an Automation variable, otherwise false.

Example

The following example determines whether an AL variant contains an Automation variable. The MyAutomation variable is assigned to the variant variable that is named MyVariant. The IsAutomation method determines whether the variant contains an Automation variable and stores the return value in the varResult variable. In this case, the variant contains an Automation variable so Yes is returned and displayed in a message box. The IsCode Method (Variant) determines whether the variant contains a code variable. The return value is No because the variant does not contain a code.

var
    MyAutomation: Automation "AFormAut 1.0 Type Library";
    MyVariant: Variant;
    varResult: Boolean;
    Text000: Label 'Does the variant contain an Automation variable? %1.';
    Text001: Label 'Does the variant- contain a code variable? %1.';
begin
    MyVariant := MyAutomation;  
    varResult := MyVariant.IsAutomation;  
    Message(Text000,varResult);  
    varResult := MyVariant.IsCode;  
    Message(Text001, varResult);  
end;

Variant Data Type
Get Started with AL
Developing Extensions