IForeRuntime.BindToObject

Syntax

BindToObject(RealObject: Object): IForeObject;

Parameters

RealObject. Custom class instance.

Description

The BindToObject method provides access to custom class instance.

Comments

The method does not support work with system class instances available in development environment system assemblies.

Example

Add a link to the Fore, Metabase system assembly.

Sub ShowObject(Obj: Object);
Var
    Runtime: IForeRuntime;
    ClassInst: IForeObject;
    Field: IForeVar;
    c, i: Integer;
Begin
    Runtime := (MetabaseClass.Active 
As IForeServices).GetRuntime;
    
//Get custom class instance
    ClassInst := Runtime.BindToObject(Obj);
    
//View field values
    c := ClassInst.FieldsCount;
    
For i := 0 To c - 1 Do
        Field := ClassInst.FieldItem(i);
        Debug.WriteLine(Field.Name + 
" : " + Field.Value);
    
End For;
End Sub ShowObject;

The specified procedure enables getting information about field values of custom classes instances. The class instance is sent as procedure input parameter, the field values are displayed to the development environment console.

See also:

IForeRuntime