|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun May 04, 2008 7:49 pm
[2.23] Quote problems with %word (old low priority) |
I remember reporting something about this before and I recall there was a fix made, but the specifics elude me right now. In any case %word gets really messed up when there are double-quotes within the text it is supposed to act upon.
Launch CMud, close Sessions window.
Enter at the command line
Code: |
$a=%concat(%char(34),"abc",%char(34),"|"%char(34),"def",%char(34),%char(34));#SHOW $a %word($a,1,"|") %word($a,2,"|") %word($a,1,"d") %word($a,2,"d") |
Displays
Quote: |
"abc"|"def"" abc def abc |"def"" |
The first group is what we built and just displays that it was built right. Next we see /abc/, the surrounding quotes have been stripped and that could be understandable. Next is /def/ and all the quotes are gone, if it was just stripping the surrounding quotes then the output should have been /def"/.
Using the /d/ as the word break we should expect the first word to be /"abc"|"/ or perhaps /abc"|/, most definitely not the /abc/ that is displayed. The final item displayed shows that it is not stripping the outer set of quotes, it is completely losing its place when double-quotes are contained in the string.
I haven't found any other functions with this type of problem, which definitely makes it a low priority. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon May 05, 2008 5:27 pm |
I'll add this to the bug list, but yes, it's a lower priority. Dealing with quotes is a very tricky problem. The %word command is trying to parse quotes so that if your word delimiter is within quotes, it doesn't split on that instance of it (like splitting on a space when you have a phrase within quotes that contains spaces).
In this case I am actually just calling a string routine from a 3rd party string library (the TurboPower Systools library), so I'd have to look at their source code to determine the problem and if it was something I can fix. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|