Max Number of Variables in FC

For general Flowcode discussion that does not belong in the other sections.
Post Reply
unity-control
Posts: 54
http://meble-kuchenne.info.pl
Joined: Wed Sep 08, 2021 10:36 pm
Has thanked: 26 times
Been thanked: 11 times

Max Number of Variables in FC

Post 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

mnfisher
Valued Contributor
Posts: 1224
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 119 times
Been thanked: 628 times

Re: Max Number of Variables in FC

Post 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

Steve-Matrix
Matrix Staff
Posts: 1388
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 185 times
Been thanked: 322 times

Re: Max Number of Variables in FC

Post 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.

unity-control
Posts: 54
Joined: Wed Sep 08, 2021 10:36 pm
Has thanked: 26 times
Been thanked: 11 times

Re: Max Number of Variables in FC

Post 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

Post Reply