How can i add values to Multidimensional Arrays

Post Reply
sajith
Posts: 110
Joined: Wed Feb 18, 2009 9:58 am
Location: India
Contact:

How can i add values to Multidimensional Arrays

Post by sajith »

can anyone help me
How can i add values to Multidimensional Arrays
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: How can i add values to Multidimensional Arrays

Post by anserkk »

Dear Mr.Sajith

You can use

Code: Select all

aAdd(aArrayName,Value)    // Single dimension array
aAdd(aArrayName,{Value1,Value2})  // Creates 2 dimensional array
aAdd(aArrayName,{Value1,Value2,Value3})  // Creates 3 dimensional array
 
Please note the usage of {} in aAdd() while creating single dimensional and multi dimensional arrays

For eg:

Code: Select all

Local aNumbers:={}
For 1:=1 to 100
   aAdd(aNumbers,{i,i*10,"Element "+str(i,3)})
Next
The array aNumbers will get created with the following Values

1,10,Element 1
2,20,Element 2
3,30,Element 3
4,40,Element 4
.........
.........
100,1000,Element 100

Regards

Anser
sajith
Posts: 110
Joined: Wed Feb 18, 2009 9:58 am
Location: India
Contact:

Re: How can i add values to Multidimensional Arrays

Post by sajith »

Many Thanks for ur Replay, code works Fine


regards Sajith
Post Reply