EnglishРусский  

Ads

Installer and installation software
Commercial and Freeware installers.

Types and variables

Gentee is a strongly-typed language that is why types occupy a very important place in programming in Gentee. All types can be divided into three groups: numeric types, structural types and the reserved type.

Numeric types

All numeric types are built into the language. uint is the most widespread numeric type. The Gentee language has neither pointers nor logic type, the uint performs their functions. The byte, ubyte, short, ushort types are considered as int or uint types (depending on the sign) when arithmetic operations are performed. If you specify them as fields in structural types, they will occupy the corresponding number of bytes.

Type nameSize of typeMinimumMaximumComments
Integer types
byte1(4)-128+127signed
ubyte1(4)0+255unsigned
short2(4)-32768+32767signed
ushort2(4)0+65535unsigned
int4-2147483648+2147483647signed
uint40+4294967295unsigned
long8-2^63+2^63 - 1signed
ulong80+2^64 - 1unsigned
Floating types
float4(+ or -)10E-37(+ or -)10E38   ;
double8(+ or -)10E-307(+ or -)10E308   

Structure types

Structure types are defined by the type command. Types string ( str), binary data (buf), collection (collection) are embedded into the language. A lot of types are defined in the standard and other libraries (arrays, hashes etc).

Type reserved

The reserved type is of special significance, which belongs neither to the fundamental types nor to the structure ones. This type is denoted by the array of bytes, which is defined and used as the array. The distinctive feature of the reserved type is that, the memory space is reserved where it has been defined. For example, you can specify a field in a structure reserved field[50]. This means that a memory space of 50 bytes will be reserved in the structure. If you specify the same code inside a function then you reserve 50 bytes in the stack for this local variable. The size of memory reservation allows up to 65 535 bytes. Bear in mind that you should not use an expression in order to specify the required size. It is a constant number that must be enclosed in square brackets.