Trip
Registered
Simple REALbasic code for a program i'm trying to put together. The setup (in a nutshell) is as follows: I have a listbox that is suppost to load data into each column it has from a text file located in the preferences folder. But for some odd reason it's giving me an error. Take a look:
Why is it giving me that? I really don't see where i've gone wrong!!! Can somebody comment on this or tell me how i can find out? Thanks!
dim file as folderitem
dim filestream as TextInputStream
dim data as string
dim i as integer
file = PreferencesFolder.child("TEST Data")
if file <> nil then
filestream = file.openastextfile
While Not filestream.EOF «Unhandled NilObjectException Raised
data = filestream.ReadLine
ListBox1.addrow ""
i = ListBox1.LastIndex
ListBox1.cell(i, 0) = nthField(data, Chr(9), 1)
ListBox1.cell(i, 1) = nthField(data, Chr(9), 2)
Wend
end if
filestream.close
end if
Why is it giving me that? I really don't see where i've gone wrong!!! Can somebody comment on this or tell me how i can find out? Thanks!