>>Depending exactly what you're doing, you could consider using a cursor rather than an array. You could then index it, and your sorting problems are over.
>>
>>Personally, I hardly ever use arrays, as cursors are more versatile and easier to work with.
>
>A cursor to hold 6 numbers seems like overkill. I also don't see how it would help. I wasn't trying to sort the numbers, I was trying to reorder them. I'd have the same problem with a cursor.
>
>Thanks,
>
>Michelle
You're right, in this case sorting won't obviously help you. However, a cursor still might make your life easier:
LOCAL ;
lnLowestValue, ;
lnLowestRow, ;
lnNewValue
CREATE CURSOR iTest ;
(iValue I)
FOR lnIx = 1 TO 6 STEP 1
INSERT INTO iTest ;
(iValue) ;
VALUES ;
(lnIx)
ENDFOR
lnLowestValue = 1
lnLowestRow = 3
REPLACE ALL ;
iTest.iValue WITH IIF(RECNO("iTest") < lnLowestRow, ;
RECNO("iTest") + (RECCOUNT("iTest") - lnLowestRow) + lnLowestValue, ;
lnLowestValue + (RECNO("iTest") - lnLowestRow)) ;
IN iTest
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up