Skip to content
⌘ NSIS Forum Archive

Calling macro with double-quote as parameter

6 posts

davidnewcomb#

Calling macro with double-quote as parameter

I am trying to call a macro where one of the parameters is a double quote (").

The compiler is rejecting the
!macro WordFindFixedCall STR DEL COL RET
  ${WordFind} "${STR}" "${DEL}" "${COL}" ${RET}
  StrCmp "${STR}" "${RET}" 0 +2
  StrCpy ${RET} ""
!macroend 
Tried:

${WordFindFixed} $2 $\" "+2" $0
${WordFindFixed} $2 '$\"' "+2" $0
${WordFindFixed} $2 "$\"" "+2" $0 
But the compiler complains that there are too many parameters:
Creating NSIS installer
!insertmacro: macro "WordFindCall" requires 4 parameter(s), passed 5!
Error in macro WordFindFixedCall on macroline 1
!include: error in script: "setup_custom_pages_functions.nsh" on line 276
Error in script "installer/setup.nsi" on line 783 -- aborting creation process
Result: 1

Any ideas how I can pass in a double-quote?
jeffadams78#
When you wrap it in single quotes in the call to the macro ['"'], inside the macro it will be back to just ["]. So in the macro where you use the value it would also need to be wrapped in single quotes.

${WordFind} "${STR}" '${DEL}' "${COL}" ${RET}