2023-10-14 08:41:21 +00:00
|
|
|
title: Conditionals/BlockMode
|
|
|
|
description: Basic conditional shortcut syntax in block mode
|
|
|
|
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%>
|
2023-10-14 08:41:21 +00:00
|
|
|
|
2024-09-02 15:51:15 +00:00
|
|
|
<%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%>
|
2023-10-14 08:41:21 +00:00
|
|
|
|
2024-09-02 15:51:15 +00:00
|
|
|
<%endif%>
|
2023-10-14 08:41:21 +00:00
|
|
|
|
|
|
|
\end
|
|
|
|
|
|
|
|
<<test "Giraffe">>
|
|
|
|
|
|
|
|
<<test "Elephant">>
|
|
|
|
|
|
|
|
<<test "Antelope">>
|
|
|
|
+
|
|
|
|
title: ExpectedResult
|
|
|
|
|
|
|
|
<h1 class="">It is a giraffe</h1><h1 class="">It is an elephant</h1><h1 class="">It is completely unknown</h1>
|