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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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
Reply with quote
Caled
Sorcerer


Joined: 21 Oct 2000
Posts: 821
Location: Australia

PostPosted: 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
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Sat Aug 09, 2008 6:48 am   
 
Works fine for me.
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: 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
--------------------------------
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: 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.
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: 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
--------------------------------
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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