Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array element position util?
Message
De
02/05/2000 20:34:57
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00365326
Message ID:
00365418
Vues:
18
>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
Fil
Voir

Click here to load this message in the networking platform