![]() The upper branches of a #switch execute faster, and the bottom branches must wait for comparisons of all higher branches. A parser function is a form of basic coding that happens within the MediaWiki language Information about magic words a related MediaWiki feature. ![]() Another common split might be to separate numeric values into frequent ranges, followed by all other. The switch value is compared as a character string, not a number, so "5" would not match "5.00" unless compared as " to be used in a higher #switch which branches by most-frequent letter, followed by all others at the bottom or "#default" branch. The phrase parser function should not be. See also Help:Extension:ParserFunctions which offers great functionality for. Parser functions, added in MediaWiki 1.7, are a type of extension that integrate closely with the parser. Although many #switch structures are used to branch among a simple set of values, the branches can also include boolean expressions to act as a set of pre-conditions to be tested until one tests true, acting as an if-elseif-elseif-elseif-else structure. Parser functions: very similar to variables, but take one or more parameters. The switch parser function, coded as " #switch", selects the first matching branch in a list of choices, acting as a case statement.Įach branch can be a value, an expression ( calculation), or a template call, evaluated and compared to match the value of the switch. See also: mw:Help:Extension:ParserFunction § #switch
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |