Information générale
Catégorie:
Codage, syntaxe et commandes
>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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement