Computer Science Canada Error! |
Author: | tlivingston [ 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. |
Author: | krishon [ Fri Dec 06, 2002 5:26 pm ] |
Post 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 |
Author: | Tony [ Fri Dec 06, 2002 5:31 pm ] |
Post 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 |
Author: | krishon [ Fri Dec 06, 2002 11:35 pm ] |
Post subject: | |
that wuz wuz i meant, i just wusn't sure of the code, lol, so ted feelin betta or u still sick |
Author: | tlivingston [ Sat Dec 07, 2002 11:07 am ] |
Post subject: | |
feelin a bit better....hopefully in on monday if my voice isnt still shot |