I’m reading the contents of a text file and putting each line into a listbox. I’m trying to make it not put the text “WORKSTATION” into the listbox if that text is detected. I’ve tried a few variations of the following code, but the results are always the same. It finds “WORKSTATION” in the file, but still puts it into the list box. What am I doing wrong? Everything else is working fine, it just doesn’t skip the “WORKSTATION” text when it finds it.
Dim vendors As FolderItem = SpecialFolder.Temporary.child("WK_Vend.txt") Dim t as TextInputStream dim A as integer = 0 while A = 0 if vendors.Exists then t = TextInputStream.Open(vendors) t.Encoding = Encodings.UTF16 dim x as string While Not t.EndOfFile x = t.ReadLine if x <> "WORKSTATION" then VENDORS_LISTBOX.addrow(x) end Wend t.Close vendors.Delete A = A + 1 end wend