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
Valkenar
Beginner


Joined: 12 Aug 2009
Posts: 15

PostPosted: Fri Apr 30, 2010 7:13 pm   

Storing Lua tables with embedded pipes [CMud Pro 3.16b]
 
CMud seems get confused if you have pipes in strings inside lua tables that you try to store in cmud variables

A lua table like
{"a|b","b|c"}

gets translated into
{{"a", "b"}, {"b", "c"}}

Here's some sample code:

Code:

<alias name="tester" language="Lua" id="28">
  <value>test = {"a|b","b|c"}
print('Correct:')
print(test)

zs.var.name = test
test = zs.var.name
print('Actual Result:')
print(test)
</value>
</alias>



Run the alias "tester" twice and you'll see the line that it should be followed by what it becomes after cmud translates it to and from a cmud variable.
Reply with quote
Zugg
MASTER


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

PostPosted: Fri Apr 30, 2010 8:03 pm   
 
That is correct. CMUD uses the a|b|c syntax for tables and it is converting Lua tables into CMUD string list tables and visa-versa. No way around this unfortunately at this time.
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