On 10/13/20 7:14 PM, Wolfgang Schuster wrote:
Pablo Rodriguez schrieb am 13.10.2020 um 19:06:
[...] In any case, I cannot compare to a number:
\startluacode userdata = userdata or {} function userdata.numbersfname(name) return string.match(name, "%d+") end \stopluacode
\define[1]\numbersfname {\cldcontext{userdata.numbersfname([==[#1]==])}}
Untested:
\defineexpandable[1]\numbersfname {\cldcontext{userdata.numbersfname([==[#1]==])}}
I’m afraid it doesn’t work. \startluacode userdata = userdata or {} function userdata.numbersfname(name) return string.match(name, "%d+") end \stopluacode \defineexpandable[1]\numbersfname {\cldcontext{userdata.numbersfname([==[#1]==])}} \starttext \numbersfname{abc123} \numbersfname{\env{fname}} \doifelse{\numbersfname{\env{fname}}}{123}{yes}{no} \stoptext Just curious about what the difference might be. Many thanks for your help, Pablo -- http://www.ousia.tk