diff --git a/Docs/src/compiler.but b/Docs/src/compiler.but index 0da640de..c4be5a45 100644 --- a/Docs/src/compiler.but +++ b/Docs/src/compiler.but @@ -274,13 +274,13 @@ Standard predefines that contain information about the current code scope. Defined in the global scope. \c Section test -\c !ifdef ${__GLOBAL__} +\c !ifdef __GLOBAL__ \c !error "this shouldn't be here!" \c !endif \c SectionEnd \c \c PageEx instfiles -\c !ifdef ${__GLOBAL__} +\c !ifdef __GLOBAL__ \c !error "this shouldn't be here!" \c !endif \c PageExEnd diff --git a/Include/StrFunc.nsh b/Include/StrFunc.nsh index dd045e7c..e4a09262 100644 --- a/Include/StrFunc.nsh +++ b/Include/StrFunc.nsh @@ -6,6 +6,15 @@ o-----------------------------------------------------------------------------o | -------------------------------| | | | This header file contains NSIS functions for string manipulation. | +| ---------| +| !include "StrFunc.nsh" / Example | +| ${Using:StrFunc} StrRep -----------| +| | +| Section | +| ${StrRep} $0 "Hello world!" "world" "everyone" | +| MessageBox mb_ok $0 | +| SectionEnd | +| | o-----------------------------------------------------------------------------o */ @@ -86,12 +95,15 @@ o-----------------------------------------------------------------------------o !define `${Name}` `!insertmacro STRFUNC_CALL_${Name} "${un}" ` !define `Un${Name}` `!insertmacro STRFUNC_CALL_${Name} "${un}" ` !else - !define `${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} ""` - !define `Un${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} Un` + !define `${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} "" #` + !define `Un${Name}` `!insertmacro STRFUNC_MAKEFUNC ${Name} Un #` !endif !macroend !macro STRFUNC_MAKEFUNC basename un + !ifndef __GLOBAL__ + !error "You forgot ${U+24}{Using:StrFunc} ${un}${basename}" + !endif !insertmacro STRFUNC_MAKEFUNC_${basename} !macroend