tryleft
usr.left = input("How much left do you want to move?") as num
if(length(usr.left)>10)
usr << "Too much"
goto tryleft
this code should ask you how much left you want to move and if its over 10 then it should say too far and let you input again, BUT i can put stuff like 500 and it accepts it
any help?
(and i'm sry to ask so many questions lately)
ID:172372
May 22 2004, 9:16 am
|
|
#1 May 22 2004, 9:25 am
|
|
The length() proc only measures text, lists, or files. A number would probably be interpretted as text. That would mean you'd be able to get away with any number so long as it has less than 10 digits(ex: 1,000,000,000). Don't use length, just check against the left var itself.
| |
wow how could i be so stupid that i didn't realise t o do if(left>10)
sorry for wasting everyone's time | |
#3 May 22 2004, 12:12 pm
|
|
Don't use goto.
| |
Garthor wrote:
Don't use goto. I use goto also in my code. Whats wrong with it? | |
