Hi all. Nice forum. Thanks for all the great posting.
I've been playing around with brightScript and have, what I hope is, a minor question. When I create an "object" in bScript, I can create simple instance variables and methods without issue. However, the multi-dimensional arrays are causing issues. Example of what I would like to do:
Function newSomeObject() AS object
this = {}
this.Init()
return this
this.init = function()
DIM m.theData[8, 5]
m.fe = 0
m.fi = 0
m.theData[1,2] = 42
end function
this.andThatFunction = function(foo as integer)
......
end function
end function
I obviously can't DIM the data array like this (syntax error). Of course, it works fine at function/global scope without the "m.". So how do I create an instance variable (multi-dim array) for an object? The manual didn't explain that part very well. If I use createObject(), I need to create an array of arrays? What's the syntax for that?
Then I can have
obj1 = newSomeObject()
obj2 = newSomeObject()
obj1.theData[1,2] = 3
obj2.theData[4,5] = 6
All this works fine except for the DIM line. Does this make sense or am I way off (new to BScript)????
Thanks in advance for the help!
EDIT: P.S. I can
probably use createObject and create a single dimension array and multiply the indices out properly, but I would like to use the multi-dim syntax if possible.