I am attempting to search a text file for a certain string and execute certain functions if the string occurs. If the string doesn't occur I want to execute something else. I'm using the following code.
Do while txtfile.AtEndOfStream <> True
line = txtfile.Readline
If line <> "" Then
mystr = Split(line, ":", -1, 1)
trimmed = Trim(mystr(0))
Select Case trimmed
Case "string"
--do something here
Case Else
--do something here
End Select
When I leave out the Case Else statement the functions are executed properly when the string occurs. However, when the Case Else statement is inserted the program is executing the second set of funtions even when the string occurs. What am I doing wrong? Please help. Thanks in advance.
Do while txtfile.AtEndOfStream <> True
line = txtfile.Readline
If line <> "" Then
mystr = Split(line, ":", -1, 1)
trimmed = Trim(mystr(0))
Select Case trimmed
Case "string"
--do something here
Case Else
--do something here
End Select
When I leave out the Case Else statement the functions are executed properly when the string occurs. However, when the Case Else statement is inserted the program is executing the second set of funtions even when the string occurs. What am I doing wrong? Please help. Thanks in advance.