JohnChen
16th May 2011 15:10 UTC
A question regarding the syntax how to call a function
For some functions, for example, GetFileName, I need to call it like ${GetFileName}. But for other functions, for example, CopyFiles, I can simply call it like CopyFiles. Why'd we have such a difference in calling a function? Thanks.
Afrow UK
16th May 2011 17:03 UTC
It's a defined constant. It's a hack to make it like a function, but really it's just inserting !insertmacro GetFileName ... (i.e. !define GetFileName `!insertmacro GetFileName`). Look in the include files.
Edit: In fact that's another reason I've been working on the NSIS assembler which has C-like syntax for built in functions, user functions and macros (see sticky topic).
Stu
JohnChen
16th May 2011 17:26 UTC
Originally posted by Afrow UK
It's a defined constant. It's a hack to make it like a function, but really it's just inserting !insertmacro GetFileName ... (i.e. !define GetFileName `!insertmacro GetFileName`). Look in the include files.
Edit: In fact that's another reason I've been working on the NSIS assembler which has C-like syntax for built in functions, user functions and macros (see sticky topic).
Stu
So GetFileName is just a macro. Then it makes sense. Thanks for your explaination!