Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Ask user for a number into a variable.
Old
Kirbya
Guest
 
Status:
Posts: n/a
Default Ask user for a number into a variable. - 10-26-2006, 10:57 AM

Yes I need more help with my final project, this time I want to know if it's possible to make it so when I use the world level function "Ask user for a number" if i can take that input and make into a world level variable that I can use throughout my program.
   
Reply With Quote
Old
Kirbya
Guest
 
Status:
Posts: n/a
Default 10-30-2006, 10:36 AM

Anyone know if it's possible? Please?
   
Reply With Quote
Try this.
Old
DrJim
Guest
 
Status:
Posts: n/a
Arrow Try this. - 10-30-2006, 09:47 PM

It should be very straightforward:

First create the new variable and define it as a number using the "create new variable" option in the world's property list.

Second, drag it to the place in your program where you first want to use it and give it a dummy value.

Third, go to the world function list and drag the "ask user for a number" function over and replace the dummy value.

Now, when you run the program, a window with "Enter a Number:" (or what ever text you want to use) will appear and the number entered will be available until it gets changed by some other instruction.
   
Reply With Quote
Old
Kirbya
Guest
 
Status:
Posts: n/a
Default 10-31-2006, 11:02 AM

What I'm doing now is just testing this.

I have a sphere in the world and I have it moving up "distance" meters. When I drag the "Ask user for a number" onto "distance" meters it just replaces it and when I enter a number it doesn't modify the variable, just moves the sphere up however many meters I enter into the "Enter a number" window. I need it to edit the variable so i can use it later throughout my program.

EDIT: Nevermind I figured it out now.

Last edited by Kirbya; 10-31-2006 at 11:13 AM.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.