Reply To: How to correctly pass values to UI macros?

Home Forums Problems and solutions in GDL Graphical UI and parameters list How to correctly pass values to UI macros? Reply To: How to correctly pass values to UI macros?

#4456
Péter Baksa
Keymaster

Hi,

This works like in other languages’ function calls, just without the parentheses.
To pass a parameter to a macro, use parameters all, or set it explicitly: call "macro" parameters p = p, .... The called macro’s unset parameters will be initialized to their default values visible in the parameter list.
A macro doesn’t know about its caller’s parameters, so if it doesn’t have one, it can’t be passed further, and the lower macro’s parameter will be again initialized to its default value in the lower macro.
So all the intermediate macros have to have the parameters that you are passing to the furthest one, and they have to be set in each macro call.

Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE