Reversing a list

Eric Chatonet eric.chatonet at sosmartsoftware.com
Thu Apr 3 11:48:22 EDT 2008


Hi Richmond,

Le 3 avr. 08 à 17:28, Richmond Mathewson a écrit :
> Stupid Me! realise that the line:
>
> put the number of lines of fld "fZ" into TNUM
>
> is redundant and only serves to slow the thing down.
>
> Clumsy or not (!!!!!!!!!!!!!!):
>
> on mouseUp
>   put the number of lines of fld "fZ" + 1 into ANUM
>   repeat for each line ZNUM in fld "fZ"
>     put (ANUM -1) into ANUM
>     put ZNUM into line ANUM of fld "fA"
>   end repeat
> end mouseUp
>
> does things bl**dy quickly, and without the need of
> some fancy homemade function!

If you want to speed up this by about one hundred:

   put fld "fZ" into tList
   put the number of lines of tList + 1 into ANUM
   repeat for each line ZNUM in tList
     put (ANUM -1) into ANUM
     put ZNUM into line ANUM of tReverseList
   end repeat
   put tReverseList into fld "fA"

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list