Do until ... loop not working

  • Thread starter Thread starter Imran J Khan
  • Start date Start date
I

Imran J Khan

I am trying to build a routine which reads a text file and parses and deletes
data from it, untill there is not data left in the text file. However, my
loop continues to run past when the text file is "" and I need it to stop
when the file is "".
I assign the contents of the file to the variable strText which is declared
at the option explicit section before any of the subs/functions.

I have the following code for the loop
Do until strText = ""
'does various things
Loop

Have I misunderstood how this is supposed to work.

If I change the the code as below
Do until not (strText = "")

This works if I make the change during debugging, but exits the loop without
extracting data because the strText is not empty.
I am chasing my on tail again. Help.
 
Imran -

Should you be testing for end of file (.EOF) instead of an empty string? Is
this set up as a recordset? Do you have a 'MoveNext' in there? We don't
have enough information to help you...
 
Back
Top