Closed kehusa closed 9 years ago
Yes:
message m(b : Byte[256]);
Note that you have to specify the size of the array in the message (ThingML first targeted embedded systems where we do not like dynamic allocation, etc). However, in Java/JS, this should not be a limitation (the array can be any size in practice). In C, I am not sure array works in messages.
Hi, In the old version of ThingML the use of arrays had unwanted sideeffects. When sending an array as parameter only the pointer to the array was added to the message. The result was that this only is safe for constant arrays.
I dont know if this is fixed in the new version...
it is indeed (and still) not recommended in C. But it should not have those side effects in Java and JS as we went for different choices regarding the code we generate for those platforms.
@kehusa I guess we can close that issue for now? Just re-open it if you have problems using array in JS (I guess you wanted to use them in JS?)
Do you have any example on how we can use arrays as datatypes in messages?