The official discord link if you wish to join the discord: https://discord.gg/j5RKwCvAFu

Support the wiki on our official Ko-Fi page or Patreon page!

Template:TempCounter

From The Codex
Revision as of 14:11, 16 June 2023 by GiverOfThePeace (talk | contribs) (Created page with "{{#vardefine:count16|{{#if:{{{16|1}}}|0|0}}}}<!-- -->{{#vardefine:count15|{{#if:{{{15|}}}|1|0}}}}<!-- -->{{#vardefine:count14|{{#if:{{{14|}}}|1|0}}}}<!-- -->{{#vardefine:count13|{{#if:{{{13|}}}|1|0}}}}<!-- -->{{#vardefine:count12|{{#if:{{{12|}}}|1|0}}}}<!-- -->{{#vardefine:count11|{{#if:{{{11|}}}|1|0}}}}<!-- -->{{#vardefine:count10|{{#if:{{{10|}}}|1|0}}}}<!-- -->{{#vardefine:count9|{{#if:{{{9|}}}|1|0}}}}<!-- -->{{#vardefine:count8|{{#if:{{{8|}}}|1|0}}}}<!-- -->{{#vardefi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

{{#vardefine:count16|0}}{{#vardefine:count15|0}}{{#vardefine:count14|0}}{{#vardefine:count13|0}}{{#vardefine:count12|0}}{{#vardefine:count11|0}}{{#vardefine:count10|0}}{{#vardefine:count9|0}}{{#vardefine:count8|0}}{{#vardefine:count7|0}}{{#vardefine:count6|0}}{{#vardefine:count5|0}}{{#vardefine:count4|0}}{{#vardefine:count3|0}}{{#vardefine:count2|0}}{{#vardefine:count1|0}}{{#vardefine:count|Expression error: Unrecognized punctuation character "{".}}{{#var:count}}

Purpose

This template counts the number of parameters used in it. This is intended to be used to give a variable for other templates to use which need to know how many parameters are being used in them in order to have the correct coding.

Usage

To use this template, type: {{#vardefine:parameters|{{#vardefine:count16|0}}{{#vardefine:count15|0}}{{#vardefine:count14|0}}{{#vardefine:count13|0}}{{#vardefine:count12|0}}{{#vardefine:count11|0}}{{#vardefine:count10|0}}{{#vardefine:count9|0}}{{#vardefine:count8|0}}{{#vardefine:count7|0}}{{#vardefine:count6|0}}{{#vardefine:count5|0}}{{#vardefine:count4|0}}{{#vardefine:count3|0}}{{#vardefine:count2|0}}{{#vardefine:count1|1}}{{#vardefine:count|Expression error: Unrecognized punctuation character "{".}}{{#var:count}}}}{{#vardefine:content| }}    {{TempCounter{{#var:content}}}}

Where in place of Parameters you list all the parameters that you need to count in another template. This template currently supports up to 16 parameters. Any further parameters result in an inaccurate number.