|
rafal Newbie
Joined: 26 Jun 2007 Posts: 7
|
Posted: Tue Jun 26, 2007 11:58 pm
[1.34] #va smth %replaceitem() question. |
Hi.
I've tried to replace same items from the list by doing:
#va smth %replaceitem("xxx yyy",3,@smth)
and whenever i do it all the white spaces in my stringlist disappear.
Does anyone know any solution? |
|
|
|
Fuego Ledrey Wanderer
Joined: 09 May 2007 Posts: 64 Location: Dustin Acres, California
|
Posted: Wed Jun 27, 2007 2:01 am |
Have you gotten the NEW v1.34?
I did:
Code: |
#VA smth {}
#ADDITEM smth {Do this}
#ADDITEM smth {And this}
#ADDITEM smth {Then this}
#ADDITEM smth {Next this}
#va smth %replaceitem("xxx yyy",3,@smth)
#show @smth |
And I got the desired result:
Quote: |
Do this|And this|xxx yyy|Next this |
EDIT: Cause I copied wrong. |
|
|
|
rafal Newbie
Joined: 26 Jun 2007 Posts: 7
|
Posted: Wed Jun 27, 2007 9:03 am |
I think I know what the problem is.
Try writing the same code but change the first line to
#VA smth 0
I looks like Cmud doesn't recognize it as a list anymore. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Jun 27, 2007 9:17 am |
I tried this code:
#var smth 0;#additem smth akgjakg;#show @smth
and it worked just fine. You must be doing something else. |
|
|
|
rafal Newbie
Joined: 26 Jun 2007 Posts: 7
|
Posted: Wed Jun 27, 2007 10:07 am |
#VA smth 0
#ADDITEM smth {Do this}
#ADDITEM smth {And this}
#ADDITEM smth {Then this}
#ADDITEM smth {Next this}
#va smth %replaceitem("xxx yyy",3,@smth)
#show @smth
This is exactly what i'm doing.
Thanks for a quick reply Fang Xianfu :) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Jun 27, 2007 11:20 am |
I vaguely remember a similar bug so perhaps it's already been reported, but the %replaceitem function is eating all the spaces in @smth, so I get the output "0|Dothis|xxx|Thenthis|Nextthis" even though the package editor GUI is showing spaces. It only does this if @smth contains a number when I start adding items. Is this the problem you mean?
|
|
|
|
rafal Newbie
Joined: 26 Jun 2007 Posts: 7
|
Posted: Wed Jun 27, 2007 12:59 pm |
Exactly :) I just got rid of the number and it works !
|
|
|
|
|
|