Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array element position util?
Message
From
02/05/2000 20:34:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00365326
Message ID:
00365418
Views:
19
>I'm trying to create an array on the fly and expand the number of columns as I add rows that have ever increasing number
>of columns not to exceed the max number of columns in any given row. The default behavior is to shuffle the elements up
>the list when a dime is issued on the array. In other words, I want myarray[row1,column3] to stay row1,column3 even if I say
>dime myarray[1,4]. This way I can have an array that is only the exact size needed to hold the info. and will never be too small.


I wrote this in Fox 2.6, but I don't think the version should matter

FUNCTION ADDCOL
PARA pArray
PRIVATE ALL

nRows = ALEN(pArray,1)
nCols = ALEN(pArray,2)

DIME pArray[nRows * (nCols+1)]

FOR I = 1 to nRows - 1
=AINS(pArray,I + I*nCols)
ENDFOR

DIME pArray[nRows,nCols+1]



The result is an added column with values of .F.
I think that is what you needed

.............Rich
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform