Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
rafal
Newbie


Joined: 26 Jun 2007
Posts: 7

PostPosted: 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?
Reply with quote
Fuego Ledrey
Wanderer


Joined: 09 May 2007
Posts: 64
Location: Dustin Acres, California

PostPosted: 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.
Reply with quote
rafal
Newbie


Joined: 26 Jun 2007
Posts: 7

PostPosted: 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.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
rafal
Newbie


Joined: 26 Jun 2007
Posts: 7

PostPosted: 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 :)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
rafal
Newbie


Joined: 26 Jun 2007
Posts: 7

PostPosted: Wed Jun 27, 2007 12:59 pm   
 
Exactly :) I just got rid of the number and it works !
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net