SPIN2 Object Arrays - Compile Errors vs Documentation
RbtsEvrywhr_Riley
Posts: 28
in Propeller 2
Has anyone tried to use data structures in SPIN2 using arrays of objects defined like:
async[10]: "asynchronous"
and tried to call methods within them?
currentString := async[ asyncpointer ].getRecvStrPtr()
In Spin on the P1 this works. On the P2, in prop tool and PNUT, this fails to compile with "expected "."" after "async", and all variations of adding . into this to separate the array index does not work (it expects it to be a constant or method, as I figured). Here is the original Spin reference. https://www.parallax.com/sites/default/files/downloads/AN003-AbstractDataStructures-v1.0.pdf
On Page 3 of the SPIN2 documentation, it indicates that arrays of objects are still supported; I can't think of other syntax that would be used to call them, though the manual does not indicate the syntax.
I'd like to know what's up with this, as I need it for a very useful test automation project you guys are gonna like.
async[10]: "asynchronous"
and tried to call methods within them?
currentString := async[ asyncpointer ].getRecvStrPtr()
In Spin on the P1 this works. On the P2, in prop tool and PNUT, this fails to compile with "expected "."" after "async", and all variations of adding . into this to separate the array index does not work (it expects it to be a constant or method, as I figured). Here is the original Spin reference. https://www.parallax.com/sites/default/files/downloads/AN003-AbstractDataStructures-v1.0.pdf
On Page 3 of the SPIN2 documentation, it indicates that arrays of objects are still supported; I can't think of other syntax that would be used to call them, though the manual does not indicate the syntax.
I'd like to know what's up with this, as I need it for a very useful test automation project you guys are gonna like.
Comments
http://forums.parallax.com/discussion/172043/spin2-compiler-error#latest
The problem was introduced when I added automatic constant-expression resolving. I was looking for object.constant and not allowing for the possibility of an [index], instead of a period.
http://forums.parallax.com/discussion/171196/pnut-spin2-latest-version-v34x-graphical-debugger-improved-object-array-bug-fixed/p1