Author Topic: User input question  (Read 1899 times)

0 Members and 1 Guest are viewing this topic.

randy

  • Guest
User input question
« 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?



Kon-Tiki

  • Guest
Re:User input question
« Reply #1 on: October 26, 2002, 04:41:59 PM »
Yep, that's easy. Use the get.string command (or get.var, look in the help-file to see if it exists)

-Kon-Tiki-

Offline Zonkie

Re:User input question
« Reply #2 on: October 26, 2002, 04:53:10 PM »
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

Kon-Tiki

  • Guest
Re:User input question
« Reply #3 on: October 26, 2002, 05:05:46 PM »
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-

Offline Jelle

Re:User input question
« Reply #4 on: October 27, 2002, 06:28:37 AM »
Code: [Select]
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.
Politics is supposed to be the second-oldest profession. I have come to realize that it bears a very close resemblance to the first.


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.033 seconds with 21 queries.