How can i add values to Multidimensional Arrays

How can i add values to Multidimensional Arrays

Postby sajith » Tue Jun 23, 2009 9:32 am

can anyone help me
How can i add values to Multidimensional Arrays
sajith
 
Posts: 110
Joined: Wed Feb 18, 2009 9:58 am
Location: India

Re: How can i add values to Multidimensional Arrays

Postby anserkk » Tue Jun 23, 2009 9:58 am

Dear Mr.Sajith

You can use

Code: Select all  Expand view
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  Expand view
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
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: How can i add values to Multidimensional Arrays

Postby sajith » Wed Jun 24, 2009 5:57 am

Many Thanks for ur Replay, code works Fine


regards Sajith
sajith
 
Posts: 110
Joined: Wed Feb 18, 2009 9:58 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 101 guests