 |
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: 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 |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jun 15, 2010 5:22 pm |
Confirmed. Although I'm a bit surprised that this worked in past versions of CMUD.
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
|
 |
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: 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.
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
 |
dbosst Apprentice
Joined: 15 Jun 2010 Posts: 121
|
Posted: 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.... |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jun 30, 2010 4:16 pm |
Not really the same issue, but I'll add it to the bug list.
|
|
|
|
 |
|
|
|