Value lost after macro call

For Formula Flowcode Micromouse users to discuss projects, flowcharts, and any other issues related to the Formula Flowcode Micromouse.

Moderator: Benj

Post Reply
User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Value lost after macro call

Post by Jan Lichtenbelt »

I use a floating point variable ALPHA. It gets a value and the next step is a macro call with input this variable ALPHA. In this macro this input variable does not change value.
Flowcode simulations shows after ending this macro that the value of ALPHA has been lost (=0). Moreover, this program does give a general C-translation error.

What is wrong?


Jan Lichtenbelt
Attachments
Store_fractional_number.fcf
(11.73 KiB) Downloaded 559 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Value lost after macro call

Post by Benj »

Hello Jan,

Right I found the problem. It was because the Alpha variable was being used in the return box for the Frac_To_Bytes macro call. Even though the box was greyed out the simulation was still trying to return to that variable. I have edited the macro call so that the greyed out return box is now empty and the program seems to be behaiving correctly now.

Compilation is now working correctly too.
Attachments
Store_fractional_number.fcf
(11.72 KiB) Downloaded 561 times

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Value lost after macro call

Post by Jan Lichtenbelt »

That was a difficult one.

Thanks a lot

Jan

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Value lost after macro call

Post by Jan Lichtenbelt »

Dear Ben,

I meet this problem again. I tried to copy the wrong macro into a new one, but with the same grey area with variable name in the output macro. How do I get rid of it? How did you manage that?

Jan Lichtenbelt

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Value lost after macro call

Post by Benj »

Hello Jan,

We are looking into resolving this problem. For now you will have to change the macro call for a call that does have the paramater. You can then delete the text in the parameter while the box is not greyed out and then you can switch the macro call back.

Post Reply