fb:porticula NoPaste
Masken
Uploader: | PMedia |
Datum/Zeit: | 12.07.2007 18:38:36 |
Function match(byVal Text As String,byVal Mask As String) As Integer
Dim TempText As String
Dim S As String
Dim i As Uinteger
Dim matches as integer
Dim DestRPL As Integer
Dim DoneRPL As Integer
Dim PrevText As String
Do
If substr(Mask, "*", i) <> chr(0) AND substr(Mask, "*", i) <> "" then
DestRPL += 1
end if
i += 1
Loop Until i > len(Mask)
i = 0
TempText = Text
Do
PrevText = TempText
S = substr(Mask, "*", i)
TempText = replace(TempText, s, string(len(S),"X"))
If PrevText <> TempText then
DoneRPL += 1
end if
i += 1
Loop Until i > len(Mask)
if DestRPL-DoneRPL = 0 then return 1
if DestRPL-DoneRPL <> 0 then return 0
End Function