Prev Previous Post   Next Post Next
Old 14th January 2011, 13:56   #1
isawen
Junior Member
 
Join Date: Jan 2010
Posts: 39
Question macro with parameters

Hi guys,

I would really appreciate your help over this issue I have.

I have a macro with 2 parameters like below:

PHP Code:
!macro TestMacro _PARAM1 _PARAM2
Push 
$1
StrCpy 
$1 $OUTDIR
// ... do some stuff here with the ${_PARAM1} and ${_PARAM2}
SetOutPath $1
Pop 
$1
!macroend 
The problem is that when I call it like this:
PHP Code:
${TestMacro} $$
inside the macro the ${_PARAM1} gets set to the $OUTDIR.

Is there a way to avoid this kind bad macro usage, beside:

PHP Code:
!macro TestMacro _PARAM1 _PARAM2
!define LastKnownOutDir $OUTDIR
// ... do some stuff here with the _PARAM1 and _PARAM2
SetOutPath ${LastKnownOutDir }
!
undef LastKnownOutDir 
!macroend 
Many thanks in advance,
Isawen

isawen is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump