Template:NumChoirs: Difference between revisions

From ChoralWiki
Jump to navigation Jump to search
(counts the number of choirs in a voicing ... eg. {{NumChoirs|SSAT.SATB.ATBB}} = 3)
 
m (Text replace - "{{PAGENAME}}" to "Category:Templates")
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{#expr: {{#if:{{#explode: {{{1|}}}|.|0}}|1|0}}
<includeonly>{{#expr:{{#len:{{{1|}}}}}-{{#len:{{#replace:{{{1|}}}|.|}}}}+1}}</includeonly><noinclude>
+ {{#if:{{#explode: {{{1|}}}|.|1}}|1|0}}
[[Category:Templates]]
+ {{#if:{{#explode: {{{1|}}}|.|2}}|1|0}}
+ {{#if:{{#explode: {{{1|}}}|.|3}}|1|0}}
+ {{#if:{{#explode: {{{1|}}}|.|4}}|1|0}}
+ {{#if:{{#explode: {{{1|}}}|.|5}}|1|0}}
}}<noinclude>
[[Category:Templates|{{PAGENAME}}]]
{{prot-temp}}
{{prot-temp}}
{{DisplayBox
{{DisplayBox
|'''Usage:''' Returns the number of choirs in a voicing specification.  Thus,
|'''Usage:''' Returns the number of choirs in a voicing specification.  Thus,
<pre>{{NumChoirs|SA.TB.ATB}}</pre>
<pre>{{NumChoirs|SA.TB.ATB}}</pre>
returns 3.  The template will handle 1,2,3,4,5 and 6 choir voicings.
returns 3.
}}
}}

Latest revision as of 06:45, 1 June 2015

Usage: Returns the number of choirs in a voicing specification. Thus,

{{NumChoirs|SA.TB.ATB}}

returns 3.