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
Siril
Newbie


Joined: 13 Jan 2005
Posts: 3

PostPosted: Sun Jan 23, 2005 7:03 am   

Parenthesis keep re-appearing!
 
Whenever I run this it puts paranthesis around it and I don't want it to :(.

#IF (@name = %1) {
#DELITEM arc_name @name
#ADDITEM arc_name |r|%1|c|
}

the || are used for color in the mud I play, when ever it goes off it puts () around @name, anyway to make this go away?
_________________
Sir1l
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Jan 23, 2005 11:38 am   
 
Around which @name does it put parenthesis? Does it still work with the parenthesis? Have you tried using %1 instead of @name in the #DELITEM?
_________________
Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jan 23, 2005 3:35 pm   
 
No, there isn't anyway to make this go away. This is how zMUD indicates nested lists.

| is the list-separator character which isn't changeable. When you include it in a list-item, that item becomes a nested list. You'll have to find some other way of sending color-codes to your MUD.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
morgair
Beginner


Joined: 10 Nov 2000
Posts: 24
Location: USA

PostPosted: Tue Jan 25, 2005 8:04 am   
 
#ADDITEM arc_name %replace (%replace (|r|%1|c| , ")", %null),"(",%null)

Try this. Im not familiar with nested lists but you might get lucky and no i didnt test it
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Jan 26, 2005 12:26 am   
 
The parentheses are added internally, Morgair, so you wouldn't be able to remove them via the %replace() functions in an #ADDITEM command. However, since for list variables the divider is literally a | and not a special, unprintable character like it is with DB record variables, you can just remove it yourself after the list has been added to.

Listname = %replace(%replace(@Listname,"(",""),")","")
_________________
EDIT: I didn't like my old signature
Reply with quote
Spartacus
Wanderer


Joined: 23 Apr 2001
Posts: 53
Location: USA

PostPosted: Mon Mar 07, 2005 10:42 pm   
 
Try this:

Code:

#IF (@name = %1) {
#DELITEM arc_name @name
#ADDITEM arc_name :r:%1:c:
}


Then to retrieve an item from @arcname use this:

Code:

#var xName {%replace(%item(@arc_name,@N),":","|")}


Now (assuming you set @N appropriately) @xName will be |r|%1|c|.

This is what I do every time I want to nest lists.
_________________
Spartacus
rm -rf .*
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Mar 07, 2005 11:44 pm   
 
It only puts the parenthesis around it when you expand the list as a regular variablelike #show @list;
When you retrieve it using the %item , or %pop function it returns the item just as you added it,with no parenthesis.
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
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