I have code that works fine in the Lua test window, UI5. But an implementation file using roughly the same code fails to parse at load time. The thing I suspect it that I need to pass a quoted string withing the string passed to os.execute(). In the test window, I get away with setting a local variable like so:
local cookie = ‘“blahblahblah”’
And concatening that into the longer string to be fed to os.execute(). I think these strings-within-strings are what’s tripping up the parser. Is there a way to do this that is XML-safe? In C, Perl, etc you just load up with \ until it’s right. I doubt that works for Lua or Lua-within-XML.
–Richard
Normally within implementation .xml files, the only issues are with ‘<’ and ‘>’ and ‘&’ which should be escaped with ‘<’ and ‘>’ and ‘&’.
The easiest way for nested strings in Lua is to use the long string syntax like so:
x = [[ This is a string "with different types" of 'quotes' within it ]]
Not sure if this would solve your problem, but without a more specific example, it’s hard to tell.
[quote=“akbooer, post:2, topic:189460”]Normally within implementation .xml files, the only issues are with ‘<’ and ‘>’ and ‘&’ which should be escaped with ‘<’ and ‘>’ and ‘&’.
The easiest way for nested strings in Lua is to use the long string syntax like so:
x = [[ This is a string "with different types" of 'quotes' within it ]]
Not sure if this would solve your problem, but without a more specific example, it’s hard to tell.[/quote]
The problem was simple: and ampersand was biting me in the nether regions. I still have other things to solve, but Vera is now loading my I-file, so debugging can commence.
–Richard
Many of the Vera Configuration files wrap LUA with XML.
But that causes probems. That’s why many folks move the LUA to a separate LUA code module and have minimal amount of code in XML configuration files.
This includes the STARTUP Lua and the LUA for scenese. These are all internally wrapped in XML.
It’s best to put all of your code in an LUA module, Load the LUA module from LUA Startup … and then call the code from various places.
Of course this requires that you know about global/local scope … and other LUA language features.
There are many writeups on the forum to do this … I know I have done at least two and will NOT do another.