Page 1 of 1

Newbie: Confused once more

Posted: Sun May 06, 2007 9:24 pm
by kpeters
The following card code results in "Object not found" at runtime:

Code: Select all

on setCheckboxLayout Index 
   answer "in setCheckboxLayout"
   -- set the locklocation of "group_Cat1" to True
   set the locklocation of ( "group_Cat" & Index ) to true
end setCheckboxLayout
A group by that name definitely does exist on the card - so this smells to me like a message path problem again? There are three other cards in the stack.

After reading up on all the info that you guys pointed me at, I thought that no other object in the path could pick this one up as setCheckboxLayout does not exist anywhere else but on the first card ( = no other object has a "receptor")???

Just in case this might be important: the group in question sits "on top" of a background (a tab menu) and it also exists on a second card of the stack (also on a tab menu background)...

Again, thanks for any help you can provide.

Kai

Posted: Sun May 06, 2007 11:05 pm
by Klaus
Hi Kai,

try this:

on setCheckboxLayout Index
answer "in setCheckboxLayout"
-- set the locklocation of "group_Cat1" to True
set the locklocation of GROUP ("group_Cat" & Index ) to true
## or BUTTON or whatever ("group_Cat" & Index) is...
end setCheckboxLayout

The object decription is missing, should work now :-)


Best

Klaus Major

Posted: Mon May 07, 2007 12:38 am
by kpeters
Thanks Klaus ~

that was certainly one of my not so smart mistakes - good that some helpful Germans stay up late!

Guess I should change my control naming scheme as it is so easy to screw up like this... leftover from Delphi where every object and thus control has to have a unique name.

Kai

Posted: Mon May 07, 2007 10:06 am
by xApple
You don't actually need to call each object the correct type. Whenever it's a button, a group, an image, they will all respond to the nomination "CONTROL". So basically you can always just write all the time:

set the locklocation of CONTROL ("group_Cat" & Index ) to true