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


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Nov 25, 2006 11:40 pm   

[1.16] Database Variable problems.
 
Doing this to reference a variable.

@class/datavar.keyname

No longer works. It gives the unmatched braces error we all know and love Confused

@datavar.keyname
works fine

Assigning a value to a key via.
class/datavar.keyname = value

Just echos the text to the screen.

datavar.keyname = value
works fine
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Nov 27, 2006 7:34 pm   
 
Actually, the correct syntax is:

@/class/datavar.keyname

You need the / after the @ character.
Reply with quote
The Raven
Magician


Joined: 13 Oct 2000
Posts: 463

PostPosted: Mon Nov 27, 2006 11:23 pm   
 
What if the class is a subclass? For example:

Code:
Foo
  Bar
    Baz


If Baz is unique, can I refer to it via @/Baz/Var, or do I need to refer to it as @/Foo/Bar/Baz/Var? Like the above poster, I assumed that the initial / was optional, and used to force the classpath to the root of the module. I thought that @/Baz/Var would create a new class called 'Baz' right in the root.
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Nov 27, 2006 11:42 pm   
 
Hmm, yes, Raven is correct. The initial / specifies the root class, so @/Baz/Var would create a new class called "Baz" in the root. If the current class is already "Bar", then you should be able to use @Baz/Var to access a variable in the Baz subfolder.

So I stand corrected...looks like a bug in the parser. The routine that splits the classname (path) from the variable name seems to be handling all of this correctly. It's just a matter of getting the parser to understand the correct syntax. I'll put it on 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