Thanks guys,
I should clarify,
I want to make an array of objects and have their properties stored using a type.
I want the array to be dynamic, however as soon as i declare the array as a user defined type I cannot find a way to insert a new element into an array
Quote: "
Or are you just trying to do this:
myarray(id).typefield.insert(data)"
yeah that is almost what I am trying to do but rather than defining the variable id, I would like a new element inserted at the end.
ok guys, now I am starting to get the lingo, basically I want a dynamic array declared as a type.
Quote: "generally you can't just extend arrays by a single property, you add a whole index with all properties (even if the values are set to null)
myarray.insert()
myarray().typefield = data"
this is what I want to do but I get the error unexpected token, among other errors for different attempted variations of the command.
....
Quote: "does myarray.insert(data) fail if data is itself declared as the same type as the array instead of a singular value?
myarray as mytype
data as mytype
data.typefield = somevalue
data.typefieldB = somestring
myarray.insert(data)"
Thanks Ortu!
We have a winner! Maybe I should have skipped to the end of the thread
Thanks for that mate, that seemed to do the trick in a quick test.
I wont be coding tonight, so I will check back in with results later on.
It seems as though this is something to maybe add to the featurecreep thread so that we don't have to declare a dummy variable as a type in order to expand a dynamic array declared as a type.(marathon sentence).
Thanks all for chipping in.
To Err is Human...
To Arr is Pirate!