This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-02-21 07:22:05

langoshoish
Scratcher
Registered: 2009-02-09
Posts: 3

BUG: Applet compares integers as strings

Scratch's "<" and ">" blocks return the correct result when comparing two integer-valued variables in the local Squeak implementation, but not always in the Java applet. My guess is that the applet is incorrectly comparing the variable values as strings, even when they should be compared numerically. I have uploaded the following small project which seems to demonstrate that this is the case. It also demonstrates a workaround by padding variable values with zeros.

Bug Demo:
http://scratch.mit.edu/projects/langoshoish/425035

Offline

 

#2 2009-02-21 08:33:37

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: BUG: Applet compares integers as strings

Thanks for tracking that down...I've entered it into the bug list for the application.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer