this bit doesnt work, What am i doing wrong? I looked in the docs for a string.equals() function bu i cant find one.
if String1$=String2$
do something
end if
cheers
charlie
if String1$=String2$
do something
end if
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
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
SuperStrict Graphics 1024,768,0,0 Local userTypedString:String Local regString:String Local lastCharacter:Int Local keycounter:Int=0 Local canenter:Int=True userTypedString$="" lastCharacter = 0 Local endfunc:Int=False Local regnum:Int[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 Print userTypedString Print regString If Trim(userTypedString).toLower() = Trim(regString).ToLower() Print"same" Else Print"not the same" End If