Given the Macro definition (which I suspect is more or less irrelevent)
{$definec Assert(b) AssertCode((b), __FILE__, __LINE__)}
The line:
Assert( overwrite_folder in [FOF_Merge, FOF_Overwrite] );
Gives the error:
macro `Assert' used with too many (2) args
Adding a bracket to the assertion call:
Assert( (overwrite_folder in [FOF_Merge, FOF_Overwrite]) );
Resolves the problem.
I guess it could be argued that there are two parameters
"overwrite_folder in [FOF_Merge" and "FOF_Overwrite]"
but clearly the macro code is handling () bracketing, should it also handle [] bracketing perhaps?
Thanks, Peter.
Peter N Lewis wrote:
Given the Macro definition (which I suspect is more or less irrelevent)
{$definec Assert(b) AssertCode((b), __FILE__, __LINE__)}
The line:
Assert( overwrite_folder in [FOF_Merge, FOF_Overwrite] );
Gives the error:
macro `Assert' used with too many (2) args
Adding a bracket to the assertion call:
Assert( (overwrite_folder in [FOF_Merge, FOF_Overwrite]) );
Resolves the problem.
I guess it could be argued that there are two parameters
"overwrite_folder in [FOF_Merge" and "FOF_Overwrite]"
but clearly the macro code is handling () bracketing, should it also handle [] bracketing perhaps?
Indeed, our macro processor behaves in a C compatible way in many regards, including this one. As I plan to rewrite the preprocessor, this would be an opportunity to change some things.
Would anyone see problems handling [] like ()? Of course, it would prevent macro calls with unbalanced [, ], but who needs that ...?
Frank