Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
GeneralStonewall
Magician


Joined: 02 Feb 2004
Posts: 364
Location: USA

PostPosted: Sat Oct 20, 2007 5:05 am   

Having trouble with some syntax
 
So I have an alias that adds an item(%2) to a list(list) in a database(%1) and I'm having some trouble. This syntax worked in zmud but I'm having trouble figuring it out in cmud:

#additem %1.list {%2}

or

%1.list = whatever

I've tried various things, a few crashing cmud altogether. Any suggestions?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sat Oct 20, 2007 5:38 am   
 
The problem is implicit concatenation - you're not telling CMUD where the variable part of the name ends and the string begins. Use %concat to put them together explicitly.

I'm not sure how additem handles having a data record key as the name, either. An alternative would be something like

#addkey %1 list %additem(%2,@{%concat(%1,".list"})
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Sat Oct 20, 2007 11:21 am   Re: Having trouble with some syntax
 
GeneralStonewall wrote:
I've tried various things, a few crashing cmud altogether. Any suggestions?

If you can manage to write a procedure for something that crashes cmud a bug report would be very much appreciated.
_________________
Taz :)
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Oct 22, 2007 5:44 pm   
 
Currently the commands like #ADDITEM can only take the name of a variable as it's first argument. You can do something like

#additem var.list item

since "var.list" is not the simple name of a variable. This is one of the things that I am working on adding in the beta versions. And yes, the syntax:

var.list = whatever

currently has trouble as well. In general, nested lists and lists within database items do not work very well.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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