Is there a way to shorten this script? (100 graphics and 200 lines of text)
Bob Sneidar
bobs at twft.com
Tue May 8 14:46:55 EDT 2012
<stupid Apple Mail changes sender on Send Again!>
Belay that just noticed multiple graphics.
repeat with i = 1 to 200 step 2
put "d" & i div 2 +1 into theGrcName
set the backgroundcolor of grc theGrcName to the text of line i of fld "in"
set the foregroundcolor of grc theGrcName to the text of line i+1 of fld "in"
end repeat
I think that will do it. Untested.
Bob
On May 8, 2012, at 11:28 AM, Bob Sneidar wrote:
> repeat with i = 1 to 200 step 2
> set the backgroundcolor of grc "d1" to the text of line i of fld "in"
> set the foregroundcolor of grc "d1" to the text of line i+1 of fld "in"
> end repeat
>
> Bob
>
>
> On May 8, 2012, at 11:21 AM, William de Smet wrote:
>
>> Hi there,
>>
>> Can anyone help me shorten this script?
>> Eventually there will be 100 graphics (d1 to d100) and 200 lines of
>> text in field "in"
>> Each graphic uses two lines of follow up numbers (correct English?) of fld "in"
>> --------
>> set the backgroundcolor of grc "d1" to the text of line 1 of fld "in"
>> set the foregroundcolor of grc "d1" to the text of line 2 of fld "in"
>> --
>> set the backgroundcolor of grc "d2" to the text of line 3 of fld "in"
>> set the foregroundcolor of grc "d2" to the text of line 4 of fld "in"
>> --
>> set the backgroundcolor of grc "d3" to the text of line 5 of fld "in"
>> set the foregroundcolor of grc "d3" to the text of line 6 of fld "in"
>> --
>> set the backgroundcolor of grc "d4" to the text of line 7 of fld "in"
>> set the foregroundcolor of grc "d4" to the text of line 8 of fld "in"
>> --
>> set the backgroundcolor of grc "d5" to the text of line 9 of fld "in"
>> set the foregroundcolor of grc "d5" to the text of line 10 of fld "in"
>> --
>>
>> Thanks!
>>
>> Greetings,
>>
>> William
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list