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
yorcadon
Beginner


Joined: 11 Jun 2009
Posts: 16

PostPosted: Mon Aug 02, 2010 6:19 pm   

Subtracting from all database values
 
I'm using 3.22. This used to work fine but after updating a few new beta releases at once it has a problem.

I need to subtract 1 from all values in a database.

Code:
#LOOPDB @Database {Database.%key=%val-1}


This still seems to work unless the database key contains more than one word.

So in a database where

blah1 = 10
test1 test2 = 10

the above code changes it to

blah1 = 9
test1 test2 = 10
test1 = 9

So its only taking the first word from the key.
I am looking for a way to fix this, any suggestions?
Thanks.
Reply with quote
yorcadon
Beginner


Joined: 11 Jun 2009
Posts: 16

PostPosted: Mon Aug 02, 2010 6:54 pm   
 
So I found an alternative that seems to work fine.

Code:
#LOOPDB @Database {#ADDKEY Database %key (%val-1)}


That seems to do the trick. Not sure why I didn't just do that before.
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Aug 03, 2010 4:39 pm   
 
Please post all BETA issues in the BETA forum. The issue with multi-word keys is a known bug already posted in the beta forum.
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