I've got a macro (lest say: Macro_1), and I've made a local variable .Return
In the macro, I set .Return to 0 if something didn't work, and to 1 when it ran successfully.
From what I've read the .Return should now be used globally to check if the macro ran successfully?
How can I check in another macro if the macro ran OK?
I want to check this returnvalue with a decision macro, should this look like this:
if Macro_1(.return) then?
How can I check in a decision of the macro returned a certain value?
Thanks!!
Use return from macro
Moderator: Benj
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: Use return from macro
The macro call will be the value. So
In a decision you just enter 'Macro_1()' for the 'if:'.
If your macro requires arguments (say 2) you enter 'Macro_1(1,"second")' or 'Macro_1(.var1, .var2)' if you want to pass the values of local var1 and var2.
Code: Select all
if Macro_1() then
If your macro requires arguments (say 2) you enter 'Macro_1(1,"second")' or 'Macro_1(.var1, .var2)' if you want to pass the values of local var1 and var2.
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Posts: 502
- Joined: Wed Nov 07, 2007 6:51 pm
- Location: Antwerp Belgium
- Has thanked: 121 times
- Been thanked: 108 times
- Contact:
Re: Use return from macro
Thanks for your advice! Again!kersing wrote:The macro call will be the value. So
In a decision you just enter 'Macro_1()' for the 'if:'.Code: Select all
if Macro_1() then
If your macro requires arguments (say 2) you enter 'Macro_1(1,"second")' or 'Macro_1(.var1, .var2)' if you want to pass the values of local var1 and var2.
I've tried this in a new flowchart and this works..
But when I try this in an existing flowchart I get the error that there are to few arguments.
The macro it refers to has a .Return which is set (according to it's success or failure), 0 or 1.
But in this case it doesn't work
The return value for the macro is set to "BOOL".
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
- Contact:
Re: Use return from macro
Have you checked if the macro checkRX() requires any parameters?
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis