Topic on Extension talk:Loops

95.157.239.252 (talkcontribs)

Hello, sorry for my bad english ^^. So, i installed with success the loops extension, but, on my wiki's pages, an error appear about the maxloops:"Maximum number of loops have been performed". But i set '-1' to the $maxloops in Loops.php file so i don't understand why he return me this error because normaly, if i set "-1" to the $MaxLoops, there is no limit for loops no??

Danwe (talkcontribs)

Check the spelling of your variable, it is ExtLoops::$maxLoops

95.157.233.100 (talkcontribs)

hello, i checked and my variable is well spelt $maxLoops. whatever the value added (-1 or 4000), it doesn't change anything. If i put the $maxLoops at -1 in the localsetting.php file, it doesn't change anything, but once i put a positive value and the error message disappear to be replaced by another message (i have too many templates called)

Here is the sourcecode of the template:

<includeonly><div style="display:none"> {{#vardefine:nt|{{lc:{{{nation}}}}}}} {{#vardefine:i|1}} {{#vardefine:tr|0}} {{#vardefine:nm|0}} {{#vardefine:ar|0}} {{#vardefine:tt|0}} {{#vardefine:vr|0}} {{#vardefine:pr|0}} {{#vardefine:wt|0}} {{#vardefine:cm|0}} {{#switch:{{#var:nt}}|usa={{#vardefine:nt|[[image:graffiti_stickers_usa_a.png|40px|link=|]] Tourelles Américaines}}|allemagne={{#vardefine:nt|[[image:graffiti_stickers_germany_s.png|40px|link=|]] Tourelles Allemandes}}|france={{#vardefine:nt|[[image:Graffiti_stickers_france_A.png|40px|link=|]] French Turrets}}|ussr={{#vardefine:nt|[[image:Graffiti_stickers_ussr_S.png|40px|link=|]] Soviet Turrets}}|china={{#vardefine:nt|[[image:Graffiti_stickers_china.png|40px|link=|]] Chinese Turrets}}|uk={{#vardefine:nt|[[image:Graffiti_stickers_uk.png|40px|link=|]] British Turrets}}|#default={{#vardefine:nt|Turrets}}}}</div> <div id="Panel" class="ModuleList"> <h3>{{#var:nt}}</h3> <table class="sortable" style="text-indent:0;"> <tr class="titlebar"> <th style="min-width:55px">Tier</th> <th style="min-width:70px">Name</th> <th style="min-width:5px">Armor</th> <th style="min-width:125px">Turret Traverse</th> <th style="min-width:105px">View Range</th> <th style="min-width:65px">Price</th> <th style="min-width:75px">Weight</th> <th class="unsortable" style="max-width:50%">Compatibility</th> </tr> {{#while:|{{#if:{{{{{#var:i}}|}}}|true}} |{{#if:{{#explode:{{{{{#var:i}}|}}}|,|8}}|<tr><td><p class="error">too many variables</p></td></tr>| {{#if:{{#explode:{{{{{#var:i}}|}}}|,|7}} |{{#switch:{{#explode:{{{{{#var:i}}|}}}|,|1}}|1={{#vardefine:tr|<span style="display:none">01</span>I}}|2={{#vardefine:tr|<span style="display:none">02</span>II}}|3={{#vardefine:tr|<span style="display:none">03</span>III}}|4={{#vardefine:tr|<span style="display:none">04</span>IV}}|5={{#vardefine:tr|<span style="display:none">05</span>V}}|6={{#vardefine:tr|<span style="display:none">06</span>VI}}|7={{#vardefine:tr|<span style="display:none">07</span>VII}}|8={{#vardefine:tr|<span style="display:none">08</span>VIII}}|9={{#vardefine:tr|<span style="display:none">09</span>IX}}|10={{#vardefine:tr|<span style="display:none">10</span>X}}|#default={{#vardefine:tr|error}}}} {{#vardefine:nm|{{#explode:{{{{{#var:i}}|}}}|,|0}}}} {{#vardefine:ar|{{#explode:{{{{{#var:i}}|}}}|,|2}}}} {{#vardefine:tt|{{#explode:{{{{{#var:i}}|}}}|,|3}}}} {{#vardefine:vr|{{#explode:{{{{{#var:i}}|}}}|,|4}}}} {{#vardefine:pr|{{#explode:{{{{{#var:i}}|}}}|,|5}}}} {{#vardefine:wt|{{#explode:{{{{{#var:i}}|}}}|,|6}}}} {{#vardefine:cm|{{#explode:{{{{{#var:i}}|}}}|,|7}}}} <tr><td><center><span style="color:orange"><b>{{#var:tr}}</b></span></center></td> <td><center><div id="{{#var:nm}}"></div><b>{{#var:nm}}</b></center></td> <td><center><span style="display:none">{{padleft:{{#var:ar}}|9|0}} </span>{{#var:ar}}<span style="color:gray"> mm</span></center></td> <td><center><span style="display:none">{{padleft:{{#var:tt}}|3|0}} </span>{{#var:tt}}<span style="color:gray"> deg/sec</span></center></td> <td><center><span style="display:none">{{padleft:{{#var:vr}}|4|0}} </span>{{#var:vr}}<span style="color:gray"> m</span></center></td> {{#ifeq:{{#var:pr}}|premium |<td><center><span style="display:none">0 </span><span style="opacity:0.8">[[image:PremiumIcon.png|link=]]</span></center></td> |<td><center><span style="display:none">{{padleft:{{#var:pr}}|9|0}} </span>{{f2Num|{{#var:pr}}}}<span style="opacity:0.8"> [[image:Credits.png|link=|]]</span></center></td>}} <td><center><span style="display:none">{{padleft:{{#var:wt}}|8|0}} </span>{{f2Num|{{#var:wt}}}}<span style="color:gray"> kg</span></center></td> <td>{{#var:cm}}</td></tr> |<tr><td></td><td><p class="error">too few variables</p></td></tr> }}}} {{#vardefine:i|{{#expr:{{#var:i}}+1}}}} }} </table></div>__NOTOC__ </includeonly><noinclude> ==Notes== *If you have too few or too many variables the module name will be in red. *Continue to add | (pipes) to how ever many modules you need. *Place variables in order, separated by a comma. **name = name of the module **tier = tier of the module, acceptable only numbers(1,2,..,10) **armor = turret armor, in millimeters, do not include "(mm)" **turret traverse = the turret traverse speed, in degrees per second, do not include "(deg/sec)" **view range = th turret view range, in meters, no not include "(m)" **price = price of the module, in credits **weight = weight of the module, in kilograms, do not include "(kg)" **compatibility = the vehicle(s) the module is compatible with, arranged by tier, then alphabetically, use <nowiki>{{Link|"exact pagename"}}.

Template

{{Turret
<!--|name, tier, armor, turret traverse, view range, price, weight, compatibility-->
|name, tier, armor, turret traverse, view range, price, weight, compatibility
}}

</nowiki>

Danwe (talkcontribs)

Should be the other way around, if you put 4000 as the value, the message about the max number of loops should show. Are you sure it is not this way around?

About your other error message: This might be an indicator for running into an endless loop. Check whether you poperly redefine your var i. Or better, use #forargs or #fornumargs instead.

95.157.233.100 (talkcontribs)

no, if i put -1 , the message about the max number of loops appear. but i don't understand how use forargs or fornumargs.

192.171.4.126 (talkcontribs)

ExtLoops::maxLoopsPerformed is buggy. Should be something like

public static function maxLoopsPerformed( Parser &$parser ) {
	$count = $parser->mExtLoopsCounter;
	return self::$maxLoops > -1 && $count >= self::$maxLoops;
}
Reply to "Maxloops error??"