ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Storing Lua values between Ctx "*first* and next runs
@ 2018-07-14 11:24 Procházka Lukáš Ing.
  2018-07-17 15:44 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Procházka Lukáš Ing. @ 2018-07-14 11:24 UTC (permalink / raw)
  To: ConTeXt

Hello,

is there a Lua variable/namespace which is stored automatically between Ctx "*first" and following runs?

I thought 'userdata' is intended for this, but it seems it's not; I'd like to achieve something like:

----
\startluacode
   if tex.modes["*first"] then
     userdata.LPr = "Something"
     -- Is there a variable which is shared between Ctx runs?
   else
     assert(userdata.LPr == "Something")
   end
\stopluacode
----

Of course, I can store the table via serialization functions to an extra file, but I thought there is already a variable/mechanism for this (e.g. using .tua/.tuc file) ... is it?

Best regards,

Lukas


-- 
Ing. Lukáš Procházka | mailto:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-17 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-14 11:24 Storing Lua values between Ctx "*first* and next runs Procházka Lukáš Ing.
2018-07-17 15:44 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).