Template:Loop is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should be proposed here first. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use ((edit template-protected)) to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
What is the difference between this template and ((Loop1))?—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); 16:03, 23 March 2007 (UTC)
Where do you type it in? —Preceding unsigned comment added by 76.126.233.15 (talk) 03:18, 1 May 2008 (UTC)
Does this template still work with the new preprocessor? I know ((for loop)) doesn't. Thanks. Verisimilus T 00:13, 28 January 2008 (UTC)
The current version has the following lines:
-->((#ifexpr:((({1))}*2-xxx)>xxx|(({2))))}<!--
where xxx is a number. Why do you need the "*2"?
Can you use just the following?
-->((#ifexpr:((({1))})>xxx|(({2))))}<!--
- TAKASUGI Shinji (talk) 12:58, 29 February 2008 (UTC)
The subtraction stuff was originally added in this edit in the creator's sandbox. I'm also confused as to why this was done. --- RockMFR 21:31, 9 May 2008 (UTC)
-->((#ifexpr:((({1))}*2-032>032|(({2))))}<!--
-->((#ifexpr:((({1))})>031.5|(({2))))}<!--
Please update ((/doc)) with ((documentation)). Per Wikipedia:Template documentation/List Thankyou. -- ṃ•α•Ł•ṭ•ʰ•Ə•Щ• @ 06:13, 28 April 2008 (UTC)
is there any way to call loop as an inner template? ie:
((loop |(({1))}|abc))
where the number of loop reiterations is passed by the outer template? I get this "Expression error: Unrecognised punctuation character "{"" when I try it. Thanks. --stmrlbs|talk 07:04, 3 August 2009 (UTC)
((edit protected))
I made this on the RuneScape Wiki, and it works until 1399 times instead of 149 times. Also it is a shorter code.
Show code |
---|
This is for 1399 repeatings as a limit:
((#ifexpr:((({2|2))}<=10)=1|((Multi/1|(({1))}|(({2|2))))}|((Multi/1|(({1))}|((#expr:(({2|2))}-(((#expr:floor((({2|2))}/10) round 0))*10)))))<!-- -->((Multi/1|((Multi/1|(({1))}|10))|((#ifexpr:((({2|2))}>100)=1|((#expr:((#expr:floor((({2|2))}/10) round 0))-(((#expr:floor((({2|2))}/100) round 0))*10)))|((#expr:floor((({2|2))}/10) round 0))))))<!-- -->((#ifexpr:((({2|2))}>100)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>200)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>300)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>400)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>500)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>600)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>700)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>800)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>900)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>1000)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>1100)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>1200)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|))<!-- -->((#ifexpr:((({2|2))}>1300)=1|((Multi/1|((Multi/1|(({1))}|10))|10))|)))) And this for 139 repeatings: {#ifexpr:((({2|2))}<=10)=1|((Multi/1|(({1))}|(({2|2))))}|((Multi/1|(({1))}|((#expr:(({2|2))}-(((#expr:floor((({2|2))}/10) round 0))*10)))))<!-- -->((Multi/1|((Multi/1|(({1))}|10))|((#expr:floor((({2|2))}/10) round 0)))))) With the "Multi/1" being ((#replace:((rmv|1|((#expr:(10^(({2|2))})))))|0|(({1))))} (the rmv template has ((#replace:(({2))}|(({1))}|))) |
As you can see this is a shorter code than what is currently on the template(1355+57=1412 bytes instead of 5927 bytes) and it repeats almost 10 times as much. Joeytje50 (talk) 20:36, 21 November 2010 (UTC)
Is there anyway to use a Loop template or a module inside of a template that calls other templates and knows what the loop counter is? I want to ((#expr:((Loop|((PAGESINCAT:Articles with a promotional tone from ((Months before now|<!-- current loop number -->))|pages)) + |((PAGESINCAT:Articles with a promotional tone|subcats))))0))
to give me a count of all of the subpages in that category. Can this be done? Technical 13 (talk)
Relevant discussion: https://en.wikipedia.org/w/index.php?title=Wikipedia:Lua_requests&oldid=557697440#Template:Loop --MZMcBride (talk) 15:31, 31 May 2013 (UTC)