IMsExpressionEdit.AddStub

Syntax

AddStub(Name: String; Stub: IVariableStub);

Parameters

Name. Cube name.

Stub. Added cube.

Description

The AddStub method adds a cube as a data source of MsExpressionEdit.

Comments

To use cube facts in expression:

  1. Enter cube name that is set by the Name parameter.

  2. Put the "!" character.

  3. Press CTRL+SPACE. The drop-down list containing cube facts is displayed.

  4. Select the required fact in the list.

The selected fact is inserted into the MsExpressionEdit expression.

Example

Executing the example requires that the repository contains a form with the MsExpressionEdit component with the MSEXPRESSIONEDIT1 identifier. The repository must contain a cube with the CUBE identifier.

Add links to the Cubes, Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Stub: IVariableStub;
Begin
    mb := MetabaseClass.Active;
    // Get cube
    Stub := mb.ItemById("CUBE").Bind As IVariableStub;
    // Connect cube to MsExpressionEdit1
    MsExpressionEdit1.AddStub("Cube", Stub);
    // Set mode of displaying operands
    MsExpressionEdit1.UseFullVariableNames := True;
End Sub UserProc;

After executing the example, facts of the CUBE cube can be used in the MSEXPRESSIONEDIT1 expression, names of operands are displayed in full.

See also:

IMsExpressionEdit