Template:Ifndef/doc

From ISFDB
< Template:Ifndef
Revision as of 01:31, 22 October 2008 by DESiegel60 (talk | contribs) (New page: <code>{{[[Template:{{PAGENAME}}|{{lcfirst:{{PAGENAME}}}}]]}}</code> is a compact variant of {{Tl|Qif}} for simple "'''if''' ''defined'' '''then void else''' ''do''" statements w...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

{{ifndef/doc}} is a compact variant of {{Qif}} for simple "if defined then void else do" statements with blank then part. It's the opposite of {{ifdef}}.

Usage

{{Ifndef/doc|value|result}} yields result  if value  is blank.

This simple template cannot be substituted, it's used to simplify the following equivalent but somewhat cryptic (names don't matter) code variants:

{{{2{{{1|}}}|}}}
{{{result{{{value|}}}|}}}
{{{then{{{test|}}}|}}}


Example

Code Result
1 {{Ifndef/doc| |empty}} 1 {{ifndef/doc}}

is a compact variant of {{Qif}} for simple "if defined then void else do" statements with blank then part. It's the opposite of {{ifdef}}.

Usage

{{Ifndef/doc|value|result}} yields result  if value  is blank.

This simple template cannot be substituted, it's used to simplify the following equivalent but somewhat cryptic (names don't matter) code variants:

{{{2{{{1|}}}|}}}
{{{result{{{value|}}}|}}}
{{{then{{{test|}}}|}}}


Example

