Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Want to remove the last two rows of an array
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00477183
Message ID:
00477233
Vues:
27
Brenda,

It sounds like ADEL() will help you here. With ADEL() you can delete rows or columns from an array. You could modify your code as follows;
SELECT (calias)
SCAN FOR ALLTRIM(USER_ID) = ALLTRIM(User) and alltrim(lettername) = alltrim(letters.lettername)
   SCATTER TO A_Temp

   ADEL(A_temp,1) && Delete first row
   ADEL(A_Temp,1) && Delete second row
   DIMENSION A_temp(ALEN(A_temp,1)-2)  && Remove deleted rows

   INSERT INTO RT_LETTR FROM ARRAY A_Temp
ENDSCAN
You need to be aware that ADEL() will fill a row with .F. values and move it to the end of the array. That's why we delete row 1 twice and then redimension the array to get rid of the deleted rows. Read up on this function in the help file (it can do columns too).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform