Gentee Programming Language > Documentation > Syntax Download documentation

Late Binding Operation.

The ~ operation is used for late binding. This operation has a lot in common with the . operator (used to access a field value or method call); however, at compile time it is sometimes difficult to define all methods and fields of an object, whereas while executing a program a particular method of an object is called for being assigned a field/method name, types and values of parameters. The late binding operation is actually applied for COM objects.

<late binding> ::=<object>'~' (<field name> | <method name>'(' [<parameters>] ')')

An object identifier is the left-hand operand of the ~ operation, that is used for maintaining late binding; the right-hand operand is a field/method name, that is used either for setting up a property (e.g. excapp~Visible) or for calling a method (e.g. excapp~Cells(3,2)).
An object can maintain the following kinds of late binding:

A shortcoming of late binding is that the compiler cannot check if either fields/methods or types are specified properly; it causes problems for troubleshooting.

Have a look at the example of using late binding, where the COM library is applied.

include { "olecom.ge"}
....
oleobj excapp
excapp.createobj( "Excel.Application", "" )
excapp.flgs = $FOLEOBJ_INT
excapp~Visible = 1
excapp~WorkBooks~Add
excapp~Cells( 3, 2 ) = "Hello World!"

See also

    Fields. Address And Pointer Operation    Function Call And Method Call, Function Call Via A Pointer    Table Of Operator Precedence


 Copyright © 2004-2006 Gentee Inc. All rights reserved.