Page 1 of 1
Max Number of Variables in FC
Posted: Mon Sep 20, 2021 9:35 pm
by unity-control
Hi there,
I was just wondering what is the maximum amount of variables that FC can handle within a Macro?
We have got some C code we want to convert into FC and it seems there are 500 variables inside the code. Is this something FC can handle without trouble?
Thanks in advance!
R
Re: Max Number of Variables in FC
Posted: Tue Sep 21, 2021 9:10 am
by mnfisher
Sounds like a job for an array...
int x[500] or similar
It would get rather 'messy' in C, FC or any other language with that many variables otherwise.
Martin
Re: Max Number of Variables in FC
Posted: Tue Sep 21, 2021 9:14 am
by Steve-Matrix
I don't believe there are any limits to the number of variables allowed in Flowcode macros.
However, 500 variables in one function is a massive amount and I would seriously consider refactoring the code into multiple macros each with fewer variables as this will be easier to understand and maintain in the future.
To put this in context, the code analysis software I use when developing Flowcode itself flags warnings if any function has more than 15 local variables.
Re: Max Number of Variables in FC
Posted: Tue Sep 21, 2021 2:04 pm
by unity-control
Thanks to both for your suggestions.
We will break down this subroutine into different macros and we will bundle individual settings into diff variables.
Cheers,
R