<tutorialjinni.com/>

Arrays in Temenos T24 InfoBasic

Posted Under: Infobaic, jBase, Temenos T24 on Aug 26, 2010
Arrays in Temenos T24 InfoBasic
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'.



Note : In case you wish to access 'G' in 'GLOBUS' , then you would specify Array1[0]

There are two different types of arrays that are supported by Infobasic. They are:
  1. Dynamic Arrays
  2. Dimensioned Arrays

Dynamic 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:

ASCII Decimal Description
254 Field Marker (FM)
253 Value Marker (VM)
252 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.

Filed1FMField2FM Value1VMValue2VMValue3VMValue4FMField4FMSubValue1SMSubValue2FMField5

Note : 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.
1 Name TemenosTrg
2.1 Address Pakistan
2.2 Address UK
2.3 Address Geneva
3.1 Course Category Technical
4.1.1 Course Name JBASE
4.1.2 Course Name T24
3.2 Course Category Functional
4.2.1 Course Name Lending
4.2.2 Course Name Financials
5 Free Text
6 Inputter TRAINER.1
If the above record were to be stored in a dynamic array, it would be as follows

TemenosTrgFMPakistanVMUKVMGenevaFMTechnicalVMFunctionalFM jBASESMT24VMLendingSMFinancialsFMFMTrainer.1

Please note that the FM, VM and SMs will be stored as characters but will be stored as special characters.

Dimensioned Arrays

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
DIM ARRAY2(5,3)
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.

DIM ARRAY3(5)
5 - > Refers to the number of rows
Columns - Unlimited

© Tutorial Jinni