dim myArray(10,3) as string
dim v() as string
dim txt_in as textinputstream
txt_in=textinputstream.open(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(10,v.ubound) /// in case there are more than 10 records
for j=1 to 3
myArray(i,j)=nthfield(v(i),",",j)
next j
next i
some of the above is just the way I like to do things, others you need to check the LR, as this is off the top of my head
However the BEST way would be a class with properties of NAME, P and R, but that is beyond the scope of your original question
Thanks,
It looks like this is fairly straight forward.
Eventually I will try and create a data structure.
In the other format, I create a data type something like this: Type sysrec
name as string
p as integer
r as integer
end type
is there a similar format in Xojo?
I finally got part of my program running. I’m able to read the datafile and display the data.
Eventually, I will try and set up a data structure or class, just to clean up the code a little bit.
I’m rather shocked at just how different Xojo is to Visual Basic. The basic coding seems to be rather similar, but it’s the technical parts of file handling and other controls that are confusing. The documentation is helpful, but it can still be a bit confusing.