ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* passing variables/data between context  and lua
@ 2019-09-27  4:59 Martin Althoff
  2019-09-27  8:41 ` mf
  2019-09-27 12:58 ` Wolfgang Schuster
  0 siblings, 2 replies; 12+ messages in thread
From: Martin Althoff @ 2019-09-27  4:59 UTC (permalink / raw)
  To: ConTeXt users

Hi, I am trying to pass variables/data between context and lua. Lua would be used for
calculations on data coming from context.

Unfortunately I can't figure out what to do. The code below doesn't work, but is there to
illustrate my idea. 

Any help would be much appreciated. Thanks, Martin 


\define\question{44}

\starttext

\startluacode
local points = \question * 92
-- do some calculations with points and return to to context
answer=42
\stopluacode

% lots of Text in between 
The answer is \answer

\stoptext

___________________________________________________________________________________
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] 12+ messages in thread

end of thread, other threads:[~2019-10-08 16:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-27  4:59 passing variables/data between context and lua Martin Althoff
2019-09-27  8:41 ` mf
2019-09-27 12:58 ` Wolfgang Schuster
2019-09-28  6:53   ` defs, variables and dimensions (was: passing variables/data between context and lua) Henning Hraban Ramm
2019-09-28 17:51     ` defs, variables and dimensions Wolfgang Schuster
2019-09-30  2:51     ` defs, variables and dimensions (was: passing variables/data between context and lua) Martin Althoff
2019-09-29 11:51   ` passing variables/data between context and lua Martin Althoff
2019-10-06  5:11   ` Rudolf Bahr
2019-10-06 20:44     ` Wolfgang Schuster
2019-10-08  7:21       ` Rudolf Bahr
2019-10-08 12:55         ` Aditya Mahajan
2019-10-08 16:22           ` Rudolf Bahr

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).