Is there a way to shorten this script? (100 graphics and 200 lines of text)

Dar Scott dsc at swcp.com
Tue May 8 14:54:34 EDT 2012


This came in late into my mailbox.  Of the index calculation methods, this one works.  -- Dar


On May 8, 2012, at 12:35 PM, Mark Schonewille wrote:

> Hi William,
> 
> This should work:
> 
> repeat with x = 1 to 100
>  set the backgroundColor of grc ("d" & x) to line 2*x-1 of fld "in"
>  set the foregroundColor of grc ("d" & x) to line 2*x of fld "in"
> end repeat
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
> 
> We will have room for new projects after 1 June. Contact me now and be first in line.
> 
> On 8 mei 2012, at 20:21, 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