Prev Previous Post   Next Post Next
Old 29th March 2003, 19:18   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
New Function

Usage:
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.

code:

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



Basically, it will clear the string from the start up to the space specified.
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
Afrow UK is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump