how do u make user input non-case specific?(newbie

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Guest
how do u make user input non-case specific?(newbie

Post by Guest » Fri Oct 17, 2003 3:25 am

>>>stupid newbie<<< :-[ :-[
does any1 know how you can make a user's input non-case specific?
for example if the program only accepts "green" how can i make it to be able to recognize "GrEen"?

Guest

Re: how do u make user input non-case specific?(ne

Post by Guest » Fri Oct 17, 2003 4:36 am

Lets try this:

. . .
. . .
INPUT "Enter the code";code$
control$ = LCASE$(code$) &nbsp;'change all letters to lower case
IF control$ = "green" THEN
PRINT "ok"
ELSE
PRINT "Try again"
END IF
. . .
. . .

With UCASE$ you change all letters to upper case.

Post Reply