Page 1 of 1

localobj array

Posted: Fri May 19, 2017 4:01 pm
by pfortier
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]".


Re: localobj array

Posted: Fri May 19, 2017 5:57 pm
by pfortier
Solved by making "localobj ref" and connecting to a List:
ref = new List()
for i=0,3 ref.append(new Vector())

Re: localobj array

Posted: Sun May 21, 2017 11:47 am
by ted
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.