Typeby (no login)
If you create a TYPE, then the whole variable is swaped at once :
lines AS INTEGER
count AS INTEGER
DIM sort(1 TO 20) AS stats
FOR I = 1 TO 20
FOR j = I + 1 TO 20
IF sort(I).lines < sort(j).lines THEN
SWAP sort(I), sort(j) ' this swaps all !
You might need also one day, maping indexes, if you have a circular buffer :
offset1% = (I + (offs% * 7)) + 1 " offset, where to begin.
FOR i = 0 TO 40 STEP 1
indmp1% = (i + offset1%) - 42 * INT((i + offset1%) / 42)
indmp2% = (i + 1 + offset1%) - 42 * INT((i + 1 + offset1%) / 42)
Cirbuffer(indmp1%) = Cirbuffer(indmp2%)
This is how i shifted a 41 long buffer, all lines were moved 1 step, what ever was the begining of the move.
|Response Title||Author and Date|
|Thanks for all the help i have it done now...||Unseen Machine on May 19|
|*Sweet! I didn't know that!||bluebear on May 22|