|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Aug 09, 2008 4:36 am
[2.35] Variable = "" doesn't work as intended. |
I figured I'd clear out a variable and use variable="", but it no longer works.
1. #VAR testing {1|2|3}
2. #SAY @testing (It'll display 1|2|3)
3. testing=""
4. #SAY @testing (It'll display "")
Instead of clearing it out, it sets it to "" instead. Annoying indeed, because the next two steps create a slight problem.
5. #ADDITEM testing 1
6. #SAY @testing (It'll display |1)
As you can see, it counts the null as an item. There are two workarounds for this, though...
1. #VAR testing {} or #VAR testing ""
2. testing=%null()
It'd be nice if the old way worked again.
Charneus |
|
|
|
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
Posted: Sat Aug 09, 2008 4:57 am |
I've always used var=%null for this.
I never knew var="" ever worked. |
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Sat Aug 09, 2008 6:48 am |
Works fine for me.
|
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Sat Aug 09, 2008 1:19 pm |
Interesting...
On a related note and hoping this wouldn't derail this thread too much...
When you make a variable via PE, set it to String List and populate it with values, then on cmd line do "#va list %null" without the quotes
Then do "#va list", it shows it as a Autotype and not String List anymore.
Is this intentional?
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Sun Aug 10, 2008 6:33 am |
That's completely normal. You should read the help file for variable.
#va list %null is the same thing as list=%null. |
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Sun Aug 10, 2008 1:01 pm |
Fine. Until now though I believed that using %null clears the *content* of the variable, not the type of it. At least it seems reasonable for
it not to. I suppose I'll have to be more careful from now on under CMud when I use cmd line tactics such like this.
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
|
|