Push "My name is Afrow UK, and I love NSIS"
Push "4"
Call GetStringPart
Pop "$R0"
$R0 should now be "My name is Afrow UK," but it's not working.
I definatly had this script working before, and now it does not work at all.
Basically, it will clear the string from the start up to the space specified.
Function GetStringPart
Pop $R4
Exch $R0
Push $R1
Push $R2
Push $R3
StrCpy $R1 -1
StrCpy $R3 0
loop:
StrCpy $R2 $R0 1 $R1
StrCmp $R3 $R4 exit2
StrCmp $R2 "" exit2
StrCmp $R2 " " exit ; Change " " to "\" if ur inputting dir path str
IntOp $R1 $R1 - 1
Goto loop
exit:
StrCpy $R0 $R0 $R1
IntOp $R3 $R3 + 1
Goto loop
exit2:
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
Thats where the Push "4" comes in. It should reomve all of the string from the end up to the 4th space.
Can anyone see whats wrong with it?
-Stuart