Page 1 of 1

Normalizing Group Code (not repeating code)

Posted: Sun Jul 02, 2017 8:07 pm
by townsend
I have a Data Grid, a bunch of Buttons, and some Text Fields, all working fine. I place them into a Group. Copy and Paste the Group. Then rename the two groups: Group1 and Group2.

Both Groups have an identical Field: "Notes". I can populate each of the Fields with this code.

Code: Select all

put "hello" into fld "dNotes" of group "group1"
put "hello" into fld "dNotes" of group "group2"
Now lets say I pasted in a couple of more of these exact Groups. So then I have: Group1, Group2, Group3, Group4"

Is there any way I can update these Fields by referencing these Groups with an Index? Something like this:

Code: Select all

repeat with ii =1 to 4
     put "hello" into fld "dNotes" of group "group"[ii]
end repeat

Re: Normalizing Group Code (not repeating code)

Posted: Sun Jul 02, 2017 8:59 pm
by Klaus
Hi townsend,

string concatenation is the magic word:

Code: Select all

repeat with ii =1 to 4
     put "hello" into fld "dNotes" of group ("group" & ii)
end repeat
Best

Klaus