|
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: 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? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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"}) |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: 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 :) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
|
|