
-----------------------------------
tecnikal
Sat May 30, 2009 1:19 pm

Error proofing user input
-----------------------------------
My program asks for a user to input integer values. Is there a way, just in case a user inputs a real number with decimal places, to make the program check if it is a real number or an integer value?


The numbers MUST be integer values otherwise it will mess up the program.

-----------------------------------
DtY
Sat May 30, 2009 1:38 pm

RE:Error proofing user input
-----------------------------------
the function strintok(String):Boolean will tell you if it can be converted to an integer.

-----------------------------------
Dusk Eagle
Sat May 30, 2009 3:47 pm

Re: Error proofing user input
-----------------------------------
So, as DtY implied, you should get the input as a string and then use strintok (input), strint (input), strrealok (input), and strreal (input) to convert the variable to the appropriate type.

-----------------------------------
DtY
Sat May 30, 2009 3:52 pm

Re: Error proofing user input
-----------------------------------
So, as DtY implied, you should get the input as a string and then use strintok (input), strint (input), strrealok (input), and strreal (input) to convert the variable to the appropriate type.
Oh yah, I should have mentioned you need to get input as a string. Thanks
