Archive: strcat :: I know it supposed to be easy but i just dont get it


strcat :: I know it supposed to be easy but i just dont get it
The documentation says

strcat
user_var(destination) str [maxlen] [start_offset]
Sets the user variable $x with str. Note that str can contain other variables, or the user variable being set (concatenating strings this way is possible, etc). If maxlen is specified, the string will be a maximum of maxlen characters (if maxlen is negative, the string will be truncated abs(maxlen) characters from the end). If start_offset is specified, the source is offset by it (if start_offset is negative, it will start abs(start_offset) from the end of the string).
Armed with this information i should be able to implement strcat .. but i just dont seem able to get it right. Can someone please help me and put me out of this misery!

; copy "hello" to $1
strcpy $1 "hello"

; copy "world" to $1
; the new string ($1) will be maxlen 10 chars long
; copy "world" starting at offset 5 in $1
strcpy $1 "world" 10 5

; its always empty... i was expecting $1=="helloworld"
MessageBox MB_OK $1


Please can somebody tell am i going wrong?

in your example it makes no sense to specify maxlen and offset.

you are probably looking for something like this

StrCpy $1 "hello"
StrCpy $1 "$1world"
MessageBox MB_OK "$1"

=> $1 is "helloworld"
StrCpy $1 "helloworld" 5 5
MessageBox MB_OK "$1"

StrCpy $1 "helloworld" "" -5
MessageBox MB_OK "$1"

=> $1 is "world"

Arghhh...

Thanks for that .. i was completely the wrong track