Macro calls

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Macro calls

Post by jadiflow »

Hi, I'n new to Flowcode, so please forgive me if I ask the obvious.

I have a Q about macro/subroutine calls. You can specify a parameter and a returned value. Is that particular parameter (variable?) automagically passed when I call the macro? Like it is a global variable?

What happens with the return value; how do I set the return value?

Thanks, Jan Didden

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Macro calls

Post by Steve »

A parameter is not like a global variable. You can access global variables in any macro. But you can only access parameters from inside the macro itself. The value you specify as the parameter to the macro call is copied into the parameter variable.

The return variable is set using a calculation icon in the macro. It is usually called something like <MyMacro.Return>.

I've written a quick example that will hopefully explain better. Just load it into Flowcode and set through the code.
MacroParams.fcf
Example using macro parameters and returns
(3 KiB) Downloaded 445 times

jadiflow
Flowcode v5 User
Posts: 273
Joined: Thu Apr 17, 2008 9:59 am
Has thanked: 19 times
Been thanked: 16 times
Contact:

Re: Macro calls

Post by jadiflow »

Steve, perfect! Thanks!

Jan Didden

Post Reply