
-----------------------------------
aldreneo
Wed Jun 21, 2006 5:25 pm

if not get?
-----------------------------------
How do I do

var oo:real
if not get oo then
    put "Error: ", Error.LastMsg
end if

So that if the user puts a letter insted of a number it doesnt die?

-----------------------------------
Clayton
Wed Jun 21, 2006 6:20 pm


-----------------------------------
i believe there is a function that determines whether input is of the right type, i think it is something like strintok or something to that effect:D

-----------------------------------
TheOneTrueGod
Wed Jun 21, 2006 6:37 pm


-----------------------------------
aye, look in the Turing Help (f10) for
strrealok
strintok
strreal
and
strint

Keep in mind you will need a second variable that is a string, and then you'll need to convert it.  If you keep this in a separate procedure, It won't clutter up your code.

-----------------------------------
aldreneo
Wed Jun 21, 2006 7:15 pm


-----------------------------------
Ok, I got it


var number:real
var letter:string
get letter
if strintok(letter)=false then put "error" else number:=strreal(letter)


Thanks
