I have two questions about the structures I could not answer until now: -Can I add a field to a structure of type structure? (structure in structure)
Tried to insert a second, existing structure, into the first structure without success.
-Can I use constants somehow in structures for array defintions like: fieldname(MYCONSTANT) As Int32 ?
Tried to use a constant, defined as number, to use in a structure without sucess.
Sorry if I answer with another question but, why you use structures?
I mean that structs are sometimes useful when you have to interface to some external libraries with declares. Other than that, I strongly suggest you to make a new class and use this as a well organized container for data. Structs are more useful in C where there is no OOP
It’s exactly my problem, I have to communicate over UDP with application written in C. This application sends me structs. But I use a class to get all the data out of the struct.
And both questions are just to make my struct more readable and flexible. Everything works.
Be warned that Xojo structs doesnt support all features of C structs. For example you cant have variable lengths and pointers to another struct are not easy.
In past I found myself not being able to go further with some declares because of these differences.
The alternative way is to use MemoryBlocks, though this is a PITA.