Getting mutiple results from multiple objects
charleyshf
Posts: 165
Good morning,
I've been trying to figure out something for a few days now when using mutiple objects. Say in one object :
test.spin:
test2.spin
If I use 'return resultvar[0]' in test.spin I get the result, but how do I get it to return each result 0,1,2 ?
Thanks
I've been trying to figure out something for a few days now when using mutiple objects. Say in one object :
test.spin:
PUB thisone resultvar[0] := 100 'Y result resultvar[1] := 200 'U result resultvar[2] := 235 'V result returnand in another object I want to get those results for each resultvar and use them
test2.spin
PUB Start PST.DEC(test.thisone) return
If I use 'return resultvar[0]' in test.spin I get the result, but how do I get it to return each result 0,1,2 ?
Thanks
Comments
You really should post all your code we can't see resultvar's declared type or if it is a VAR or DAT.
TEST.SPIN
TEST2.SPIN
test.spin
Test2.spin
I spent the better part of the day yesterday going through the prop manual working with longs/words/bytes and honestly at times it got more confusing as I went along, there was a section that said something to the effect that global vars were only able to be used in the object it was written in and I took that the wrong way.... I also went through the forums and found some posts that were along the lines of what I was trying to do, but they were mostly about launching methods into other cogs(which I though about, but I don't want to add to my confusion!) Thank you again!