Gentee Programming Language > Documentation > GT language Download documentation

Predefined features

Attributes

Since objects are inserted with the help of their full names, it becomes rather inconvenient if an object is embedded several levels deep. You can specify the attribute alias to such an object a new name. If alias is specified with no value, you can address this object using its regular name.

<name1>
<name2 alias = name4>
<name3 = "Object name1/name2/name3" alias>
Object name1/name2
</name2>
Object name1
</name1>

Further on, you can use
#name3# instead of #name1/name2/name3# and
#name4# instead of #name1/name2#

Types

By default, object data are considered a string, but you can use the attribute type to define it as a list (list), keys (keys) or a tree (tree).

List
Each line will be the corresponding array item. Strings can be enclosed by quotes.

<name1 type = list>
First line
"Second
line"
'Third line'
</name1>

Keys
Each line must contain a key and a value.

<name1 type = keys>
first = First line
second = Second line
thrid = "Third
line"
</name1>

Tree
A tree also consists of lines. Square brackets are used to specify a node or a group. The first line after a square bracket will be the name of the group. For an empty name, you should use "".

<name1 type = tree>
Item 1
[ Group 1
Item in group 1
[ Group 2
Item in group 2
]
]
</name1>

GT API Functions allow you to work with objects of this type as with arrays ( arr ), hash tables ( hash ) or trees ( tree ) respectively. If you want to get an item of a list or keys in the GT language, specify its number (beginning from 1) in the list or its key
#name1( 1 ) - the first item in the list of the object name1.
#name2( namekey ) - the item with key namekey in the object name2.
If an item can use parameters in its turn and you want to use them, you should start it from number two.

<name1 type = list>
#2# number 1
#2# number 2
</name1>

In this case, using
#name1( 1, Item ) will give you Item number 1.

See also

    Description of the GT language    GT API methods    gtitem.getobj    gttextapi.htm


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