You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With an array of strings a similar error appears. Non native arrays work fine.
Compiling on RP2040 / platformio and earlephilhower core.
I also noticed in vars.h the external definition of an array of integers is very generic (void*):
Isn't this very prone to errors? You have to keep types manually in sync between code and flow definition and with a void definition the compiler might not catch an error or do a type cast for you? I couldn't test this because of the compile error.
The text was updated successfully, but these errors were encountered:
In the next version of EEZ Studio it will be only possible to have native global variables of these types:
Integer
Float
Double
Boolean
String
Enum of any type
It will not be possible to enable Native checkbox for any other variable type.
So, above error will not be possible.
But, it will be possible to access and modify array and struct flow variables using native code.
For example, Point structure:
and points variable defined as array of Point:
Example of setting points array from native to flow:
ArrayOfPointValue points(10);
for (unsinged i = 0; i < 10; i++) {
PointValue point;
point.x(i);
point.y(2 * i + 1);
points.at(i, point);
}
flow::setGlobalVariable(FLOW_GLOBAL_VARIABLE_POINTS, points);
Get points array from flow to native:
ArrayOfPointValue points = flow::getGlobalVariable(FLOW_GLOBAL_VARIABLE_POINTS);
for (unsinged i = 0; i < points.length(); i++) {
auto x = points.at(i).x();
auto y = points.at(i).y();
// ...
}
I think this one can be closed? Or do you want to keep it open until it is described in documentation? (I currently don't see this on the published docs on envox.eu)
Defining a native array of integers:

Check and build are fine, but compilation gives:
Something seems of in the generated code.
With an array of strings a similar error appears. Non native arrays work fine.
Compiling on RP2040 / platformio and earlephilhower core.
I also noticed in vars.h the external definition of an array of integers is very generic (void*):

Isn't this very prone to errors? You have to keep types manually in sync between code and flow definition and with a void definition the compiler might not catch an error or do a type cast for you? I couldn't test this because of the compile error.
The text was updated successfully, but these errors were encountered: