Template:Prioritize: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>ArceusInator
This should make it easier to have multiple variables with the same meaning without having a terribly large amount of ifs
 
>NXTBoy
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 8: Line 8:


If the 4th and 7th worked, the 4th would be used because it was read first.  It can only accept 10 arguments.  If you have more than 10, you can make the 10th argument another Prioritize template.}}
If the 4th and 7th worked, the 4th would be used because it was read first.  It can only accept 10 arguments.  If you have more than 10, you can make the 10th argument another Prioritize template.}}
A useful shorthand is {{((}}P{{))}}.
</noinclude>
</noinclude>

Latest revision as of 12:51, 16 July 2011


The Prioritize template makes it easier to have multiple variables with the same meaning while keeping your code (somewhat) legible.

Example
{{Prioritize|{{{a}}}|{{{A}}}|{{{Aai}}}}}

Would first check to see if the user used "a", then "A", then "Aai" and would return the first match found. If no matches were found, it returns "a".

If the 4th and 7th worked, the 4th would be used because it was read first. It can only accept 10 arguments. If you have more than 10, you can make the 10th argument another Prioritize template.


A useful shorthand is {{P}}.