Database Puzzle

by jove, I think he got it!
:smiley:

The intention is when the transpiler creates the SWIFT code for “control sets”, it only assigns unique property values to the control set itself, and individual properties to each member of the set

not knowing how the generated code for swift handles this is an impediment for me

But what I can tell you is that in Xojo every instance has unique properties for every property
None are really “shared”
You can create a control set and change each one (color border transparency etc etc etc)

The ONLY thing that is different is that all event handlers are passed an “index” to know which member of the control set was clicked etc

so instead of the code being

    Sub Click() Handles Event

it would be

   Sub Click(index as integer) Handles event

As will the code I generate.
This would be only for the intial control creation
something like this (not real code)

let temp=UIButton(.....)
temp.backgroundcolor=UIColor.blue
switch index {
case 1,2 : temp.borderwidth=3
case 3 : temp.borderwidth =2
}
controlSet.append(temp)

creates 3 buttons, all with blue background, 2 with border of 3, and 1 with a border of 2

ah I see

I’d have just spewed out the code to set each property and not bothered trying to group them but thats just me :slight_smile:

6 of one half dozen of the other and all that :stuck_out_tongue:

I’m a “clean code” OCD I guess… rather produce the minimum amount of code possible
I almost always (when a control set is involved), create the control in a “temp” and append it to the set (in my code, a control set truly is an array)