-
Notifications
You must be signed in to change notification settings - Fork 44
Dimensional arrays
Aaron Niyonzima edited this page Sep 15, 2020
·
2 revisions
Dimensioned arrays are Matrix
and Vectors
in other programming languages.
Bellow is an example:
PROGRAM Arrays
rows = 2
cols = 3
DIM arr(rows, cols) ;* declaring matrix 2x3
*-- Matrix --
* 1 2 3
* 4 5 6
*------------
arr(1, 1) = 1
arr(1, 2) = 2
arr(1, 3) = 3
arr(2, 1) = 4
arr(2, 2) = 5
arr(2, 3) = 6
CRT @(-1) ;* Clear the screen
FOR i = 1 TO rows
FOR j = 1 TO cols
CRT @(j, i) : arr(i, j)
NEXT j
NEXT i
* Convert dimensioned array to dynamic array
MATBUILD arr2 FROM arr USING ","
PRINT arr2 ;* 1, 2, 3, 4, 5, 6
END
- Home
- Getting started with InfoBasic(jbc)
- Key Features of InfoBasic
- Control Flow
- Subroutines and Functions
- OFS
- Template Programming
- T24 Integration with other Systems
- T24 Business Training
- T24 Navigation Training
- T24 Administration Training