Cannot delete this variable because it is used in macro Main by icon Loop

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
andeug
Posts: 101
http://meble-kuchenne.info.pl
Joined: Thu Jan 07, 2021 1:42 pm
Location: Stockholm (SE)
Has thanked: 34 times
Been thanked: 5 times

Flowcode v11 Cannot delete this variable because it is used in macro Main by icon Loop

Post by andeug »

Hi,


I have a little project I am working on, and I realized I cannot delete the variable marked in the picture below if I am choosing "Loop Forever":
Screenshot 2026-07-13 134859.jpg
Screenshot 2026-07-13 134859.jpg (65.83 KiB) Viewed 61 times
I can rename it, but in my FC project, I cannot see it anywhere on a first view.
So I started to dig and found it on Properties: Loop, hidden on "Loop until", which was not selected.
Screenshot 2026-07-13 135405.jpg
Screenshot 2026-07-13 135405.jpg (77.82 KiB) Viewed 61 times
Is this a bug that should be reported to Matrix TSL, or is this how FC is expected to work? Below is the project example.
buggy project.fcfx
(20.41 KiB) Downloaded 10 times
Regards,
Andreas
FC11 Professional + ARD + AVR + ARM license + Matrix TSL E-blocks2 boards
Mikroe Click boards + Arduino Nano/Uno Click Shield

Steve-Matrix
Matrix Staff
Posts: 1961
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 291 times
Been thanked: 458 times

Re: Cannot delete this variable because it is used in macro Main by icon Loop

Post by Steve-Matrix »

Thanks for the report. As a convenience, Flowcode remembers any expression used in a Loop command. But this is hidden when "Loop Forever" is selected.

This should be fairly easy to fix - I will allow the variable to be deleted if it only shows in hidden/remembered expressions.

medelec35
Valued Contributor
Posts: 2325
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 724 times
Been thanked: 783 times

Re: Cannot delete this variable because it is used in macro Main by icon Loop

Post by medelec35 »

While waiting for a fix, the variable can be removed using your favorite text editor.
Before making any changes, always make a backup of the original first, as it's easy to make a mistake that will prevent your project from loading.
Attachments
buggy project. modifed.fcfx
(20.2 KiB) Downloaded 4 times
Martin

andeug
Posts: 101
Joined: Thu Jan 07, 2021 1:42 pm
Location: Stockholm (SE)
Has thanked: 34 times
Been thanked: 5 times

Re: Cannot delete this variable because it is used in macro Main by icon Loop

Post by andeug »

I have actually fixed the issue within the same project, after digging a bit into Loop.
I have only seen this problem once, so it does not affect me (but might affect other newbies like me). :)
FC11 Professional + ARD + AVR + ARM license + Matrix TSL E-blocks2 boards
Mikroe Click boards + Arduino Nano/Uno Click Shield

medelec35
Valued Contributor
Posts: 2325
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 724 times
Been thanked: 783 times

Re: Cannot delete this variable because it is used in macro Main by icon Loop

Post by medelec35 »

No problem.
For anyone else, if you do face the same issue and don't want to edit the fcfx file within an editor.
Just Right-click on the variable and select List occurrences.
Double click (or right-click and select Show) in the loop icon that appears within Icon Lists window.
You might need to change the loop type to Count, as that is only time you will find a variable.
You find the variable causing the issue (until and update hase fixed it of course).
Martin

Post Reply