How do I 'shorten' this script?

Mark Wieder mwieder at ahsoftware.net
Fri Mar 5 10:39:01 EST 2010


Jim-

Friday, March 5, 2010, 4:07:04 AM, you wrote:

> I think Mark meant to say *put true into tMatch* before the repeat.

That's what I meant, but I still messed up one more detail...

on mouseUp
    local tMatch

    -- assume match
    put true into tMatch
    repeat with x = 1 to 5
       put "A"&x into tName
       if the backgroundcolor of grc tName of grp "A" \
           is NOT the backgroundcolor of grc tName of grp "B"
       then put false into tMatch
    end repeat
    -- if none failed
    if tMatch
    then answer "AnswerA"
    else answer "AnswerB"
end mouseUp

...amazing how much difference a well-placed "not" can make...

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list