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
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sun Dec 02, 2007 2:26 pm   

[2.14] #ADDITEM/#ADDKEY and #IF with local var
 
For some reason when a local variable has its contents set by #ADDITEM it fails this non null test
Code:
$Used=""
#ADDITEM $Used {some}
#IF ($Used) {
 #SHOW Passed if $Used
} {
 #SHOW Failed if $Used
}
It continues to fail with multiple #ADDITEMs. Setting a value other then "" initially works unless the variable gets set to null along the way. An expression of $var!="" does work, so it is just the non expression.

This also fails
Code:
$USED="";#ADDKEY $USED {test} {Tesy};#IF ($USED) {#SHOW yes} {#SHOW Failed $USED}
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Dec 02, 2007 8:08 pm   
 
Confirmed.
_________________
Asati di tempari!
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Mon Dec 03, 2007 4:26 pm   
 
We can also add #RESULT to the commands that get a null value returned after #ADDITEM.
Code:
<func name="DirConvert" type="StringList" id="16">
  <value>#IF ($dir="") {
 #SHOW Error in DirConvert: null direction passed
 #RETURN ""
}
$Res=""
#FORALL $dir {
 #ADDITEM $Res {%reversedir(%reversedir(%exec(%concat(%pref(iMoveChar),%i))),1)}
}
#SAY $Res
#RESULT $Res</value>
  <arglist>$dir</arglist>
</func>
Drop that function in then enter at the command line
Code:
#SHOW @DirConvert("h|j|k|l")
You will see the #SAY can get the value, but #RESULT can not. That makes this not a problem in #IF.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Dec 03, 2007 6:48 pm   
 
Added to bug list as two separate bugs since I'm not sure they are caused by the same problem yet.
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