Hello,
what do I have to do so that the values (d1, m1, y1) from the Lua block
are returned with Return and the commented out line
\date[d=d1,m=m1,y=y1][weekday,{,~},day,{.~},month,{~},year]
works in ConTeXt.
In other words: how do I do it right?
Thank you in advance
Greetings
Thomas
PS. Sorry, I'm a totally novice in Lua.
\starttext
\startluacode
function ddate(s)
i = 1
j = 4
y1 = string.sub(s,i,j)
i = 5
j = 6
m1 = string.sub(s,i,j)
i = 7
j = 8
d1 = string.sub(s,i,j)
context("Geht das: %s.%s.%s", d1, m1, y1) -- that works!
--return d1, m1, y1 -- that
works not! Why?
end
\stopluacode
\def\DDate#1{\ctxlua{ddate("#1")}}
\DDate{20241005}
%\date[d=d1,m=m1,y=y1][weekday,{,~},day,{.~},month,{~},year]
\blank
\date[dd,mm,yyyy][weekday,{,~},day,{.~},month,{~},year]
\blank
\date[d=11,m=7,y=2024][weekday,{,~},day,{.~},month,{~},year]
\stoptext
___________________________________________________________________________________
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
___________________________________________________________________________________