Tried out his code and it worked just fine on mine. Were you adding in spaces by any chance? Anyway, try this version which will trim spaces from the beginning and end:-
ink rgb(0,0,0),0 : set text size 30 : set text font "neuropol"
ink rgb (255,255,255),1
do
cls
input "Gender:";gen$
gen$=lower$(trim(gen$))
if gen$ <> "male" and gen$ <> "female"
valid$="invalid"
else
valid$="valid"
endif
print "Gender '"+upper$(gen$)+"' is "+valid$+"!"
print "Press a key"
wait key
loop
`Trim spaces from start and end of string
function Trim(a$)
while mid$(a$,1)=" ":a$=right$(a$,len(a$)-1):endwhile
while mid$(a$,len(a$))=" ":a$=left$(a$,len(a$)-1):endwhile
endfunction a$
Note also that you don't need to put brackets around the segments of the AND function. eg. you don't need to say "IF (A<>1) AND (B<>1)", you can say "IF A<>1 AND B<>1". Only use brackets for examples like "IF (A<>1 AND C=1) OR (B<>1 AND D=1)". Although in your case it would make no difference. You just don't normally see brackets in IF code until things get complex.
Cheers
I am 99% probably lying in bed right now... so don't blame me for crappy typing
Current fave quote : "She was like a candle in the wind.... unreliable...."