Page 1 of 1
Flowcode document name
Posted: Thu Dec 04, 2025 10:25 am
by Xbiotec
Hello,
is it possible to get the name of the .fcfx and store it in a variable to be able to use it in the firmware ?
if the file name is for example: R IDF 5.3 Test12.fcfx
the name will be "R IDF 5.3 Test12"
Thx
Re: Flowcode document name
Posted: Thu Dec 04, 2025 1:26 pm
by Steve-Matrix
Hopefully the attached project shows you how to do it. I used a combination of the "AddConst" event to manipulate the value (and size) of a constant and the "Expand.PathName" to retrieve the name of the file.
If you compile the project, the "MYFILENAME" Flowcode constant should be set to the name of the actual Flowcode project file.
Re: Flowcode document name
Posted: Thu Dec 04, 2025 2:02 pm
by Xbiotec
thank you but , in fact, I don't know how to use it in my program
Re: Flowcode document name
Posted: Thu Dec 04, 2025 2:47 pm
by Steve-Matrix
Here are the steps that I did to create it in that attached project:
- Create a global constant
- Double-click the Compile::Ev_AddConst event in Project Explorer
- Double-click <Add new>
- Click "OK"
- Click "OK and Edit Macro"
- Add code as per my example to the Ev_AddConst macro
If the "Events" tab is not showing in your Project Explorer, you can add it via the "UI Trees" tab in Global Options.
Re: Flowcode document name
Posted: Thu Dec 04, 2025 3:26 pm
by Xbiotec
1- Create a global constant
what should be the name of the constant ?
Which kind of constant, String or other ?
6- Add code as per my example to the Ev_AddConst macro
If add by copy past the code, the local variables do not exist, so need to create one by one isn't ?
Re: Flowcode document name
Posted: Thu Dec 04, 2025 3:53 pm
by Steve-Matrix
The constant is a string and should be called "MYFILENAME".
Yes, you will need to create the variables. The alternative is to export the macro from my project and import it into your project. This will retain the local variables, but you will need to manually link this to the AddConst event (double click the event and select the imported macro).
This all involves advanced use of Flowcode and many of these features (events and inbuilt functions) are typically only used when creating components.
We might add this feature to an existing Flowcode component (e.g. the "Auto Version Identifier" component), which will make it a lot easier to add to existing projects.
Attached is a very basic component that I've just created to allow this. The fcfx file is the source code and the fcpx file is the exported component. You should make this exported component available using the "Look for components in..." entry of Global Options. See here:
https://www.flowcode.co.uk/wiki/index.p ... #Locations
Re: Flowcode document name
Posted: Thu Dec 04, 2025 4:25 pm
by stefan.erni
Hi Seb, Hi Steve
Good idea and useful.
I have added the components to my program and am sending the filename to the iPhone via BLE.
It works very well.
printscreen Iphone:

- IMG_5372.PNG (59.47 KiB) Viewed 22 times
Re: Flowcode document name
Posted: Thu Dec 04, 2025 5:44 pm
by Xbiotec
Thx a lot Steve, it work's well