
-----------------------------------
confuzzius
Fri Feb 13, 2004 6:02 pm

How do you make sure the user enters a number only??
-----------------------------------
well, pretty much right there in the subject line... i want to do this program that manupulates an entered number. but, when the user enters a string, the program exits because of error. is there a way i can stop the auto-exiting?

and btw, i need to be able to multiply the entered number with other numbers.

-----------------------------------
santabruzer
Fri Feb 13, 2004 6:16 pm


-----------------------------------
enjoy :P

var test : string
loop
    get test : *
    exit when strintok (test)
    put "ERROR!!!!! Enter a number Only!!!"
end loop
var realnum := strint (test)
for i : 1 .. 15
    put realnum * i
end for


-----------------------------------
TheXploder
Fri Feb 13, 2004 6:18 pm


-----------------------------------
ohh, well I used char instead of string:

var number : char

loop
put "Enter an number: "..
    get number
    if ord (number) >= 47 and ord (number) 