[NTG-context] Ctx goes into infinite loop?

Lukáš Procházka LPr at pontex.cz
Sun May 25 13:33:35 CEST 2014


I solved the problem.

I was "requiring" a Lua .dll at some place in Ctx \s...luacode, namely LuaXml_Lib.dll.

I didn't realize that Ctx found the lib, but that have been compiled for Lua 5.1.

So, with my "ancient" Ctx version (5/2012, which I've been using often so far), all worked well as LuaXml_Lib was compatible with that version of Ctx.

Once I tried the latest Ctx beta, there was a failure;
and it appeared like "cannot locate file ... " error.

I built a Lua 5.2 version of LuaXml_Lib and all works well now with the latest Ctx.

- If some interested why I'm using LuaXml_Lib with Ctx, when Ctx provides its own XML API,
the reason is that I often save Excel tables as "Excel XML table" to allow Lua scripts access them, especially I'm using Excel "named regions/variables" which are later transformed into Lua tables.
I need an independent XML tool for this; LuaXML_Lib (http://viremo.eludi.net/LuaXML) does the job.

And also I need to do similar things with Ctx;
thus I need LuaXML_Lib to be accessible from within Ctx.

- Question: when is Ctx supposed to adopt Lua 5.3?

Best regards,


On Fri, 23 May 2014 16:18:33 +0200, Peter Rolf <indiego at gmx.net> wrote:

> Am 23.05.2014 13:50, schrieb Hans Hagen:
>> On 5/23/2014 1:30 PM, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>>> Hello,
>>>>> \input \HOME/Common/_Defs_.ctx
>>>> at least put { } around the input name
>>> --
>>> \startluacode
>>>    local home = (os.getenv("HOME.ORG") or os.getenv("HOME") or
>>> "?"):gsub("\\", "/")
>>>    context.setvalue("HOME", home)
>>> \stopluacode
>>> \input{\HOME/Common/_Defs_.ctx}
>>> \starttext
>>>    Test
>>> \stoptext

Ing. Lukáš Procházka [mailto:LPr at pontex.cz]
Pontex s. r. o.      [mailto:pontex at pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

More information about the ntg-context mailing list