localobj array

Anything that doesn't fit elsewhere.
Post Reply
pfortier
Posts: 42
Joined: Thu Apr 20, 2006 8:02 am
Location: University of Ottawa

localobj array

Post by pfortier » Fri May 19, 2017 4:01 pm

How can I create a local object array?
I thought of entering "localobj ref[4]" in a procedure but that didn't work.
Outside a procedure, I can successfully create an object array using "objref ref[4]".

Thanks,
Pierre

pfortier
Posts: 42
Joined: Thu Apr 20, 2006 8:02 am
Location: University of Ottawa

Re: localobj array

Post by pfortier » Fri May 19, 2017 5:57 pm

Solved by making "localobj ref" and connecting to a List:
ref = new List()
for i=0,3 ref.append(new Vector())

ted
Site Admin
Posts: 5091
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: localobj array

Post by ted » Sun May 21, 2017 11:47 am

Good solution. Another possibility, assuming that all vectors are of the same size and you know how many you need to deal with, is to use the Matrix class's setcol() or setrow() method. Which one you choose depends on what you intend to do with all those numbers.

Post Reply