Richard,
The error is telling you that you're trying to modify the Color property of some object, but the object that's being modified doesn't actually have a Color property.
This usually appears when you're using one of the built-in object variables (Self, Container, Active, and so on).
You'll want to find the code that's modifying Color and review it to make certain that the object being used actually has a Color property.
For example, let's assume your code refers to Active. Here's one way to determine if Active actually has a Color property:
Code:
var
str String
dyn Dynarray[] String
endVar
active.enumUIObjectProperties( dyn )
if dyn.contains( "Color" ) then
active.Color = Blue
else
msgStop( "Can't Set Color", "Reason: " +
"The active object (" +
active.Fullname + ") doesn't " +
"have a Color property." )
endIf
Good error checking can be very useful for this type of thing. Consider, for example, the following code (which shows how to detect specific errors and provide customized responses that offer more details than the built-in error mechanism:
Code:
try
active.Color = Blue
onFail
if errorHasErrorCode( peNoProperty ) then
errorClear()
msgStop( "Can't Set Color", "Reason: " +
"The active object (" +
active.Fullname + ") doesn't " +
"have a Color property." )
else
errorShow() ; other problem
endIf
endTry
In this case, we're replacing the default error handling mechanism with a custom error message that tells you the name of the object that triggered the error.
This is useful information. In this case, for example, you might have moved your code to a new button (for test purposes), but forgot to turn off the button's tab stop property.
Why would that be important? Well, when a button's tab stop property is true, focus moves to the button before its pushButton event is fired. Button's don't have Color properties and, viola, the error is generated.
It's not an easy subject to completely describe in a short reply, but I hope this gives you some ideas for thought.
Hope this helps...
-- Lance
P.S. These are excellent questions and you're running into things that most of us have tripped over at one point or another. With Paradox, experience is the best teacher, just so long as you're not afraid to ask for help when you need it.
P.P.S. Or to put things like my grandmother used to, the only stupid questions are the ones you don't ask.
