Recent Changes - Search:

PmWiki

pmwiki.org

00697

Summary: Strange compound conditional behavior
Created: 2006-03-11 21:19
Status: Discussion - not a bug
Category: Bug
From: hartwork
Assigned:
Priority: 3
Version: 2.1.2
OS:

Description:
My experiences with compound conditionals
were quite strange so I wrote some test code:

Compound conditionals

Shouln't all these 6 give One two three?:

One (:if true || false:)two(:if:) three
One two three
One (:if false || true:)two(:if:) three
One three
One (:if [false] || [true]:)two(:if:) three
One two three
One (:if [false] || true:)two(:if:) three
One two three
One (:if false || [true]:)two(:if:) three
One three
One (:if [false || true]:)two(:if:) three
One two three

Nested conditionals

(:if false:)(:if true:)This text should never show(:if:)(:if:)
This text should never show

--hartwork


Some notes on the above:

  • Compound conditionals require the use of "expr" or a leading bracket
  • Every operator (including brackets) has to be surrounded by spaces

Thus, rewriting the above conditionals:

* One (:if expr true || false:)two(:if:) three
* One (:if expr false || true:)two(:if:) three
* One (:if expr ( false ) || ( true ):)two(:if:) three
* One (:if expr ( false ) || true:)two(:if:) three
* One (:if expr false || ( true ):)two(:if:) three
* One (:if [ false || true ]:)two(:if:) three
  • One two three
  • One two three
  • One two three
  • One two three
  • One two three
  • One two three
Edit - History - Print - Recent Changes - Search
Page last modified on March 17, 2006, at 09:22 AM