10 posts
Posted 14 December 2012 - 09:11 PM
Is there any way I can accept a table (or its equivalent) as an argument of IPeripheral.callMethod(), or return something as a table? Or is there any other way to do it? E.g.
myTable = {1,2,3}
otherTable = peripheral.myFunction(myTable)
2447 posts
Posted 14 December 2012 - 10:55 PM
No, you cannot accept tables. You can however return a table - just return a map in the object array.
510 posts
Posted 15 December 2012 - 03:52 AM
will that ever be changed? you could convert a table to a java map the same way you do it the other way round, couldn't you?
6 posts
Posted 16 December 2012 - 08:37 AM
No, you cannot accept tables. You can however return a table - just return a map in the object array.
Just FYI, this isn't mentioned anywhere in the doc.
2447 posts
Posted 16 December 2012 - 04:37 PM
No, you cannot accept tables. You can however return a table - just return a map in the object array.
Just FYI, this isn't mentioned anywhere in the doc.
That's because we haven't updated the doc since this was added.
715 posts
Posted 30 December 2012 - 03:58 PM
No, you cannot accept tables. You can however return a table - just return a map in the object array.
OMG, I can't believe it. I was just looking at some peripheral code and was stumped why a map was returned where I so painstakingly put together a string-representation of a table…
So I immediately searched for it, landed here and… what do you know, simply returning a map actually works.
Well that makes life much easier. Just goes to show how studying others' code can yield more information than studying the actual documentation, hehe. :P/>
Anyway, a big thanks for implementing that! ^_^/>