Re: [NTG-context] Passing and retrieveing a variable

2011-01-09 Thread Hans Hagen
On 8-1-2011 7:12, Procházka Lukáš wrote: So, an earlier splitting may be performed by something like for a in document.arguments:gmatch(([^,]+)) do local k, v = a:match((.*)=(.*)) document.arguments[k] = v end utilities.parsers.settings_to_hash( document.arguments.arg or ,

Re: [NTG-context] Passing and retrieveing a variable

2011-01-08 Thread Procházka Lukáš
Hello, thanks for detailing the observation - On Fri, 07 Jan 2011 22:58:24 +0100, Hans Hagen pra...@wxs.nl wrote: On 7-1-2011 9:32, Procházka Lukáš Ing. - Pontex s. r. o. wrote: - Modes are accessible by tex.modes[a-mode]. indeed - - tex.modes are 'false' by default. I.e. they are not

Re: [NTG-context] Passing and retrieveing a variable

2011-01-07 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello, I created a testing file which tests existence and type of (tex|context|document).(modes|arguments|variables) by Lua - see the attachments. It seems that: - Modes are accessible by tex.modes[a-mode]. - - tex.modes are 'false' by default. I.e. they are not 'nil' but 'false', even if

Re: [NTG-context] Passing and retrieveing a variable

2011-01-07 Thread luigi scarso
2011/1/7 Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz: Hello, I created a testing file which tests existence and type of (tex|context|document).(modes|arguments|variables) by Lua - see the attachments. It seems that: - Modes are accessible by tex.modes[a-mode]. - - tex.modes

Re: [NTG-context] Passing and retrieveing a variable

2011-01-07 Thread Peter Münster
Procházka Lukáš Ing. - Pontex s. r. o. l...@pontex.cz writes: context.exe t.mkiv --arguments=ARG1=arg1 --arguments=ARG2=arg2 It's supposed to be --arguments=ARG1=arg1,ARG2=arg2 Peter ___ If your question is of

Re: [NTG-context] Passing and retrieveing a variable

2011-01-07 Thread Hans Hagen
On 7-1-2011 9:32, Procházka Lukáš Ing. - Pontex s. r. o. wrote: - Modes are accessible by tex.modes[a-mode]. indeed - - tex.modes are 'false' by default. I.e. they are not 'nil' but 'false', even if not specified on the command line. (tex.mode.__newindex predefined to this purpose?)

Re: [NTG-context] Passing and retrieveing a variable

2011-01-05 Thread Peter Münster
Procházka Lukáš l...@pontex.cz writes: I'd need to pass a variable to Ctx and to retrieve it inside a compiled document - via Ctx itself and also by Lua. Hello, % cmd-line: context --arguments=testvar=my-value test \starttext value of testvar: \env{testvar} with lua:

Re: [NTG-context] Passing and retrieveing a variable

2011-01-05 Thread Wolfgang Schuster
Am 05.01.2011 um 20:22 schrieb Procházka Lukáš: Hello, I'd need to pass a variable to Ctx and to retrieve it inside a compiled document - via Ctx itself and also by Lua. Something like modes; but modes allow just to check whether they are on or off. I'd need something like this: You can

Re: [NTG-context] Passing and retrieveing a variable

2011-01-05 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello, thanks, - On Wed, 05 Jan 2011 21:41:13 +0100, Wolfgang Schuster schuster.wolfg...@googlemail.com wrote: Am 05.01.2011 um 20:22 schrieb Procházka Lukáš: Hello, I'd need to pass a variable to Ctx and to retrieve it inside a compiled document - via Ctx itself and also by Lua.