No subject

Howard Bornstein howard.bornstein at gmail.com
Fri Apr 1 13:46:35 EST 2005


On Apr 1, 2005 12:55 PM, Frank D. Engel, Jr. <fde101 at fjrhome.net> wrote:
> 
> Untested clean-up of that code:
> 


Your clean-up code needed a little cleaning up. :-)

on mouseUp
    put empty into sorter -- these two lines are mainly to make me
feel a little better,
    put empty into sorteddata -- coming from a background in
lower-level languages like Pascal
  
    repeat for each line x in field "data"
        if word 1 of x = word 1 of line 1 of sorter then
            put x & cr after sorter
        else
            --delete the last char of sorter -- you need this CR to
separate the lines
            sort lines of sorter numeric by word 2 of each
            put sorter after sorteddata
            put x & cr into sorter -- added "& cr"
        end if
    end repeat
   sort lines of sorter numeric by word 2 of each --otherwise the
final sort never happens
  
    put sorteddata & sorter into field "data"
end mouseUp

-- 
Regards,

Howard Bornstein
-----------------------
www.designeq.com


More information about the use-livecode mailing list