Hi
It's been a while since I posted a question as, thanks in no small part to you lot here, I've got better at sussing out any problems for myself.
But still, I have a query.
If I open a text file with e.g.
then search for text within it (by matching a variable against an array element taken from the text file) with
do I have to close and reopen that text file should I need to search through it again?
I ask because I've set up some recursive code but on the second pass I get this error:
I've commented out
and the
line hasn't been called when the error occurs so I can't blame them.
Any suggestions?
JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
It's been a while since I posted a question as, thanks in no small part to you lot here, I've got better at sussing out any problems for myself.
But still, I have a query.
If I open a text file with e.g.
Code:
Set objAccountsOnlyList = objFileSystem.OpenTextFile(strAccountsList, ForReading)
Code:
text = objAccountsOnlyList.ReadAll
arrText = Split(text, vbCrLf)
For Each elem In arrText
If elem = "" then
' do Nothing, it's just a blank line that we don't care about.
Else
strAccount = Split(elem,",",2)
If LCase(strAccount(0)) = LCase(strSplitUserName) Then
strUsersFullName = strAccount(1)
wscript.echo "Found " & LCase(strAccount(0)) & " (" & strUsersFullName & ")"
bUserNameFound = True
Exit For
End If
'objStrFile2.write elem
End If
Next
I ask because I've set up some recursive code but on the second pass I get this error:
Code:
Microsoft VBScript runtime error: Input past end of file
Code:
objAccountsOnlyList.Close
Code:
Set objAccountsOnlyList = Nothing
Any suggestions?
JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]