Archive: call Function ReplaceOnLine several times


call Function ReplaceOnLine several times
Hi,

I'm using Afrow's nice function to replace words in a specific line. The function is in the archive at:

http://nsis.sourceforge.net/archive/...php?pageid=381

But when I need to replace several words in one section I get an error, because I need to call the function several times. I packed the function into a macro which I can call like:

!insertmacro ReplaceOnLine LINE FILE TOREPLACE REPLACEWITH

Compiling the script I get an error message

Error: label "Top:" already declared in section/function

and then the script fails.

Does someone have an idea how I can replace several words in one section of the installer?

Another (minor) problem of the function is that it will not work when the word occure more then once on the line.

Looking forward to hear your ideas.

Best regards
Peter


Does someone have an idea how I can replace several words in one section of the installer?
Function LineFind + Function WordReplace
http://forums.winamp.com/attachment....postid=1570443

!include "TextFunc.nsh"
!insertmacro LineFind
!include "WordFunc.nsh"
!insertmacro WordReplace

Section
${LineFind} "input.file" "output.file" "1:-1" "LineFindCallback"

IfErrors 0 +2
MessageBox MB_OK "Error"
SectionEnd

Function LineFindCallback
${WordReplace} '$R9' ' ' '_' '+*' $R9
${WordReplace} '$R9' '123' '321' '+' $R9

Push $0
FunctionEnd