Hey, does anyone with VBS expierence know how to filter on multiple words? This is a part of my array.
Code: Select all
set services = CreateObject( "System.Collections.ArrayList" )
services.add "print"
services.add "DNS"
services.add "DHCP"
services.add "remote desktop services"
services.add "file replication service"
For print/DNS/DHCP it works perfectly, tho when I want to filter on multiple words at once then I need a for loop, but I don't have a clue how, and google won't help me enough lol.
now this is my split function(s):
Code: Select all
public function checklines(tekst, checkword)
lines = split(tekst, vbcrlf)
for each line in lines
'wscript.echo line
if hasword(line, checkword) then
'geef antwoord true
'wscript.echo "checklines = true"
checklines = true
end if
next
if checklines = null then
checklines=false
end if
end function
public function hasword(line, checkword)
words = split(line, " ")
for each word in words
'wscript.echo word
if LCase(word) = LCase(checkword) then
'wscript.echo "hasword = true"
hasword=true
End If
Next
if hasword = null then
hasword=false
end if
end function