Asc и Chr $ - это функции, которые необходимо искать.
Private Sub Form_Load()
Dim lSecret As Long
Dim sInput As String
Dim lAscChar As Long
'Define a secret character as an ANSI code.
lSecret = Asc("m")
Do
'Let the user input a single character.
sInput = InputBox("Enter a single character. " & _
"If more characters are entered, only the first one " & _
"will be used. To end just click OK without entering text.")
If Len(sInput) = 0 Then Exit Sub
'Obtain the first character's ANSI code.
lAscChar = Asc(sInput)
'If the user entered the correct secret character, tell her.
'Otherwise give a hint.
If lSecret = lAscChar Then
MsgBox "Great, you are a hero."
Exit Sub
ElseIf lSecret < lAscChar Then
MsgBox "Nope, in the ANSI table, the correct answer is " & _
"before this one."
Else
MsgBox "Nope, in the ANSI table, the correct answer is " & _
"after this one."
End If
Loop
End Sub
Вы не нашли код для сравнения строки? Google - ваш друг. Что вы пробовали до сих пор - поделитесь своими попытками в VB6 – dbmitch
'Dim MySecretChar As String' с только 1 строкой в нем, и самым тривиальным сравнением может быть' If Text1.Text = MySecretChar Then MsgBox («good») ', но дать более проницательность с фрагментом кода, о котором мы можем только догадываться ... –