Supplementary Code

From Flowcode Help
Jump to navigationJump to search
See C Code Icon Properties

What is Supplementary Code

Flowcode is often used by C programmers as a method of managing their code and allowing less experienced team members to take advantage of more complex C or Assembly code routines. If you have blocks of C or Assembly code that contain routines, definitions, lookup tables, etc. that you need to call later in the program then you should use this feature. This is an advanced feature that requires an understanding of C or Assembly language.


Definitions and function declarations

The first section, Definitions and function declarations, is added at the beginning of the C Code to allow users to add in defines, includes, function declarations and any other initialization code needed. This section is placed at the beginning of the generated C file to allow the code to be visible to all parts of the program.


The second section, Function implementations, allows for the addition of the main function code.


The code is split into these two sections to allow every Flowcode macro to use any of the supplementary functions defined, and to allow these supplementary functions to use any user or component macros that exist in the Flowcode program. It also ensures that supplementary functions can call other supplementary functions.


Warning: If Flowcode fails to compile you may need to examine the supplementary code for errors.

Adding Supplementary Code

Supplementary code.png

To add supplementary code to your program, go to Build >> Project Options then go to the General Options tab to find a tick box there that says "Use supplementary code".

Ticking this box will activate the button below, then clicking on this button will take you to the Supplementary Code window.

From there you can add in any definitions or function declarations into the top box provided. In the lower box you can put any functions you defined above into the Function implementations box.