
-----------------------------------
noob
Sun Mar 16, 2003 8:45 am

Avoiding Crashes
-----------------------------------
I'm trying to avoid crashes due to bad data input, but I don't seem to know how to do it.  I want to get the name of a person, and check the length of the name.  For ex.  I want the name to be less than 25 characters long, but in turing if someone enters one more than 25 letters, there's an error leading back to the code, I want to know how to output the error onto the run window saying its too long and have them re-input the name.

Thanks for the help in advance.

-----------------------------------
azndragon
Sun Mar 16, 2003 9:39 am


-----------------------------------
This should help.

var name : string
var length_of_name : int

loop
put "Enter your name"
get name
length_of_name := length (name)
exit when length_of_name 