Archive: WordReplace not working


WordReplace not working
Hi, I had used word replace to replace a word in a file but the word in the file is not changing to the replaced word and when i use a message box after the word replace method, i could got the replaced word. What could be the problem and how to solve it??

Example:

${StrReplace} $0 "%111" "bmp" "$R2"
;$R2 = <this>%111</that>
;$0 = <this>bmp</that>

${WordFind} "$0 " "</" "+1" $R3
${WordFind} "$R3 " ">" "-1" $R3
;$R3 = bmp
MessageBox MB_ok "$R3"
;$R3 = bmp

${IF} $R3 == 'bmp'
MessageBox MB_ok "correct"

The message box "correct" could not appear at all.


Hi alstom!

I think [1] is better for this task.


StrCpy $R3 "<this>bmp</that>"
${WordFind2X} "$R3" "<this>" "</that>" "+1" $R3
MessageBox MB_ok "$R3"
; output: bmp


[1] http://nsis.sourceforge.net/Docs/AppendixE.html#E.3.4

Cheers

Bruno

thy 4 e help. i am able to do a replace in the file now.