Page 1 of 1

Neep help urgent !!!

Posted: Wed May 01, 2019 4:26 pm
by Warrior555
When I click on the Yellow Button I makes an error :
Sans titre.png
Can someone help me ?! It's urgent !

Re: Neep help urgent !!!

Posted: Wed May 01, 2019 4:52 pm
by Klaus
Hi Mike,

1. welcome to the forum! :D
A little "Hello" would not have hurt for the first posting.

2. Please use a more meaningful thread title next time. 8)

3. Not sure, but I think this is because you named your object with a NUMBER, which is a NOGO in LC! Since we have no "type definition" in LC, the engine thinks you mean graphic number 500 or graphic number 2000 and you do not have that much graphics on your card!

Use a prefix if you really need numbers in the object names -> graphic "g2000"
Then this will work as exspected.

Best

Klaus

Re: Neep help urgent !!!

Posted: Wed May 01, 2019 4:58 pm
by dunbarx
Welcome here as well.

Your error indicates "no such object". The name of that object was "+500". Are you sure you have such an object?

You also must start using quotes around everything that is not a variable.

Example send "activateBonusObject"...

What Klaus was referring to is this. If you ask for button 3, LiveCode will try to find the third button in its layer order, NOT a button named "3". . But LiveCode "sees" "+500" as a number, resolving it to "500". See the confusion? Just don't, and be careful not to even get close, as the "+" in the name may have made you think it was OK. It isn't.

Craig

Re: Neep help urgent !!!

Posted: Wed May 01, 2019 5:07 pm
by Warrior555
Thanks Klaus, I changed the name to bonus500, it worked ! :D
(And i'm sorry for not saying hello...)

Re: Neep help urgent !!!

Posted: Wed May 01, 2019 5:09 pm
by Klaus
Addition:
Although the Inspector does not provide a field or whatever to set a LABEL for a graphic, you can do this via script/message box:
1. Change the NAME of your graphics as I suggested -> g500
2. Then use the message box to set the label of the graphics:
set the LABEL of grc "g500" to "+500"
etc. for the other graphics.

This way we can have a (correct and working) name that is different from the LABEL/what we see on screen, just like buttons.

Re: Neep help urgent !!!

Posted: Wed May 01, 2019 5:40 pm
by Klaus
Just added an enhancement request for this:
https://quality.livecode.com/show_bug.cgi?id=22036

Re: Neep help urgent !!!

Posted: Wed May 01, 2019 6:04 pm
by richmond62
this
seconded!

Re: Neep help urgent !!!

Posted: Wed May 01, 2019 8:11 pm
by richmond62
What are neeps? A traditional Scottish vegetable!

https://must-see-scotland.com/what-are-neeps
-
Look no further, my friend:
neep.jpg
Neep Help
neep.jpg (19.41 KiB) Viewed 4365 times