Hello, I have written a simple code for User-Input-Validation. It seems to work. But for a wrong string input there is the error 4 (Undefined variable:).
Q1. Can this error be hidden? Q2. Kindly let me know if I should use a better validation code. Thanks for your help Kalyan CODE: clear clc month = 0; while (month<1 | month>6) month = input('Please chose your option between 1 and 6: '); if (type(month)==10) then month=0;end;//10 - represent string end select month case 1 disp("Month is January") case 2 disp("Month is February") case 3 disp("Month is March") case 4 disp("Month is April") case 5 disp("Month is May") case 6 disp("Month is June") else disp("Wrong Month number") end disp(month)
_______________________________________________ dev mailing list dev@lists.scilab.org http://lists.scilab.org/mailman/listinfo/dev