Verifies if a string you enter is a palendrome or not.
Verifies if a string you enter is a palendrome or not.
Rate Verifies if a string you enter is a palendrome or not.
(2(2 Vote))
'this function will determine whether the word you type into a textbox on the 'form is a palendrome or not after you click the command button
'a palendrome is word such as "pop" or "level" which spells the same forwards 'as backwards
'declare variables
Dim strWord As String
Dim strReverse As String
Dim i As Integer
strWord = Text1.Text
For i = Len(strWord) To 1 Step -1
strReverse = strReverse & Mid$(strWord, i, 1)
Next i
If UCase(strReverse) = UCase(strWord) Then
MsgBox "This IS a palendrome.", vbExclamation = vbOKOnly, "Yes Indeed"
Beep
Exit Sub
Else
MsgBox "This IS NOT a palendrome.", vbCritical = vbOKOnly, "Sorry"
End If
Verifies if a string you enter is a palendrome or not. Comments
No comments yet — be the first to post one!
Post a Comment