Defaults for variable declarations
Bigsquatch
Posts: 216
I'm suddenly running into problems where I run out of non volatile memory and my variables and arrays wont show any value in debug.
I have been able to correct the issue by going back and explicitly declaring all variables as VOLATILE ( I know I should have been doing this already.)
Did the defaults change in Studio 3 or something? I never bothered with this before and never had a problem?
I have been able to correct the issue by going back and explicitly declaring all variables as VOLATILE ( I know I should have been doing this already.)
Did the defaults change in Studio 3 or something? I never bothered with this before and never had a problem?
0
Comments
You can't put persistents in a module, but like anything else, if you don't specify volatile when you declare a variable in DEFINE_VARIABLE in a module, it defaults to non-volatile. If it's one of those modules that you need to make an instance for every UI device, you can run out of non-volatile memory real fast ... it's especially a problem dealing with someone else's module, as it's far more likely to slip past you.
Yeah, any time I've needed to use a persistent variable in a module, I just read/write the value(s) to a file.