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
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Tue Jun 15, 2010 6:36 am   

[3.19d] BUG: #delitem db.%key syntax not working.
 
In the following script, #delitem {testvar.%key} isn't evaluating the value of %key but treating it as as literal. The solution to this would be to use %concat, but I would think this way should work as well.

Code:
Code:
testvar = %null
#addkey testvar list {one|two|three|four|five|six}
#print ""
#print {Printing testvar:}
#showdb @testvar
#print {Deleting all items in each list}
#loopdb @testvar {
  #forall %val {
    #delitem {testvar.%key} %i
    }
  }
#print {Printing testvar:}
#showdb @testvar


Output:
Quote:
Printing testvar:
list: one|two|three|four|five|six

Deleting all items in each list
Printing testvar:
list: one|two|three|four|five|six
%key:


Last edited by GeneralStonewall on Wed Jun 16, 2010 12:43 am; edited 1 time in total
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Jun 15, 2010 5:22 pm   
 
Confirmed. Although I'm a bit surprised that this worked in past versions of CMUD.
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jun 16, 2010 12:25 am   
 
Well, looks like this *didn't* work in past versions of CMUD either. But I think I've got it fixed for the next update. Try to mention in the future if this is something that worked and suddenly broke vs something that "should work" but never has.
Reply with quote
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Wed Jun 16, 2010 12:31 am   
 
IIRC, in previous versions I was using #var {db.%key} %delitem( %i, @db.%key). This would be the simplified form of that; Hence, why I assumed it was a bug. Sorry for the confusion.
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jun 16, 2010 12:42 am   
 
Yep, that would make sense. The #var command in older versions was specially kludged to handle the db.%key syntax. None of the other commands (like #delitem) could handle that syntax directly.

This is now fixed for the next update.
Reply with quote
dbosst
Apprentice


Joined: 15 Jun 2010
Posts: 121

PostPosted: Wed Jun 30, 2010 3:54 am   
 
Related to this, I think this just broke recently.. Using 3.21

#delitem and #additem for:

#delitem %1.keys nesteditem

if %1 is the database variable name and keys is a record name, it is supposed to delete the nesteditem from the keys record

this no longer works... have to use concat on %1....
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Jun 30, 2010 4:16 pm   
 
Not really the same issue, but I'll add it to the bug list.
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