• Welcome to Valhalla Legends Archive.
 

Wildcards...I cant find error

Started by Gangz, December 28, 2003, 07:27 PM

Previous topic - Next topic

Gangz

 Can you guys see any errors in this on why it wouldnt work?

 If strAccess = "M" Or strAccess = "O" Then
       If LCase(Mid(message, 1, 5)) = Form1.varTrigger & "ban " Then
           message = Replace(message, Form1.varTrigger & "ban ", "")
           For i = 0 To Form1.ul.ListCount
               If LCase(message) Like LCase(Form1.ul.List(i)) Then
                   Form1.cboQueue.AddItem "/ban " & Form1.ul.List(i)
               End If
           Next i
       End If


UserLoser.

#1
LCase(message) Like LCase(Form1.ul.List(i))

Switch that around, it's String Like Pattern, not Pattern Like String

What you have, would do If *bob* Like JoeBobbity - which would return false

Gangz

thanks user...For thos eof you that are as newbie as me it works like  this.                 If LCase(Form1.ul.List(i)) Like "*" & LCase(message) & "*" Then

Yoni

Quote from: Gangz on December 28, 2003, 08:17 PM
thanks user...For thos eof you that are as newbie as me it works like  this.                 If LCase(Form1.ul.List(i)) Like "*" & LCase(message) & "*" Then
Not sure what you want it to do but that looks like a bad idea. "message" might contain wildcard characters and then you might get unwanted effects. You should probably just use InStr.