Okay, in summary, here are two ways of using the [is[variable]] operator to
display an error message if a specific variable or macro is undefined.
* As a macro:
\define check-var-or-macro(var)
<$list filter="[[$var$]] +[is[variable]]" emptyMessage="Undefined variable
or macro '$var$'">
<<emptyNonExistentMessage>>
</$list>
\end
<<check-var-or-macro VAR-OR-MACRO-NAME>>
* As a transcluded filter:
{{{ [[VAR-OR-MACRO-NAME]] +[!is[variable]addprefix[Undefined variable or
macro ']addsuffix[']] }}}
If used in 5.1.19 calling the macro results in no output, while using the
transluded filter results in the error message: Undefined variable or macro
'Filter Error: Unknown operand for the 'is' filter operator'
<http://localhost:10744/#Undefined%20variable%20or%20macro%20'Filter%20Error%3A%20Unknown%20operand%20for%20the%20'is'%20filter%20operator'>
I want to thank everyone who helped with this. What I assumed would be a
trivial question turned into a rather sizable topic and a new subfilter
operator for TW!
Regards,
David.
On Fri, 1 Mar 2019 at 00:26, PMario <[email protected]> wrote:
> On Thursday, February 28, 2019 at 4:57:31 AM UTC+1, Mal wrote:
>>
>> .... but the "!" does not seem to be working. If you try a similar
>> arrangement to test for non-existence of a tiddler, using "!is[tiddler]",
>> it does work as expected.
>>
>> I think I will raise this as a GitHub issue.
>>
>
> This issue has be fixed
> <https://github.com/Jermolene/TiddlyWiki5/issues/3804> in the meanwhile.
> -m
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/4rEuAWc4EpM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/755e2349-5967-4b3a-8f3e-9526e9c8bf1f%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/755e2349-5967-4b3a-8f3e-9526e9c8bf1f%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/CAFWVPz8K77hhJpK_mpPRLyxK7ARAGrHEQjVRBZ2cWRXagchx%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.