|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
|
|
|
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Mon Dec 21, 2009 1:11 pm |
Code: |
#lua {print(zs.var["<DB Record name>"]["<DB Record Key>"])} |
|
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Mon Dec 21, 2009 6:16 pm |
Good grief. I was trying zs.var.db["key"].
Thanks |
|
|
|
wrym Magician
Joined: 06 Jul 2007 Posts: 349 Location: The big palace, My own lil world
|
Posted: Mon Dec 21, 2009 7:55 pm |
Hmmm it would be possible to use the %db function from lua, but there is no reason, (and in fact would be slower). The zs interface is very nice and converts hash tables for Db records to ones compatible with lua. additional string lists become numerical keyed hash tables so there is no need to use %item.
|
|
_________________ "To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: Tue Dec 22, 2009 10:45 am |
I noticed it won't let me assign a value with zs.var["db"]["key"] = "blah blah".
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Jan 04, 2010 6:03 pm |
Well, it Lua should allow the above syntax, but it will only update the local Lua copy of the table and not the stored CMUD database variable. There is no way to intercept the above Lua assignment to cause CMUD to update the underlying CMUD variable. It's just a restriction in the way the Lua API is handled in CMUD.
|
|
|
|
|
|