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
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Thu Nov 30, 2006 9:44 pm   

[1.17] DB Records, digits as keys
 
Code:
#unvar testvar
testvar.one = 1
testvar.two = 2
#SHOWDB @testvar

correctly outputs:
Quote:
Variable testvar removed.
one: 1
two: 2


but
Code:
#unvar testvar
testvar.1 = one
testvar.2 = two
#SHOWDB @testvar

outputs:
Quote:
Variable testvar removed.
one|two:


something odd when the key is a digit?
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu Nov 30, 2006 11:44 pm   
 
Personally, I think it's not a bug but a fix to a zMUD kludge. It could go either way, I guess. The var.# syntax is more useful for finding elements in a string list or array. If you use #ADDKEY to make number keys, it works just fine.
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Thu Nov 30, 2006 11:53 pm   
 
I agree, the var.# would be the more useful of the two, so you can easily reference the nth item of an arrary etc.
var.# is what's broken though ;)
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Dec 01, 2006 12:00 am   
 
This is not a bug. The var.# syntax is used for setting and retrieving elements of a string list or array, as Larkin said. This is by design. If you want to use numeric keys in a database variable, you have to use #ADDKEY to set them, and %db to retrieve them.
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