i still cant get this to work in my code.
I must be doing something wrong.
cheers
charlie
Graphics 1024,768,32,60 Local userTypedString:String Local regString:String Local lastCharacter:Int Local keycounter=0 Local canenter=True userTypedString$="" lastCharacter = 0 Local endfunc=False Local regnum[100] regString$="" While endfunc=False SetScale 1,1 DrawText "Silly test Registration",10,30 DrawText "Type your name Exactly as in the Email!",10,60 If canEnter=True If keyCounter<10 If Not lastCharacter = 0 Then userTypedString$ = userTypedString$ + Chr(lastCharacter) regnum[keyCounter]=Asc(Chr(lastCharacter)) regString$=regString$+regnum[keyCounter] keyCounter:+1 FlushKeys EndIf End If End If DrawText "Hit return to confirm your name...",10,120 SetScale 4,4 DrawText userTypedString$, 10, 150 SetScale 1,1 If KeyHit(key_backspace) And keycounter>=0 userTypedString$="" regString$="" keycounter=0 canenter=False FlushKeys Else lastCharacter = GetChar() canenter=True End If If KeyHit(key_return) endfunc=True FlushKeys Exit End If Flip Cls Wend endfunc=False userTypedString$=Null keycounter=0 While endfunc=False SetScale 1,1 DrawText "Silly test Registration",10,30 DrawText "Type your Registration Exactly as in the Email!",10,60 If canEnter=True If keyCounter<100 If Not lastCharacter = 0 Then userTypedString$ = userTypedString$ + Chr(lastCharacter) keyCounter:+1 FlushKeys EndIf End If End If DrawText "Hit return to confirm your code...",10,120 SetScale 1,1 DrawText userTypedString$, 10, 150 SetScale 1,1 DrawText regString$,10,300 If KeyHit(key_backspace) And keycounter>=0 userTypedString$=Mid$(userTypedString$,0,keyCounter) keycounter=keycounter-1 canenter=False FlushKeys Else lastCharacter = GetChar() canenter=True End If If KeyHit(key_return) endfunc=True FlushKeys End If Flip Cls Wend If userTypedString=regString Print"same" Else Print"not the same" End If
I must be doing something wrong.
cheers
charlie