T24 uses jBASE as the back end to store its data. All programs that make up the T24 core are written in a language called Infobasic. Infobasic is a very simple yet powerful programming language. With its English like statements, it makes programming very simple. A salient feature of Infobasic is that it does not support data types. All variables in Infobasic are treated as Dynamic Arrays. Since Infobasic does not support data types, the need to declare variables does not arise.Before we understand the various commands and the way to write programs in Infobasic, it is very essential to understand the concept of arrays.
Every variable that we use occupies a portion of the memory. Usually character variables occupy 1 byte of memory, which have the capacity to store just one character. In case a series of characters (string) like 'T24' has to be stored, then a character variable would not suffice. There comes the need for arrays. We now need 6 bytes of continuous memory blocks in order to store the string. Sequential storage of characters that form a string will make storage and retrieval easier and faster. Moreover all the 6 bytes should have the same name. This is exactly the functionality of an array.
To sum it up, an array is nothing but continuous memory allocation, where in all the bytes have the same name as that of the array and can be distinguished with the help of a subscript which always starts with a '0'.
In case you wish to access 'G' in 'GLOBUS' , then you would specify Array1
There are two different types of arrays that are supported by Infobasic. They are:
- Dynamic Arrays
- Dimensioned Arrays
Dynamic arrays are, as the name implies, dynamic in the number, dimensions and their extents. Dynamic arrays are especially useful in providing the ability to manipulate variable length records with a variable length of fields and/or values within fields etc. A dynamic array is just a string of characters that contain one or more delimiter characters. The delimiter characters are:
|Field Marker (FM)
|Value Marker (VM)
|Sub-Value Marker (SM)
A field marker separates each field and a field may contain more than one value separated by a value marker. Any value may have more than one sub-value separated by a sub-value marker. e.g.
All variables in Infobasic are treated as dynamic arrays. Dynamic arrays do not need any explicit declaration. Initialization would suffice.
Storage Of Data In A Dynamic Array
The following record is a part of the TEMENOS.TRG file.
|3.1 Course Category
|4.1.1 Course Name
|4.1.2 Course Name
|3.2 Course Category
|4.2.1 Course Name
|4.2.2 Course Name
|5 Free Text
If the above record were to be stored in a dynamic array, it would be as follows
Please note that the FM, VM and SMs will be stored as characters but will be stored as special characters.
Dimensioned array provide more efficient means of creating and manipulating tables of data elements where the number of dimensions and the extent (number of elements) of each dimension is known and is not likely to change. Dimensioned arrays have to be declared using the DIMENSION statement.
To declare a dimensioned array use
5 - > Refers to the number of rows
3 - > Refers to the number of columns
You can also create single dimensioned arrays. This type of dimensioned arrays will only have a fixed number of rows. The number of columns will unlimited. In this case, each row in the dimensioned array will be a dynamic array.
5 - > Refers to the number of rows
Columns - Unlimited