Id numbers vs names

Shari shari at gypsyware.com
Sat Feb 26 09:16:12 EST 2005


A long time ago I read where the safest way of referring to an object 
was to use its ID number, rather than the name or number.  The 
reasoning against using the number was that it can change.  I don't 
recall the reasoning behind the name, though I use names for most of 
my coding.

But in one instance I chose to use the ID numbers, and now I'm SORRY 
SORRY SORRY!  Because when updating the program adding/deleting 
things, those numbers change, and I have to go thru every line of 
code to find where the numbers are referenced.

Not only that, the update requires the objects to be named, so I'll 
have to go in and name 122 objects that could have been (SHOULD have 
been) named in the first place.  Aaiiieeeee!  (Though I did that part 
easily with a snippet of code....)

Moral of the story:  Name it!  Always always name it!

PS - Does anyone have a good snippet of Search Script code that works 
just the way Hypercard's does?  I tried one once a long time ago but 
never got it to work.  I sure do miss that feature!

(Using MC 2.4.3)


-- 
Mac and Windows shareware games
http://www.gypsyware.com


More information about the metacard mailing list