2023-10-14 08:41:21 +00:00
|
|
|
title: Conditionals/Nested
|
|
|
|
description: Nested conditional shortcut syntax
|
|
|
|
type: text/vnd.tiddlywiki-multiple
|
|
|
|
tags: [[$:/tags/wiki-test-spec]]
|
|
|
|
|
|
|
|
title: Output
|
|
|
|
|
|
|
|
\procedure test(animal)
|
2024-09-02 15:51:15 +00:00
|
|
|
<%if [<animal>match[Elephant]] %>
|
2023-10-14 08:41:21 +00:00
|
|
|
It is an elephant
|
2024-09-02 15:51:15 +00:00
|
|
|
<%else%>
|
|
|
|
<%if [<animal>match[Giraffe]] %>
|
2023-10-14 08:41:21 +00:00
|
|
|
It is a giraffe
|
2024-09-02 15:51:15 +00:00
|
|
|
<%else%>
|
2023-10-14 08:41:21 +00:00
|
|
|
It is completely unknown
|
2024-09-02 15:51:15 +00:00
|
|
|
<%endif%>
|
|
|
|
<%endif%>
|
2023-10-14 08:41:21 +00:00
|
|
|
\end
|
|
|
|
|
|
|
|
<<test "Giraffe">>
|
|
|
|
|
|
|
|
<<test "Elephant">>
|
|
|
|
|
|
|
|
<<test "Antelope">>
|
|
|
|
|
|
|
|
+
|
|
|
|
title: ExpectedResult
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It is a giraffe
|
|
|
|
|
|
|
|
|
|
|
|
It is an elephant
|
|
|
|
|
|
|
|
|
|
|
|
It is completely unknown
|
|
|
|
|