|
-
Feb 16th, 2007, 04:11 AM
#1
Thread Starter
Member
one letter
if txtNaam.text = "O?:" & lstGekozenOpties.List(i) Then
the ? must represent one! letter. Must I use ? or * or something else ?
-
Feb 16th, 2007, 04:42 AM
#2
Re: one letter
wait what letter do you want ? to represent there is 26 :P
-
Feb 16th, 2007, 04:53 AM
#3
Re: one letter
You need to use Like instead of Equals to(=)
if txtNaam.text Like "O?:" & lstGekozenOpties.List(i) Then
 why can't programmers keep and 31 Oct and 25 dec apart. Why Rating is Useful
for every question you ask provide an answer on another thread.
-
Feb 16th, 2007, 04:56 AM
#4
Re: one letter
You don't NEED TO the only problem here is that he hasn't stated everything
-
Feb 16th, 2007, 06:34 AM
#5
Re: one letter
 Originally Posted by Hell-Lord
wait what letter do you want ? to represent there is 26 :P
Any of them.. he wants "?" to represent a wild card!
-
Feb 16th, 2007, 06:59 AM
#6
Re: one letter
Here is one way (I have had a few...):
VB Code:
Option Explicit
Const ALPHABET As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Private Sub Command1_Click()
If Left$(txtNaam.Text, 1) = "O" And InStr(1, ALPHABET, Mid$(txtNaam.Text, 2, 1), vbTextCompare) And Mid$(txtNaam.Text, 3, 1) = ":" Then
If Mid$(txtNaam.Text, 4, Len(txtNaam.Text) - 4) = lstGekozenOpties.List(i) Then
'Do something
End If
End If
End Sub
-
Feb 16th, 2007, 05:50 PM
#7
Re: one letter
Hmmm overkill - try this:
Use Like() to pattern match.
VB Code:
If UCase(txtNaan.Text) Like ("O[ABCDEFGHIJKLMNOPQRSTUVWXYZ]:" & UCase(lstGekozenOpties.List(i))) Then
'Do stuff
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|