Am 2016-03-16 22:47, schrieb Romain Diss:
Hi,

Thank you Hans... but it doesn't fully work. Now I only enter the input
once (that's ok) but on the second run, the variable is not defined
anymore. How can I keep it in the conTeXt memory?

-- Minimum still not working example
local name
if environment.arguments.currentrun == "1" then io.read() end
context.startdocument()
context("Hello " .. name)
context.stopdocument()

All the best

You can use the LUA interface "job.passes".
In the first pass, you store your value. For example:
local passdata = job.passes.define("mystuff") --I usually define this at the top of my script and reuse it.
passdata["somevalue"] = "hello world";

Then in the subsequent runs you can access
local lastpassdata = job.passes.getcollected("mystuff") --Same here...
print(lastpassdata["somevalue"])

Best regards,
Andreas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to