Hi Guys
I've probably had a bit too much red wine this afternoon to give a
coherent answer but I'll try.
As Thomas pointed out, but using a constant to reference an element of
an object you are essentially only renaming an existing property. This
probably isn't so bad when you pick an property such as 'bearing',
'velocity', 'x', 'y', 'counter', basically any of the general purpose
properties. At the moment this isn't very clear in the manual, I
should make it better. Unfortunately JACL doesn't allow you do create
a new object subclass and add brand new elements in the way that a
full object-oriented language would.
So the end result is that a constant is just a constant like any other
language. The best way to think of it is that each object has 16
elements, numbered 0-15. Some of those properties have special
meanings such as 'parent' and 'mass' while some only have meaning when
the object is used in a very specific way. You can think of the names
like parents as nothing more than predefined constants. For example
'constant parent 0'. This just means that instead of saying 'ball(0) =
bag' your can say 'ball(parent) = bag' to make things more readable.
By defining another constant that equals 0 you are giving yourself two
names that you can use to refer to the property '0', but it doesn't
change the fact that certain library code will expect that property to
contain a certain type of information, ie. the number of the object
that is the parent of that object.
So wrap up, the RESPONSE constant in the manual should really be set
to something like 9 that is only then overriding 'status', a property
that doesn't have any really significant meaning to any of the library
code.
The OBJECT PROPERTIES table that Thomas posted is the main reference
table you need when picking a constant to override.
I hope this makes sense, if not I'll try again tomorrow when I'm more
lucid.
Hope you are all well,
Stuart