What's wrong with Globals?
J. Landman Gay
jacque at hyperactivesw.com
Mon Apr 2 18:51:41 EDT 2007
Joe Lewis Wilkins wrote:
> CPs do tend to
> involve writing a lot more code, and I have to learn something that I've
> not used before; hence probably subject to some errors in usage on my
> part - typos and otherwise.
Custom properties aren't any different than built-in properties, really.
They don't take any more code, and you don't have to learn anything new.
You probably use properties all the time without even thinking about it:
put the name of btn 1 into var
set the name of btn 1 to var
CPs are just the same:
put the myprop of btn 1 into var
set the myprop of btn 1 to var
They're identical. The only difference is that you can define an
unlimited number of properties; you aren't confined to the finite set
the engine provides.
Forget about custom property sets for now, and ignore the array
notation; just the above is very useful all by itself. After you've done
some playing around with the above, dividing CPs into sets will fall
into place naturally with very little mental adjustment.
I think this is a tricky concept to grok when first moving from HC,
because HC has neither custom properties nor arrays. New HC converts
might be better served by deleting all references to arrays in list
posts until they've experimented with the basic constructs first. :)
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list