Newbie: Confused once more

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm
Location: Kelowna, BC, Canada

Newbie: Confused once more

Post by kpeters » Sun May 06, 2007 9:24 pm

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

Klaus
Posts: 13878
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Post by Klaus » Sun May 06, 2007 11:05 pm

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

kpeters
Posts: 112
Joined: Wed Mar 21, 2007 9:32 pm
Location: Kelowna, BC, Canada

Post by kpeters » Mon May 07, 2007 12:38 am

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

xApple
Posts: 113
Joined: Wed Nov 29, 2006 10:21 pm
Location: Geneva

Post by xApple » Mon May 07, 2007 10:06 am

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

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”