IMetabase.CreateCodeBlock

Syntax

CreateCodeBlock: IMetabaseCodeBlock;

Description

The CreateCodeBlock method returns an object that contains a code on Fore.

Example

Sub Main;

Var

Mb : IMetabase;

Blo: IMetabaseCodeBlock;

a: Array;

v: Variant;

Begin

Mb := MetabaseClass.Active;

Blo := Mb.CreateCodeBlock;

Blo.References := "MathFin";

Blo.Text := "Sub M;" + #10 +

"Begin" + #10 +

" Debug.WriteLine(Math.Round(100.959, 2).ToString);" + #10 +

"End Sub M;";

If Blo.Valid Then

v:=Blo.Execute("M",a);

Else

Debug.WriteLine(Blo.ErrorMessage + ". line " + Blo.Line.ToString+". position "+Blo.Position.ToString);

End If;

Dispose Blo;

End Sub Main;

After executing the example the Blo variable contains the object that is a code block on Fore.

See also:

IMetabase