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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Fri May 05, 2006 8:34 pm   

Problem with unbalanced parens in a stringlist item
 
Take the following code:
Code:
#VAR xtest1 {test1}
#VAR xtest2 {test2}
#VAR xtest2 {%push( @xtest1, @xtest2)}
#SHOW {items: %numitems( @xtest2) %item( @xtest2, 1)}
#VAR xtest1 {"test1 :-)"}
#VAR xtest2 {test2}
#VAR xtest2 {%push( @xtest1, @xtest2)}
#SHOW {items: %numitems( @xtest2) %item( @xtest2, 1)}
#VAR xtest2 {test2}
#VAR xtest2 {%push( %quote( @xtest1), @xtest2)}
#SHOW {items: %numitems( @xtest2) %item( @xtest2, 1)}

When you run it, once you put an unbalanced paren into the stringlist, the stringlist variable xtest2 is no longer acting like a stringlist, even if you %quote() it:
Code:
items: 2 test1
items: 1 test1 :-)|test2
items: 1 test1 :-)|test2
Reply with quote
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Fri May 12, 2006 1:11 pm   
 
Curious that no one either confirmed the bug or pointed out my error yet.... comments?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri May 12, 2006 4:37 pm   
 
Zhiroc... you are right. This is a parsing bug. What happens is that when zMud converts it to a stringlist you get something like
Code:
test1 :-)|test2


When it reparses when you try to access it a again it sees the unmatched ')' and wraps the entire thing in parens like so
Code:
(test1 :-)|test2)


When this is redisplayed of course the out put is completely different because what was a 2 item list, is treated as one entity.

You can see this more clear if you define a StringList variable, switch it to text and then back list variable.

On the upside, with all the parsing corrections Zugg has made, I'm sure this won't be an issue any more.
_________________
Asati di tempari!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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