Hello Hans,
-- Původní e-mail -- {
Od: Hans Hagen
as you updated, it's just:
\startluacode
local defined = tokens.defined
for _, v in ipairs{ "MyMacro", "MyMacWithPars", "Undefined", "DoNothing",
"NonExisting" } do
print(string.format("\letterpercent-12s",
On 6/18/2020 10:27 AM, Lukas/ConTeXt wrote:
Hello,
I'm using Hans' macro suggested some time before.
I've just updated Ctx MkIV and my sample code:
\starttext
\def\MyMacro{Ahoj}
\def\MyMacWithPars#1#2{Something}
\def\Undefined{}
\let\Undefined\undefined
\def\DoNothing{}
Meer
Komu: NTG ConTeXt
Datum: 18. 6. 2020 12:25:42
Předmět: Re: [NTG-context] Checking existence of a macro (control sequence)
by Lua - problem after updating MkIV
"
Why can you not simply use one of the doifundefined macro's? Something for
example:
\doifundefined{ExitStatus}{\gdef\ExitSta
Why can you not simply use one of the doifundefined macro's? Something for
example:
\doifundefined{ExitStatus}{\gdef\ExitStatus{0}} % default to ok as in UNIX
dr. Hans van der Meer
> On 18 Jun 2020, at 10:27, Lukas/ConTeXt wrote:
>
> Hello,
> I'm using Hans' macro suggested some time before.
Hello,
I'm using Hans' macro suggested some time before.
I've just updated Ctx MkIV and my sample code:
\starttext
\def\MyMacro{Ahoj}
\def\MyMacWithPars#1#2{Something}
\def\Undefined{}
\let\Undefined\undefined
\def\DoNothing{}
\let\DoNothing\donothing
\startluacode
if