Macro parameter causes compile error issue

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Posts: 110
Joined: Thu Sep 29, 2005 10:53 am
Location: Matrix Multimedia
Been thanked: 1 time

Macro parameter causes compile error issue

Postby Ian » Mon Mar 06, 2006 11:12 am

If you have code that wont compile check the C Code for any errors.
(see previous posting for info on how to find C Code error lines)

One potential error is trying to pass a parameter to a macro function that doesnt take one e.g. "FCM_MyMacro(FCV_MyVar)".
It’s an easy one to fix, once you figure out what causes it.

To fix it simply delete the existing macro and replace it with a new macro that does the same thing.

I’ll show you how to replicate it as that will show you what the problem is.

Add a macro and point it to a component macro that takes a parameter such as the LCD macro PrintAscii with the parameter ‘55’.
Then edit the macro and point it to a user macro that doesn’t have parameters, such as a "Display" macro.
When you compile it you will get an error.
Basically the macro keeps the parameter and tries to pass that parameter to the new macro call. But as Display does not take a parameter it causes an error.

The C code looks like:

Instead of:

We have the bug on the fix list for the next version of Flowcode.