09-06-2021, 04:18 PM
I guess there must be different solutions depending on how you have made the compiler
A rather good solution would be to put the global variables one behind each other as they are declared liked you said
In this way you can "do structures" as in C
For example, we can "create a structure" like this
Typedef Struct Namestruct {
U8 X;
U8 Y;
U8 * pointer;
} My_struct;
This Way.
nameStruct:
dim x as ubyte = 0
dim y as ubyte = 0
dim pointer as integer = 0
and after this we can iterate with index constants
The compiler only must be sure that don't put any byte between variables
another way is the form AT @udg(1, 7) + 1 but i don't know if the compiler puts some bytes between variables (before or after)
A rather good solution would be to put the global variables one behind each other as they are declared liked you said
In this way you can "do structures" as in C
For example, we can "create a structure" like this
Typedef Struct Namestruct {
U8 X;
U8 Y;
U8 * pointer;
} My_struct;
This Way.
nameStruct:
dim x as ubyte = 0
dim y as ubyte = 0
dim pointer as integer = 0
and after this we can iterate with index constants
The compiler only must be sure that don't put any byte between variables
another way is the form AT @udg(1, 7) + 1 but i don't know if the compiler puts some bytes between variables (before or after)