Identifying objects by their tooltips
Richard Gaskin
ambassador at fourthworld.com
Wed Nov 23 05:42:33 EST 2005
Marielle Lange wrote:
> Alex's suggestion of using custom properties is even better. I know by
> my own experience that it takes a bit of time to take the jump and come
> to trust custom properties (which don't exist in other languages). When
> you do, you never look back. They are really handy.
Very. Once you get started with them, they'll change your programming
habits forever.
For the record, although HyperCard never implemented them until the day
it died, SuperCard introduced custom properties in the early '90s, and
ToolBook, RADBuilder, Director, and (if memory serves) OMO had them too.
What Rev uniquely brings to the table that no other xTalk has is the
ability to define multiple sets of custom properties, and the graceful
ease of using array notation to address them.
While they might seem exotic to HypeTalkers, the idea of binding
arbirtary data to an object is common, if not considered essential, in
more formal languages.
Perhaps the closest corollary in OOPS might be instance variables.
In traditional non-OOP languages we might think of them as part of the
record structure of an object.
In the old Mac Classic days, controls and windows had a RefCon field
which was used to hook your own data structures to the OS-managed object.
The idea takes as many forms as there are languages, but I believe the
binding of data to objects in Rev through custom properties and custom
property sets is perhaps the simplest. And with the ability to store
both textual and binary data, they're as flexible as one's imagination
allows.
--
Richard Gaskin
Managing Editor, revJournal
_______________________________________________________
Rev tips, tutorials and more: http://www.revJournal.com
More information about the use-livecode
mailing list