WINAMP.COM | Forums > Developer Center > NSIS Discussion > Converting a String ($INSTDIR) from back to forward slash ( \ -> / ) |
Last Thread
Next Thread
|
| Author |
|
|
Pomflain Member
Registered: Aug 2001 |
Look at the utility functions.
Look at the example for parsing $CMDLINE parameters. Instead of delimiting by ' ', just scan until you hit the \ and then do a strcat. Like this: __________________ |
||
|
|
|
Smile2Me Saves you... (Alumni)
Registered: Nov 2001 |
Since I guess that there will be multiple '\' that need to be replaced, just scan the complete string character by character and replace if recessary will be more easy than waiting with copieng till a '\' is encountered. But that's just my guess. Otherwise you will have a loop with two possibilities and a lot of jumps. With this solution you just copie each character to a new string unless it's equal to '\'.
__________________ Last edited by Smile2Me on 04-02-2002 at 02:23 PM |
||
|
|
|
Smile2Me Saves you... (Alumni)
Registered: Nov 2001 |
I generalized the ReplChar function to a StrReplace function that replaces any substring by an other string. The statement above was not correct, the previous function only worked for substrings of length 1. That was sufficient for your problem. The new function can take substrings of any length. But anyway, take a look at the general function. I guess more people will like this one...
__________________ |
||
|
|
|
amitchel_us Junior Member
Registered: Apr 2002 |
That's terrific. It just clicked into place once I saw how you used labels for the loops. I had no idea. Thanks for the cleverness. |
||
|
|
|
Smile2Me Saves you... (Alumni)
Registered: Nov 2001 |
Thx for the nice words __________________ |
||
|
|
|
treaz Member
Registered: Jan 2003 |
Hi, |
||
|
|
|
Smile2Me Saves you... (Alumni)
Registered: Nov 2001 |
Read this: __________________ |
||
|
|
|
Last Thread Next Thread
|
WINAMP.COM | Forums > Developer Center > NSIS Discussion > Converting a String ($INSTDIR) from back to forward slash ( \ -> / ) |
Forum Rules:
|