Code Result
1 {{Ifndef/doc| |empty}} 1 Template loop detected: Template:Ifndef/doc
2 {{Ifndef/doc|x|gotcha}} 2 Template loop detected: Template:Ifndef/doc
3 {{Ifndef/doc| {{{1| }}} | {{{1| }}} undefined}} 3 Template loop detected: Template:Ifndef/doc
4 {{Ifndef/doc| {{{1  }}} | {{{1  }}} bad idea}} 4 Template loop detected: Template:Ifndef/doc
5 {{Ifndef/doc| {{ns:0}} | main namespace}} 5 Template loop detected: Template:Ifndef/doc
6 {{Ifndef/doc||compare {{Tlx|ifdef}} }} 6 Template loop detected: Template:Ifndef/doc
7 {{Ifndef/doc|| 2=see=[[#Caveats]] }} 7 Template loop detected: Template:Ifndef/doc
8 {{Ifndef/doc|| see=[[#Caveats]] }} 8 Template loop detected: Template:Ifndef/doc

Unlike ifdef the minimalistic ifndef cannot reject a missing second parameter.

Caveats

In templates the characters "=" (&#61;) and "|" (&#124;) cannot be used as is in parameters. The numeric character references &#61; and &#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:

  1. For | template:! (edittalklinkshistory) offers a workaround.
  2. For = the template parameter mechanism allows {{ifndef}} resulting in "ok=yes" instead of {{ifndef}} resulting in "".

Substitution works only for {{ifdef}}, but not for {{ifndef}} or {{qif}}.

2 {{Ifndef/doc|x|gotcha}} 2 {{ifndef/doc}}

is a compact variant of {{Qif}} for simple "if defined then void else do" statements with blank then part. It's the opposite of {{ifdef}}.

Usage

{{Ifndef/doc|value|result}} yields result  if value  is blank.

This simple template cannot be substituted, it's used to simplify the following equivalent but somewhat cryptic (names don't matter) code variants:

{{{2{{{1|}}}|}}}
{{{result{{{value|}}}|}}}
{{{then{{{test|}}}|}}}


Example

Code Result
1 {{Ifndef/doc| |empty}} 1 Template loop detected: Template:Ifndef/doc
2 {{Ifndef/doc|x|gotcha}} 2 Template loop detected: Template:Ifndef/doc
3 {{Ifndef/doc| {{{1| }}} | {{{1| }}} undefined}} 3 Template loop detected: Template:Ifndef/doc
4 {{Ifndef/doc| {{{1  }}} | {{{1  }}} bad idea}} 4 Template loop detected: Template:Ifndef/doc
5 {{Ifndef/doc| {{ns:0}} | main namespace}} 5 Template loop detected: Template:Ifndef/doc
6 {{Ifndef/doc||compare {{Tlx|ifdef}} }} 6 Template loop detected: Template:Ifndef/doc
7 {{Ifndef/doc|| 2=see=[[#Caveats]] }} 7 Template loop detected: Template:Ifndef/doc
8 {{Ifndef/doc|| see=[[#Caveats]] }} 8 Template loop detected: Template:Ifndef/doc

Unlike ifdef the minimalistic ifndef cannot reject a missing second parameter.

Caveats

In templates the characters "=" (&#61;) and "|" (&#124;) cannot be used as is in parameters. The numeric character references &#61; and &#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:

  1. For | template:! (edittalklinkshistory) offers a workaround.
  2. For = the template parameter mechanism allows {{ifndef}} resulting in "ok=yes" instead of {{ifndef}} resulting in "".

Substitution works only for {{ifdef}}, but not for {{ifndef}} or {{qif}}.

3 {{Ifndef/doc| {{{1| }}} | {{{1| }}} undefined}} 3 {{ifndef/doc}}

is a compact variant of {{Qif}} for simple "if defined then void else do" statements with blank then part. It's the opposite of {{ifdef}}.

Usage

{{Ifndef/doc|value|result}} yields result  if value  is blank.

This simple template cannot be substituted, it's used to simplify the following equivalent but somewhat cryptic (names don't matter) code variants:

{{{2{{{1|}}}|}}}
{{{result{{{value|}}}|}}}
{{{then{{{test|}}}|}}}


Example

Code Result
1 {{Ifndef/doc| |empty}} 1 Template loop detected: Template:Ifndef/doc
2 {{Ifndef/doc|x|gotcha}} 2 Template loop detected: Template:Ifndef/doc
3 {{Ifndef/doc| {{{1| }}} | {{{1| }}} undefined}} 3 Template loop detected: Template:Ifndef/doc
4 {{Ifndef/doc| {{{1  }}} | {{{1  }}} bad idea}} 4 Template loop detected: Template:Ifndef/doc
5 {{Ifndef/doc| {{ns:0}} | main namespace}} 5 Template loop detected: Template:Ifndef/doc
6 {{Ifndef/doc||compare {{Tlx|ifdef}} }} 6 Template loop detected: Template:Ifndef/doc
7 {{Ifndef/doc|| 2=see=[[#Caveats]] }} 7 Template loop detected: Template:Ifndef/doc
8 {{Ifndef/doc|| see=[[#Caveats]] }} 8 Template loop detected: Template:Ifndef/doc

Unlike ifdef the minimalistic ifndef cannot reject a missing second parameter.

Caveats

In templates the characters "=" (&#61;) and "|" (&#124;) cannot be used as is in parameters. The numeric character references &#61; and &#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:

  1. For | template:! (edittalklinkshistory) offers a workaround.
  2. For = the template parameter mechanism allows {{ifndef}} resulting in "ok=yes" instead of {{ifndef}} resulting in "".

Substitution works only for {{ifdef}}, but not for {{ifndef}} or {{qif}}.

4 {{Ifndef/doc| {{{1  }}} | {{{1  }}} bad idea}} 4 {{ifndef/doc}}

is a compact variant of {{Qif}} for simple "if defined then void else do" statements with blank then part. It's the opposite of {{ifdef}}.

Usage

{{Ifndef/doc|value|result}} yields result  if value  is blank.

This simple template cannot be substituted, it's used to simplify the following equivalent but somewhat cryptic (names don't matter) code variants:

{{{2{{{1|}}}|}}}
{{{result{{{value|}}}|}}}
{{{then{{{test|}}}|}}}


Example

Code Result
1 {{Ifndef/doc| |empty}} 1 Template loop detected: Template:Ifndef/doc
2 {{Ifndef/doc|x|gotcha}} 2 Template loop detected: Template:Ifndef/doc
3 {{Ifndef/doc| {{{1| }}} | {{{1| }}} undefined}} 3 Template loop detected: Template:Ifndef/doc
4 {{Ifndef/doc| {{{1  }}} | {{{1  }}} bad idea}} 4 Template loop detected: Template:Ifndef/doc
5 {{Ifndef/doc| {{ns:0}} | main namespace}} 5 Template loop detected: Template:Ifndef/doc
6 {{Ifndef/doc||compare {{Tlx|ifdef}} }} 6 Template loop detected: Template:Ifndef/doc
7 {{Ifndef/doc|| 2=see=[[#Caveats]] }} 7 Template loop detected: Template:Ifndef/doc
8 {{Ifndef/doc|| see=[[#Caveats]] }} 8 Template loop detected: Template:Ifndef/doc

Unlike ifdef the minimalistic ifndef cannot reject a missing second parameter.

Caveats

In templates the characters "=" (&#61;) and "|" (&#124;) cannot be used as is in parameters. The numeric character references &#61; and &#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:

  1. For | template:! (edittalklinkshistory) offers a workaround.
  2. For = the template parameter mechanism allows {{ifndef}} resulting in "ok=yes" instead of {{ifndef}} resulting in "".

Substitution works only for {{ifdef}}, but not for {{ifndef}} or {{qif}}.

5 {{Ifndef/doc| {{ns:0}} | main namespace}} 5 {{ifndef/doc}}

is a compact variant of {{Qif}} for simple "if defined then void else do" statements with blank then part. It's the opposite of {{ifdef}}.

Usage

{{Ifndef/doc|value|result}} yields result  if value  is blank.

This simple template cannot be substituted, it's used to simplify the following equivalent but somewhat cryptic (names don't matter) code variants:

{{{2{{{1|}}}|}}}
{{{result{{{value|}}}|}}}
{{{then{{{test|}}}|}}}


Example

Code Result
1 {{Ifndef/doc| |empty}} 1 Template loop detected: Template:Ifndef/doc
2 {{Ifndef/doc|x|gotcha}} 2 Template loop detected: Template:Ifndef/doc
3 {{Ifndef/doc| {{{1| }}} | {{{1| }}} undefined}} 3 Template loop detected: Template:Ifndef/doc
4 {{Ifndef/doc| {{{1  }}} | {{{1  }}} bad idea}} 4 Template loop detected: Template:Ifndef/doc
5 {{Ifndef/doc| {{ns:0}} | main namespace}} 5 Template loop detected: Template:Ifndef/doc
6 {{Ifndef/doc||compare {{Tlx|ifdef}} }} 6 Template loop detected: Template:Ifndef/doc
7 {{Ifndef/doc|| 2=see=[[#Caveats]] }} 7 Template loop detected: Template:Ifndef/doc
8 {{Ifndef/doc|| see=[[#Caveats]] }} 8 Template loop detected: Template:Ifndef/doc

Unlike ifdef the minimalistic ifndef cannot reject a missing second parameter.

Caveats

In templates the characters "=" (&#61;) and "|" (&#124;) cannot be used as is in parameters. The numeric character references &#61; and &#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:

  1. For | template:! (edittalklinkshistory) offers a workaround.
  2. For = the template parameter mechanism allows {{ifndef}} resulting in "ok=yes" instead of {{ifndef}} resulting in "".

Substitution works only for {{ifdef}}, but not for {{ifndef}} or {{qif}}.

6 {{Ifndef/doc||compare {{Tlx|ifdef}} }} 6 {{ifndef/doc}}

is a compact variant of {{Qif}} for simple "if defined then void else do" statements with blank then part. It's the opposite of {{ifdef}}.

Usage

{{Ifndef/doc|value|result}} yields result  if value  is blank.

This simple template cannot be substituted, it's used to simplify the following equivalent but somewhat cryptic (names don't matter) code variants:

{{{2{{{1|}}}|}}}
{{{result{{{value|}}}|}}}
{{{then{{{test|}}}|}}}


Example

Code Result
1 {{Ifndef/doc| |empty}} 1 Template loop detected: Template:Ifndef/doc
2 {{Ifndef/doc|x|gotcha}} 2 Template loop detected: Template:Ifndef/doc
3 {{Ifndef/doc| {{{1| }}} | {{{1| }}} undefined}} 3 Template loop detected: Template:Ifndef/doc
4 {{Ifndef/doc| {{{1  }}} | {{{1  }}} bad idea}} 4 Template loop detected: Template:Ifndef/doc
5 {{Ifndef/doc| {{ns:0}} | main namespace}} 5 Template loop detected: Template:Ifndef/doc
6 {{Ifndef/doc||compare {{Tlx|ifdef}} }} 6 Template loop detected: Template:Ifndef/doc
7 {{Ifndef/doc|| 2=see=[[#Caveats]] }} 7 Template loop detected: Template:Ifndef/doc
8 {{Ifndef/doc|| see=[[#Caveats]] }} 8 Template loop detected: Template:Ifndef/doc

Unlike ifdef the minimalistic ifndef cannot reject a missing second parameter.

Caveats

In templates the characters "=" (&#61;) and "|" (&#124;) cannot be used as is in parameters. The numeric character references &#61; and &#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:

  1. For | template:! (edittalklinkshistory) offers a workaround.
  2. For = the template parameter mechanism allows {{ifndef}} resulting in "ok=yes" instead of {{ifndef}} resulting in "".

Substitution works only for {{ifdef}}, but not for {{ifndef}} or {{qif}}.

7 {{Ifndef/doc|| 2=see=[[#Caveats]] }} 7 {{ifndef/doc}}

is a compact variant of {{Qif}} for simple "if defined then void else do" statements with blank then part. It's the opposite of {{ifdef}}.

Usage

{{Ifndef/doc|value|result}} yields result  if value  is blank.

This simple template cannot be substituted, it's used to simplify the following equivalent but somewhat cryptic (names don't matter) code variants:

{{{2{{{1|}}}|}}}
{{{result{{{value|}}}|}}}
{{{then{{{test|}}}|}}}


Example

Code Result
1 {{Ifndef/doc| |empty}} 1 Template loop detected: Template:Ifndef/doc
2 {{Ifndef/doc|x|gotcha}} 2 Template loop detected: Template:Ifndef/doc
3 {{Ifndef/doc| {{{1| }}} | {{{1| }}} undefined}} 3 Template loop detected: Template:Ifndef/doc
4 {{Ifndef/doc| {{{1  }}} | {{{1  }}} bad idea}} 4 Template loop detected: Template:Ifndef/doc
5 {{Ifndef/doc| {{ns:0}} | main namespace}} 5 Template loop detected: Template:Ifndef/doc
6 {{Ifndef/doc||compare {{Tlx|ifdef}} }} 6 Template loop detected: Template:Ifndef/doc
7 {{Ifndef/doc|| 2=see=[[#Caveats]] }} 7 Template loop detected: Template:Ifndef/doc
8 {{Ifndef/doc|| see=[[#Caveats]] }} 8 Template loop detected: Template:Ifndef/doc

Unlike ifdef the minimalistic ifndef cannot reject a missing second parameter.

Caveats

In templates the characters "=" (&#61;) and "|" (&#124;) cannot be used as is in parameters. The numeric character references &#61; and &#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:

  1. For | template:! (edittalklinkshistory) offers a workaround.
  2. For = the template parameter mechanism allows {{ifndef}} resulting in "ok=yes" instead of {{ifndef}} resulting in "".

Substitution works only for {{ifdef}}, but not for {{ifndef}} or {{qif}}.

8 {{Ifndef/doc|| see=[[#Caveats]] }} 8 {{ifndef/doc}}

is a compact variant of {{Qif}} for simple "if defined then void else do" statements with blank then part. It's the opposite of {{ifdef}}.

Usage

{{Ifndef/doc|value|result}} yields result  if value  is blank.

This simple template cannot be substituted, it's used to simplify the following equivalent but somewhat cryptic (names don't matter) code variants:

{{{2{{{1|}}}|}}}
{{{result{{{value|}}}|}}}
{{{then{{{test|}}}|}}}


Example

Code Result
1 {{Ifndef/doc| |empty}} 1 Template loop detected: Template:Ifndef/doc
2 {{Ifndef/doc|x|gotcha}} 2 Template loop detected: Template:Ifndef/doc
3 {{Ifndef/doc| {{{1| }}} | {{{1| }}} undefined}} 3 Template loop detected: Template:Ifndef/doc
4 {{Ifndef/doc| {{{1  }}} | {{{1  }}} bad idea}} 4 Template loop detected: Template:Ifndef/doc
5 {{Ifndef/doc| {{ns:0}} | main namespace}} 5 Template loop detected: Template:Ifndef/doc
6 {{Ifndef/doc||compare {{Tlx|ifdef}} }} 6 Template loop detected: Template:Ifndef/doc
7 {{Ifndef/doc|| 2=see=[[#Caveats]] }} 7 Template loop detected: Template:Ifndef/doc
8 {{Ifndef/doc|| see=[[#Caveats]] }} 8 Template loop detected: Template:Ifndef/doc

Unlike ifdef the minimalistic ifndef cannot reject a missing second parameter.

Caveats

In templates the characters "=" (&#61;) and "|" (&#124;) cannot be used as is in parameters. The numeric character references &#61; and &#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:

  1. For | template:! (edittalklinkshistory) offers a workaround.
  2. For = the template parameter mechanism allows {{ifndef}} resulting in "ok=yes" instead of {{ifndef}} resulting in "".

Substitution works only for {{ifdef}}, but not for {{ifndef}} or {{qif}}.

Unlike ifdef the minimalistic ifndef cannot reject a missing second parameter.

Caveats

In templates the characters "=" (&#61;) and "|" (&#124;) cannot be used as is in parameters. The numeric character references &#61; and &#124; are often good enough, but for Wiki and XHTML markup the literal characters are required:

  1. For | template:! (edittalklinkshistory) offers a workaround.
  2. For = the template parameter mechanism allows {{ifndef}} resulting in "ok=yes" instead of {{ifndef}} resulting in "".

Substitution works only for {{ifdef}}, but not for {{ifndef}} or {{qif}}.