Marcos don't have params (beside those would probably be in parenthesis, which would render them mood).
That's a pitty... I didn't think macros could be embedded. Good to know, thanks for the tip.
But why doesn't Free Pascal support macros with parameters? Haven't had time to implement them yet or for some other reason? They are very useful, especially for creating various constructions useful for debugging.
Use MacPas mode if you're so desperate for it.
I'm not desperate. I just don't like this construction, and if I don't like something, I'm looking for a way to change it and make it easier for me to work with the code.
I have a question for you. You suggest using the
{$MODE} switch, but it not only adds return, it also changes other language constructs. However, for example,
{$MODE MACPAS} does not allow me to use
{$INCLUDE}, because it must be
{$I} (short version, why?).
Does it work in such a way that the
{$MODE} switch gives the same as a set of different
{$MODESWITCH} and instead of
{$MODE} you can just manually unlock and lock specific language features with multiple
{$MODESWITCH}? If that's true, meaning instead of
{$MODE}, you can specify everything yourself with a set of multiple
{$MODESWITCH}, then that would be fine with me — I know which features I want to use and which ones I don't need.
exit(x) can usually - always - be avoided by altering the code flow slightly.
Yes, it can, but in the case of sequential code that needs to set a specific result in many places and exit the function immediately, the
exit(x) or
return x construct is very convenient. Not only does it allow one instruction to do two things (set the result and exit the routine), and thus avoid creating unnecessary
begin ends, it also allows to avoid long and repeatedly embedded blocks of conditional statements.