Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Want to remove the last two rows of an array
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00477183
Message ID:
00477233
Views:
28
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).
Previous
Reply
Map
View

Click here to load this message in the networking platform