mult dim array

i am coming here from vb6 and have some issues
Doing the programming on a mac.

1st, i have a 10x3 database in a txt file that is somthing like this: name, p,r

How do I open the file and read each line item into an aray

2nd, how would i retrieve the data from the array?

I want type n a number like 5 and get name (5),p (5),r (5)

I know how to do this in vb, but am confused in xojo.

Any help will be appreiciated.

dim myArray(10,3) as string
dim v() as string
dim txt_in as textinputstream"somefile.txt") // assuming its on desktop
for i=0 to min(10,v.ubound) /// in case there are more than 10 records
for j=1 to 3
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

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?


Use a class with properties as Dave has suggested.

Thanks for the help,

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.

Thanks again

Alot of the is due to the fact that XOJO is (my opinon) a more advanced, and much more of a true object oriented event driven language.