Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I want to use two-dimension array
#2
Examples of working with 2D arrays:

Code:
Copy      Help
ARRAY(int) a.create(100 100) ;;create 2D array of integers
a[0 0]=1 ;;set element
int el=a[75 99] ;;get element
a.redim(200) ;;resize the right dimension to 200 elements
a.redim(-1) ;;add 1 element to the right dimension

;display all elements
int i j
for i 0 a.len(1)
,for j 0 a.len(2)
,,out a[i j]

a.createlb(100 1 100 1) ;;create 2D array where lower bound of each dimension is 1 (default is 0)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)