Archive: Simple string concatenation question....


Simple string concatenation question....
I am trying to do something very simple...chop off the last 4 characters of a string (basically get a file name without the extension).

$1 is the initial value (e.g. "MyLibray.dll" -> want to change it to just "MyLibrary")

;chop of the ".dll" at the end - required for uninstall to work
StrLen $2 $1
IntOp $3 $2 - 4
StrCpy $4 $1 $3
StrCpy $1 $4

However, at the end $1 is still the same value it was...what am I messing up here? :(


StrCpy $R0 $R0 -4

?

-Stu


That code works fine for me. If I initialize $1 with "blah.dll", I get "blah". The problem must be in another place of the code.

BTW, you can simply use the following to remove the last 4 characters:

StrCpy $1 $1 -4