the StrLoc macro in StrFunc can search backwards, but how can it find the last occurence?
I'm trying to find the last backslash on this path
c:\profiles\nikos
${StrLoc} $0 $PROFILE "\" "<"
$0 == 14!! (first backslash)
thanks
strloc in reverse
4 posts
actually, StrLoc can't search backwards... the > vs < is just the direction counter. You'll want to use StrStrAdv or so...
( might be something up in the wiki already anyway )
Or write your own function.. would be smaller 🙂
${StrStrAdv} $0 $1 "\" "<" "<" 0 0 1
StrLen $0 $0
( might be something up in the wiki already anyway )
Or write your own function.. would be smallerthat's what i did, copied parts of GetParent 🙂
Or there's all types of word find functions includes as part of the WordFunc.nsh header.
See Appendix E of the NSIS help.
See Appendix E of the NSIS help.