user macro .return

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

user macro .return

Post by saschech@gmx.de »

Hello

1.If I have in a user macro a "return variable an " , all time show " an" 0x00.....dont work
2.After close and reopen v5,locale variablen (.return) in the debug-window are loost...
Both points are working in V4 ok
Regards Wolfgang
Attachments
FlowCode-v5_001.fcf
(23.91 KiB) Downloaded 272 times

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: user macro .return

Post by JonnyW »

Thanks Wolfgang - I will take a look tomorrow. I hope this doesn't cause too much concern when you are debugging. I assume this is only for the .return variable and all other locals are being reported OK.

Jonny

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: user macro .return

Post by saschech@gmx.de »

Hello Jonny

Unfortunately I must tell you,after test again , with lokal : return, Parameters,constants and variable;
(point 2. loost after..) refer for all four lokal types.

Have a nice evening wolfgang

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: user macro .return

Post by saschech@gmx.de »

Hello Jonny

Do you have any idea what going wrong the value of the return variable all times 0 ?

Point 2. with these i can live.......

Regards Wolfgang

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: user macro .return

Post by JonnyW »

Hi Wolfgang.

I am having problems replicating your issue.
returnvalue.png
Return set for int
(16.97 KiB) Downloaded 3463 times
returndemo.fcf
Demo used in screenshot
(11 KiB) Downloaded 293 times
Can you post an example program replicating this issue and I can look into it?

Cheers,

Jonny

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: user macro .return

Post by saschech@gmx.de »

Hello Jonny

V4 work a different way as V5:

V5 : If the red bevel mark "end icon" (inside the call macro) >> one more "step into" >> red bevel mark "Call Macro" in the main,without change the variable >> one more "step into" the value have the correct value oh oh............

V4 : If the red bevel mark "end icon" (inside the call macro) >> one more "step into" >> red bevel mark the next icon in the main,and the value change.

consequence : no error

but point 2. exist real.

Regards Wolfgang

User avatar
JonnyW
Posts: 1230
Joined: Fri Oct 29, 2010 9:13 am
Location: Matrix Multimedia Ltd
Has thanked: 63 times
Been thanked: 290 times
Contact:

Re: user macro .return

Post by JonnyW »

Hi. No probs. v5 works differently to v4 as it tries to tie in more closely with what you would see on the chip.

On the chip, when you call a macro the returned value is stored in a temporary location (in a register or on the stack). Only once you return from the function does the program copy the temporary value into your destination variable. As this is technically 2 separate stages v5 shows these if you single-step. This is how most debuggers behave.

I will ensure that local variables are remembered correctly across saves in future Flowcode revisions. I hope this is only a cosmetic issue and not too much of a problem for you.

Jonny

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: user macro .return

Post by saschech@gmx.de »

Hello Jonny

Thank`s for answer,i understand

Have a nice time wolfgang

Post Reply