Groups forget who they are

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
JereMiami
Posts: 127
Joined: Mon Nov 03, 2014 12:17 am

Groups forget who they are

Post by JereMiami » Fri Feb 19, 2021 4:58 pm

Probably long overdue for asking this, but sometimes LC tends to forget the name of a group or misidentifies it, particulalry when numbers are used. For instance, LC think grp "3" is grp "2"

It's probably some form of memory issue. So if I close and clear from memory, does this resolve this?

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Groups forget who they are

Post by Klaus » Fri Feb 19, 2021 5:11 pm

No memory issue or something, this is the way LC works!

Therefore:
NEVER EVER name your objects with a number!
Since everything is a STRING for LC
-> button "3"
is correctly treated as
-> button 3

stam
Posts: 3072
Joined: Sun Jun 04, 2006 9:39 pm

Re: Groups forget who they are

Post by stam » Fri Feb 19, 2021 6:10 pm

yep that ^^

button "3" is interpreted as button number 3. That caught me out recently when i was using stacked graphics numbered 1-16; i just prefixed some text to the number and it sorted it.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10319
Joined: Wed May 06, 2009 2:28 pm

Re: Groups forget who they are

Post by dunbarx » Fri Feb 19, 2021 6:47 pm

What everyone said.

There are good reasons to have numbers in the name of your controls, though, for reference, for ordering, whatever. But in those cases, for buttons, say:

myButton1
myButton2
myButtion3, etc.

Or even:

1myButton
2myButton
3myButton, etc.

One or two extra lines of code will access the order of these things handily.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Groups forget who they are

Post by richmond62 » Fri Feb 19, 2021 7:02 pm

NEVER EVER name your objects with a number!
Klaus,who knows, says it the "way things are".

JereMiami
Posts: 127
Joined: Mon Nov 03, 2014 12:17 am

Re: Groups forget who they are

Post by JereMiami » Fri Feb 19, 2021 10:02 pm

Thanks- that actually fixed it. I take it the order you add objects, such as groups, is group 1, group 2, etc ... even if you call them group "3", group "4", etc.

I tend to number groups within a list of groups. But, knowing what you just told me, that helps a lot in avoiding or resolving that problem.

Thanks Klaus (and the gang)!

Post Reply