
-----------------------------------
masterfenix
Mon Dec 05, 2005 8:26 pm

the index
-----------------------------------
Hi,
I am testing a user inputs.

say if they want to quit the current proc, they ahve to type in 'quit'

in my proc I have,


var userinput : string
get userinput

if index("quitQUIT", userinput) > 0 then 
      return
end if

but now, if the user types in 'qu' or 'q' it automattcally quits.
but if i just test again userinput = 'quit' , and they type in say QuIt then its not gonna work.

I was thinking of making a small function that makes that string into a small case string. that could solve things, but if theres a way to do it with index, please tell me.

-----------------------------------
zylum
Tue Dec 06, 2005 1:03 am


-----------------------------------

var userinput : string
get userinput

if Str.Lower(userinput) = "quit" then
      return
end if

hope that helps  :wink:

-----------------------------------
MysticVegeta
Tue Dec 06, 2005 12:15 pm


-----------------------------------
May I add that works for Turing 4.05 only

-----------------------------------
[Gandalf]
Tue Dec 06, 2005 3:49 pm


-----------------------------------
And if you don't have it, then you can create your own version, or add this to your program:
function Lower (s : string) : string
    var res : string := ""
    for i : 1 .. length (s)
        if "A" 