Object naming

Alex Tweedly alex at tweedly.net
Mon Jul 27 20:47:17 EDT 2020


On 27/07/2020 21:26, Curry Kenworthy via use-livecode wrote:
>
> Use unambiguous SHORT names!
>
Thanks, but ...

Yes, using unambiguous SHORT names solves this naming problem, but 
introduces other problems. In particular, this group script should 
(probably) be a behaviour script, since the group will be instantiated 
multiple times and will in the future need updating for enhancements or 
even (Heaven forfend!) bug fixes.

Using unambiguous short names prevents behaviour scripts that references 
child controls completely, and even if I simply used normal scripts 
which were replicated for each instance, I'd still need to go through 
the script to change all the references to the child control names (a 
pain, and source of possible future errors).

For now, I'm caching the IDs of the direct child controls in 
script-local variables in each instance of the group. If I find a 
name-based way that works reliably and allows behaviour scripts, I'll 
change - but this method works.

I'll have this group ready for release soon (or soon-ish) so y'all'll be 
able to see how it turned out :-)

Thanks again everyone,

Alex.





More information about the use-livecode mailing list