Property: value is not a number.... WTF?

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
RottenPotat0
Posts: 3
Joined: Sun Dec 01, 2019 4:36 pm

Property: value is not a number.... WTF?

Post by RottenPotat0 » Sun Dec 01, 2019 4:44 pm

I'm creating a game based on the one from game academy. I've already done this before, but I'm just gonna start from scratch because the game was so laggy on my android with an sd845. However, this shitty error is showing up now, and I don't even know why.
Attachments
livecode.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3809
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Property: value is not a number.... WTF?

Post by richmond62 » Sun Dec 01, 2019 6:49 pm

Well, let's think about SPACES and PARENTHESES to start with . . .

set the left of button "foreGround1" to
. . . with a SPACE between the word button and its name.

to ((the left of button "foreground1") - 5)

now stop all the abusive 'WTF' because it doesn't help, makes you sound rude, and turns helpful types like me off.

RottenPotat0
Posts: 3
Joined: Sun Dec 01, 2019 4:36 pm

Re: Property: value is not a number.... WTF?

Post by RottenPotat0 » Sun Dec 01, 2019 7:23 pm

richmond62 wrote:
Sun Dec 01, 2019 6:49 pm
Well, let's think about SPACES and PARENTHESES to start with . . .

set the left of button "foreGround1" to
. . . with a SPACE between the word button and its name.

to ((the left of button "foreground1") - 5)

now stop all the abusive 'WTF' because it doesn't help, makes you sound rude, and turns helpful types like me off.
Smart. I like it.

Spaces doesn't even matter in this case... 🤦‍♂️
Attachments
livecode.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 3809
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Property: value is not a number.... WTF?

Post by richmond62 » Sun Dec 01, 2019 7:52 pm

I don't know why you are getting that error message:

Code: Select all

on mouseUp
   set the left of button "foreground1" to ((the left of button "foreground1") -20)
end mouseUp
-
shunter.png
Attachments
shunter.livecode.zip
Here's the stack
(1.08 KiB) Downloaded 1 time

bogs
Posts: 3995
Joined: Sat Feb 25, 2017 10:45 pm

Re: Property: value is not a number.... WTF?

Post by bogs » Sun Dec 01, 2019 8:18 pm

I'm not sure why you'd get that error either, unless it is a typing error. For instance, with one button on a stack, and in the stack script...

Code: Select all

on mouseDown
   set the left of button 1 to the left of button 1 -5
end mouseDown

on mouseUp
   set the left of button 1 to the left of button 1 +5
end mouseUp
...moves a button back and forth with no issue.

Looking at your code that lacks any spaces, I would suggest making sure that the button names actually have no spaces.
Image

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

Re: Property: value is not a number.... WTF?

Post by Klaus » Sun Dec 01, 2019 9:48 pm

Quit and restart Livecode!
Helped here in a similar "insane" situations. :D

RottenPotat0
Posts: 3
Joined: Sun Dec 01, 2019 4:36 pm

Re: Property: value is not a number.... WTF?

Post by RottenPotat0 » Mon Dec 02, 2019 8:19 am

richmond62 wrote:
Sun Dec 01, 2019 7:52 pm
I don't know why you are getting that error message:

Code: Select all

on mouseUp
   set the left of button "foreground1" to ((the left of button "foreground1") -20)
end mouseUp
bogs wrote:
Sun Dec 01, 2019 8:18 pm
I'm not sure why you'd get that error either, unless it is a typing error. For instance, with one button on a stack, and in the stack script...

Code: Select all

on mouseDown
   set the left of button 1 to the left of button 1 -5
end mouseDown

on mouseUp
   set the left of button 1 to the left of button 1 +5
end mouseUp
...moves a button back and forth with no issue.

Looking at your code that lacks any spaces, I would suggest making sure that the button names actually have no spaces.
Klaus wrote:
Sun Dec 01, 2019 9:48 pm
Quit and restart Livecode!
Helped here in a similar "insane" situations. :D
I've figured out why it's causing the error. Because of the updateScreen, the button just keeps on going left until it's out of bounce lol. So, I have to set the foreground1 to the right of foreground2(or foreground2 to foreground1) everytime the right of the button is < the left of the card, and a condition to stop the screen update.

Anyway, thanks for the help.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”