Community
AGI Programming => Mega Tokyo AGI Archive => Topic started by: randy on October 26, 2002, 04:18:41 PM
-
Is it possible to allow a user to type in a number and then use that number they enter as a variable in an equation?
-
Yep, that's easy. Use the get.string command (or get.var, look in the help-file to see if it exists)
-Kon-Tiki-
-
If you get it as a string, you can compare it to other strings. To get numbers I think you can also use
get.num(mPROMPT,vNUM);
. I don't know if you can do calculations with the variable then, though.
Zonkie
-
Thought you could de calculations with evey variable, although it's not recommendable to do it with every variable. This ones shouldn't hurt (unless you're using the special variables)
-Kon-Tiki-
-
get.num("give a number: ", v255);
*v255 = 10;
Or:
lindirectn(v255,10);
Game asks you to give a number... Let's say you enter 40... Then *v255 will be v40, so you would assign 10 to v40.