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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
DanteX
Apprentice


Joined: 13 Aug 2007
Posts: 166

PostPosted: Wed Aug 29, 2007 11:09 am   

[2.01] Paranthesis inside variables
 
I have this code:

Code:
#VAR portal {(123456)}


When I look in the settings editor for the content inside the variable, it shows

(123456)

But when I do

#SHOW @portal

It only shows 123456, meaning it skips the () around the number. The exact same code zMUD includes the parathesis', showing

(123456)

just like what's intended.

If I add "~" before the parathesis', it shows

~(123456~)

instead, so it's not working either.

D
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Wed Aug 29, 2007 11:15 am   
 
Try #VAR portal "(123456)" instead?
Reply with quote
DanteX
Apprentice


Joined: 13 Aug 2007
Posts: 166

PostPosted: Wed Aug 29, 2007 11:52 am   
 
Hmm, that worked. What is the difference between the ways of assigning? Making this a string instead of... what?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Wed Aug 29, 2007 12:20 pm   
 
normally parenthesis evaluate the contents... since its just an integer, there is nothing to evaluate
_________________
Discord: Shalimarwildcat
Reply with quote
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Wed Aug 29, 2007 7:28 pm   
 
Hmm, I tried the example, and #VAR portal {(123456)} worked for me just fine. What was the type of the variable in the settings editor? It should be "string(expanded)"
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Aug 30, 2007 12:18 pm   
 
I think that was the problem, Zhiroc. He was expecting "string (literal)" instead, which is why I recommended the use of the double quotes.
Reply with quote
Zhiroc
Adept


Joined: 04 Feb 2005
Posts: 246

PostPosted: Thu Aug 30, 2007 2:25 pm   
 
Perhaps, but string(expanded) works fine for me too. The parens don't get stripped. It seems like the type was probably getting set to Integer.

Having to use double quotes would be a bug, because you might want a to do #VAR portal "(%1)" which wouldn't work.
Reply with quote
DanteX
Apprentice


Joined: 13 Aug 2007
Posts: 166

PostPosted: Thu Aug 30, 2007 3:42 pm   
 
I don't know what I had from the start, but now it works with both string(literal) and (expanded).
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri Aug 31, 2007 11:37 am   
 
Zhiroc wrote:
Having to use double quotes would be a bug, because you might want a to do #VAR portal "(%1)" which wouldn't work.


What you would do then is #VAR portal "("%1")", so it's not a bug at all.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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