t3x.org / t3x / t3x-manual / 241.html
 
T3X - A Minimum Procedural Language
Version 8.1.5, Online Edition
Copyright(C) 1996-2004
Nils M Holm
 
Previous:
2.4 Data Declarations
TOC | Index | Back Next:
2.4.2 Constants

2.4.1 Atomic Variables

Each (atomic) T3X variable allocates exactly one machine word. When talking about variables in the remainder of this document, the attribute atomic is implied. Vectors will be implicitly referred to as vectors or arrays.

Variables are defined using a VAR statement. Any number of names may be defined in a single statement:

VAR x_coord, y_coord, depth;

Although, it is recommended to define only logically connected variables in a single statement.

All types of values may be stored in a variable: numeric values, pointers to strings, pointers to vectors, pointers to structures, pointers to objects, or single characters. The range of numeric values which may be stored in a variable depends upon the actual implementation. The Tcode engine uses 32 bits to represent a cell. Therefore, programs which use values not in the range -2147483647...2147483647 should be considered machine-dependent. The T3X compiler will not allow the use of numeric literals outside of this range. Implementations of T3X running on platforms with smaller machine word sizes may restrict the numeric range further. For example, a 16-bit version may limit the range to -32767...32767. Although, this would be a restriction of the implementation and not a restriction of the language.

When a variable is placed in an expression (frequently also called a righthand side value, it evaluates to its value. When it is placed on the lefthand side of an assignment, however, it evaluates to its address (which will be dereferenced immediately by the following assignment operator, though).

Previous:
2.4 Data Declarations
TOC | Index | Back Next:
2.4.2 Constants