Cool. It works once \startlines ... \stoplines is removed. Thank you very much!

Jairo

El mié, 13 dic 2023 a la(s) 3:40 a.m., Hans Hagen (j.hagen@xs4all.nl) escribió:
On 12/13/2023 4:05 AM, Jairo A. del Rio wrote:
> Hi, dear list. Is there a proper "ConTeXt way" to do the following?
>
> \integerdef\lmao=0
> \starttext
> Sum: \in[trick] % 10 from the result below
>
> +1\advance\lmao\plusone
>
> +2\advance\lmao\plustwo
>
> +3\advance\lmao\plusthree
>
> +4\advance\lmao\plusfour
>
> \normalexpanded{\reference[trick]{\the\lmao}} % 10 printed above
> \stoptext
>
> I want the result of a sum (either via Lua or TeX) to be printed before
> summands in text, but without the mess of reference options such as
> interaction, etc. Thank you in advance and sorry for any inconvenience.

\integerdef\DSlmao=0

\starttext

Sum: \datasetvariable{test-1}{1}{whatever}

\startlines
+1\advance\DSlmao\plusone
+2\advance\DSlmao\plustwo
+3\advance\DSlmao\plusthree
+4\advance\DSlmao\plusfour
\stoplines

\normalexpanded{\setdataset[test-1][whatever=\the\DSlmao]}

\stoptext


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

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

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________