|
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: 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 |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Wed Aug 29, 2007 11:15 am |
Try #VAR portal "(123456)" instead?
|
|
|
|
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: 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?
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4690 Location: Pensacola, FL, USA
|
Posted: Wed Aug 29, 2007 12:20 pm |
normally parenthesis evaluate the contents... since its just an integer, there is nothing to evaluate
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
Zhiroc Adept
Joined: 04 Feb 2005 Posts: 246
|
Posted: 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)"
|
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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.
|
|
|
|
Zhiroc Adept
Joined: 04 Feb 2005 Posts: 246
|
Posted: 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. |
|
|
|
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: 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).
|
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: 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. |
|
|
|
|
|