Right now, I have this set up, kind of a rough program, even though it is my first xojo program:
The file I use is a txt file, called data.txt
[code]Dim f As FolderItem
dim i, j,s as variant
dim myArray(105,3) as string
dim v() as string
dim txt_in as textinputstream
f = GetOpenFolderItem(“text/plain”) //defined as a FileType
txt_in=textinputstream.open(f)’(specialfolder.desktop.child(“somefile.txt”) // assuming its on desktop
s=replacelineendings(txt_in.readall,endofline.unix)
v=split(s,endofline.unix)
for i=0 to min(105,v.ubound) /// in case there are more than 10 records
for j=1 to 3
myArray(i,j)=nthfield(v(i),",",j)
if i = 5 then
Label1.Text=i + v(i)
Label2.Text=nthfield(v(i),",",7) 'Number 7 gives the 7th position in the line
end if
next j
next i[/code]
I have not set up the data structure yet, but in the old visual basic format it is something like this:
Type sysrec
name as string
p as integer
r as integer
end type
I intend on keeping the same data structure using the class method posted earlier, but
I am confused on the calling of the data. Right now, I type in i=5 and that gives me v(i) which gives me the line of row 5 and the Label2 text gives me the info in the 7th field of the line.
How would this change with the xojo structure class that I plan to use?