attaching my group id to a control in a subgroup

jonathandlynch at gmail.com jonathandlynch at gmail.com
Tue Aug 22 18:28:42 EDT 2017


Can you have a function in the appropriate group that returns its unDna? This way, it will not matter about any subgrouping.

Function MyUnDna
Return the unDna of me
End MyUnDna

Sent from my iPhone

> On Aug 22, 2017, at 6:08 PM, Dr. Hawkins via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> I have a uniqDna value for each datum in my data.  This is used to store
> and retrieve it from a database.
> 
> When I create an output group for one of these (and there are a great many
> different output groups), the group is labeled with these IDs.
> 
> The output group will typically contain label fields and graphics, but gets
> its unDna set to the corresponding uniqDna.  It also contains fields for
> output.
> 
> When an output field is modified, the handler calls the seal routine,
> passing the field name, new value, and the unDna.
> 
> I had made, for performance reasons, the strong assumption that the output
> fields would always be a top level member of the output group.  I also
> designed output groups which, for organizational reasons, group the output
> fields . . . oops . . .
> 
> The closeField handler follows the rule, and assumes that the unDna of the
> owner of the target is the uniqDna value it needs.  This backfires when not
> true :(
> 
> One obvious solution would be to simply ungroup the offending groups--but
> there are good reasons to want it have subgroups (such as sharing subgroups
> for maintenance of similar outputs with shared elements).
> 
> At the moment, the three possibilities I see are,
> 1) recurse upwards until a group with a unDna is found (well, close; there
> are universal fields with no unDna)
> 2) check the owner of the owner of the target
> 3) redundantly set the uDna of every output field at group creation/copying
> time.
> 
> I need this to be blindingly fast, too (although I doubt that this is a
> problem in 2017).
> 
> Am I missing an obvious way to do this?
> -- 
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> _______________________________________________
> 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