For general Flowcode discussion that does not belong in the other sections.
p.erasmus
Posts: 434 http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times
Post
by p.erasmus » Thu Nov 03, 2022 6:20 am
Hi all,
I know that accessing a global variable or a flowcode macro in a C icon the prefix FCV or FCM is used however searching the wiki I found no reference to acessing a local variable such as ".myvariable"
Is this in anyway possible Thanks for helping out
Regards Peter - QME Electronics
mnfisher
Valued Contributor
Posts: 1557 Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 138 times
Been thanked: 742 times
Post
by mnfisher » Thu Nov 03, 2022 7:07 am
FCL_VARIABLENAME
It's also possible to use macros - FCM_MacroName (params..); - Note that the macro's name isn't capitalised whereas variable names are.
Martin
p.erasmus
Posts: 434 Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times
Post
by p.erasmus » Thu Nov 03, 2022 7:25 am
Thanks Martin
apprecaite your help !
another questiuon is there away to make alocal variable static in FC i.a.w that it retains its value when going out of the macro and when retuning to it ?
Regards Peter - QME Electronics
mnfisher
Valued Contributor
Posts: 1557 Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 138 times
Been thanked: 742 times
Post
by mnfisher » Thu Nov 03, 2022 7:48 am
Probably that would require a cheat....
Declare the variable in a C block and then assign to a local - and at the end of the macro 're-assign to the 'static'
Start of macro:
Then end of macro:
Martin
p.erasmus
Posts: 434 Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times
Post
by p.erasmus » Thu Nov 03, 2022 7:52 am
Thanks Martin
no so elegant
Regards Peter - QME Electronics