PDA

View Full Version : Ask user for a number bug


nduchon
12-03-2008, 09:53 AM
I am using Alice 2.2beta (9/1/2008) on Windows XP and the function:
"ask user for a number"
always returns 0.

Actually, the problem is more subtle: if a single digit is entered, the value is set correctly, but if more than a single digit character is entered, then the value is 0.0.

Has anybody else seen this problem?

Any thoughts?

This function in Alice 2.0 (04/05/2005) seemed to work fine.

Well, see the attached world. If you just put the "ask user for a number" tile inside "print", it seems to work, but if you try to assign the return value to a number variable, the number variable always seems to have the value 0.0.

x2495iiii
12-16-2008, 04:08 PM
HoenestlyIm not getting that problem at all, and I have Alice 2.2b on XP as well

Is there something you have in you version of the program that isn't the same as the one you attached?

Also, I'd personally change the variables so that they aren't in the method, but in the world (go to properties and click teh button "Add new variable", it makes it easier to make copies and move tiles around, and it also can remove bugs like this one.

RobMikeMom
12-30-2008, 12:09 AM
I am getting this error as well. I did the Lab Project from Dick Baldwin's Alice Tutorials, #140 (http://www.dickbaldwin.com/alice/Alice0140.htm), and it works fine in Alice 2.0.

In Alice 2.2 (9/1/2008), single digit numbers work fine, but multi-digit numbers don't work. They always return 0.

I am running Windows Vista Ultimate Edition, 64-bit. Any ideas as to why?

Thanks,

nduchon
12-30-2008, 11:11 AM
Cindy -

Thanks for your note. I am getting this error on both my machines as well as my daughter's Mac, but x2495iiii does not seem to have this problem - so I can only conclude that there is something in the configuration of our computers that is different from x2495iiii's.

My first thought is that I have a series of different JRE's and JDK's in my Program Files directory:
Directory of C:\Program Files\Java

11/01/2008 12:45 PM <DIR> .
11/01/2008 12:45 PM <DIR> ..
12/30/2006 12:33 AM <DIR> jdk1.5.0_04
04/19/2007 12:08 PM <DIR> jdk1.6.0_01
11/01/2008 12:47 PM <DIR> jdk1.6.0_10
12/30/2006 12:34 AM <DIR> jre1.5.0_04
11/25/2006 08:06 AM <DIR> jre1.5.0_06
04/07/2007 11:06 PM <DIR> jre1.5.0_07
03/14/2007 09:27 AM <DIR> jre1.5.0_10
04/02/2007 03:35 PM <DIR> jre1.5.0_11
04/19/2007 12:09 PM <DIR> jre1.6.0_01
11/14/2007 09:49 AM <DIR> jre1.6.0_03
05/14/2008 12:06 AM <DIR> jre1.6.0_05
07/28/2008 01:11 PM <DIR> jre1.6.0_06
10/18/2008 09:27 AM <DIR> jre1.6.0_07
11/01/2008 12:46 PM <DIR> jre6

Perhaps this is the source of our problem?

Or perhaps something in Python?

Nick.

RobMikeMom
12-30-2008, 11:49 AM
All I have in that directory is the jre1.6.0_07 folder. So I figure that both versions of Alice (2.0 and 2.2) are using the same Java runtime, unless they are using the runtimes from their Required folders.

In the Required folder of Alice 2.2, there is a jre1.6.0_06 folder, so maybe Alice is using that runtime instead? And Alice 2.0 has the folder jre1.3.1_10_win32 in its Required folder. So I wonder if that's the difference?

UMUser
01-14-2009, 10:14 AM
It is a bug, a problem with the regular expression used to represent a number. It will be fixed and updated shortly.

RobMikeMom
07-15-2009, 04:56 PM
I presume this bug has been fixed in the latest release of Alice 2.2?

Thanks,