Error!
Author |
Message |
tlivingston
|
Posted: Fri Dec 06, 2002 5:19 pm Post subject: Error! |
|
|
How can i make that when i ask a user to enter a number( such as a deposit for a bank) there won't be an error if they enter a word.
Obviously one could make it s string but the problem is i need to be able to use adding, subtracting, etc on these inputs (basically, how can i trun a string into an integer?).
Thanks a lot for your help, Ted. |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
krishon
|
Posted: Fri Dec 06, 2002 5:26 pm Post subject: (No subject) |
|
|
ted, i think all u hafta do is like put in or int ( dun't remember which one it is) after the variable name. It is the same as turning a int into a string, u add str to the end of it. U could verify with someone else, but i think that's it |
|
|
|
|
 |
Tony

|
Posted: Fri Dec 06, 2002 5:31 pm Post subject: (No subject) |
|
|
you take input as String, then use
strint("text") to convert string to integer value.
such as
strint("10") returns integer value of 10 |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
krishon
|
Posted: Fri Dec 06, 2002 11:35 pm Post subject: (No subject) |
|
|
that wuz wuz i meant, i just wusn't sure of the code, lol, so ted feelin betta or u still sick |
|
|
|
|
 |
tlivingston
|
Posted: Sat Dec 07, 2002 11:07 am Post subject: (No subject) |
|
|
feelin a bit better....hopefully in on monday if my voice isnt still shot |
|
|
|
|
 |
|
|