Computer Science Canada Number pad to int |
Author: | wthef_wc3 [ Wed Mar 02, 2005 8:31 pm ] |
Post subject: | Number pad to int |
This is my first post, and id like to say this is a great site and has proven very helpful for me. To the point: i am making a program that uses a mouse operated (mousewait function) number pad to get info from the use. the problem is that i cannot transfer the input value into an integer variable. can anyone offer a solution. |
Author: | ssr [ Wed Mar 02, 2005 8:44 pm ] |
Post subject: | |
tnx can we see ur code? ![]() |
Author: | jamonathin [ Wed Mar 02, 2005 8:47 pm ] | ||||
Post subject: | |||||
be more specific, like, how is your number pad set up (GUI buttons, etc.), and what is it exactly getting from the user, like a number, a word (string), because if you're getting a decimal number from them, then do this;
but if it's a string value (that's still a number, juss use strint . . .
and if it's anything else, juss clarify ![]() |
Author: | ssr [ Wed Mar 02, 2005 8:53 pm ] |
Post subject: | |
lol yes be more specific, for the strint option u can test it with strintok but I think u already know these eh? 8) |
Author: | person [ Wed Mar 02, 2005 9:02 pm ] |
Post subject: | |
u can also div it by one to make it into an int instead of real |
Author: | ssr [ Wed Mar 02, 2005 9:08 pm ] | ||
Post subject: | |||
we r talking about for real to int now eh
all mean round one round up and the other round down lol learnt this from some1 in this forum forgot teh name ![]() |
Author: | Flikerator [ Wed Mar 02, 2005 9:24 pm ] |
Post subject: | |
If its an int to a real; intreal () that simple ![]() |
Author: | jamonathin [ Wed Mar 02, 2005 10:04 pm ] |
Post subject: | |
I guess we can all just sit around and take random guesses at what this boy wants figured out ![]() |
Author: | Flikerator [ Wed Mar 02, 2005 10:05 pm ] |
Post subject: | |
jamonathin wrote: I guess we can all just sit around and take random guesses at what this boy wants figured out
![]() Well thats what we are doing ![]() |
Author: | wthef_wc3 [ Wed Mar 02, 2005 10:59 pm ] |
Post subject: | |
wow, fast service lol. ok to be more specific its a number pad so 0-9 can be pressed, in my program i need to allow the user to enter in a 7 digit int amount using the number pad. im programs on other comp but its set up using a simple mouse.wait function. the buttons are not GUI. to sum up i need to know how to change an input that is seperate int numbers (ie. "3" "5" "5" "6" "4" "8" "7") which is entered through the pad, into the number 3556487. when a number is pressed i have an int variable to store each number, i need to know how to change the 7 int vars into one real var with a number like below number as entered by numpad (ie. "3" "5" "5" "6" "4" "8" "7") to = on int var with value :=3556487 |
Author: | jamonathin [ Thu Mar 03, 2005 6:50 am ] | ||
Post subject: | |||
What you can do, is after you get ur 7 numbers, add them one by one to a string, then convert that into an int value. . .
![]() |
Author: | ssr [ Fri Mar 04, 2005 10:44 pm ] | ||
Post subject: | |||
[quote="jamonathin"]What you can do, is after you get ur 7 numbers, add them one by one to a string, then convert that into an int value. . . [quote] just as an example of that try this at least thats how i did it ![]()
|