Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 25th March 2006, 22:57   #1
AmpMan2000
Guest
 
Posts: n/a
Cool Looping through the chars of a string

Hey all,

Lets say I have a string "abcd@#123", how can I loop through each character of this string and do some work with each char and then exit the loop after the last char?

Thanks
  Reply With Quote
Old 26th March 2006, 03:10   #2
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 665
code:
Name "Output"
OutFile "Output.exe"

Section
StrCpy $0 "abcd@#123"
StrCpy $1 0

loop:
StrCpy $2 $0 1 $1
StrCmp $2 '' end
IntOp $1 $1 + 1
#
MessageBox MB_OK '$$0={$0}$\n$$1={$1}$\n$$2={$2}'
#
goto loop

end:
SectionEnd

Instructor is offline   Reply With Quote
Old 26th March 2006, 07:01   #3
AmpMan2000
Guest
 
Posts: n/a
Works great, thanks so much Instructor!
  Reply With Quote
Reply
Go Back   Winamp 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