Does VB6.0 have a command like this...
Before anyone screams, yes I have searched MSDN Library...with no luck
I'm grapping a letter of text but I want to limit it to good characters
My code:
If UserLetter is not in "abcdefghijklmnopqrstuvwxyz _
ABCDEFGHIJKLMNOPQRSTUVWXYZ,_+:" then
msgbox ("That character is not allowed")
end if
i.e. Does VB support 'IF X IS NOT IN "ASDFASDF" THEN'
OR something similar.
I can write a routine to do this but I figured that was overkill.
X
[553 byte] By [
Xena] at [2007-11-17 17:10:01]

# 1 Re: Does VB6.0 have a command like this...
You could try the LIKE operator. Something like this
Option Explicit
Dim STTEMP As String
Private Sub Command1_Click()
STTEMP = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
If STTEMP Like "*" & Text1.Text & "*" Then
MsgBox "Found it"
Else
MsgBox "Not there"
End If
End Sub
# 2 Re: Does VB6.0 have a command like this...
Or InStr:
STTEMP = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
If InStr(1, STTEMP, Text1.Text) Then
MsgBox "Found it"
Else
MsgBox "Not there"
End If