Difference between revisions of "Sequence"
From Sega Retro
Line 11: | Line 11: | ||
and then do a string replace on "$1" (Notepad++ uses $x for regex subtitutey bits). I tried doing a string replace on <nowiki>{{#var:{{{1|}}}}}</nowiki> but Mediawiki wasn't having it -[[User:Black Squirrel|Black Squirrel]] ([[User talk:Black Squirrel|talk]]) 14:58, 6 February 2018 (CST) | and then do a string replace on "$1" (Notepad++ uses $x for regex subtitutey bits). I tried doing a string replace on <nowiki>{{#var:{{{1|}}}}}</nowiki> but Mediawiki wasn't having it -[[User:Black Squirrel|Black Squirrel]] ([[User talk:Black Squirrel|talk]]) 14:58, 6 February 2018 (CST) | ||
: Same thing happens if I put <nowiki>{{{4}}}</nowiki> in a variable first. It seems like you can't have variables inside variables/params or something. - [[User:Hivebrain|Hivebrain]] ([[User talk:Hivebrain|talk]]) 15:08, 6 February 2018 (CST) | : Same thing happens if I put <nowiki>{{{4}}}</nowiki> in a variable first. It seems like you can't have variables inside variables/params or something. - [[User:Hivebrain|Hivebrain]] ([[User talk:Hivebrain|talk]]) 15:08, 6 February 2018 (CST) | ||
+ | :: I got it to work for unformatted text, so no expressions or templates, which makes its usefulness rather limited. Maybe one day loops will be updated to fix the variables incompatibility. - [[User:Hivebrain|Hivebrain]] ([[User talk:Hivebrain|talk]]) 11:50, 8 February 2018 (CST) |
Revision as of 12:50, 8 February 2018
I think the problem is actually {{{4}}}
it appears that Mediawiki only evaluates arguments once, and it only does that when it finds a reference to one in the code. So it's getting to {{{4}}} on the first loop, evaluating the argument, replacing the {{#var:region}} bit with "jp" and then doing nothing on the subsequent loops because in its mind, {{{4}}} has already been evaluated (so it just substitutes subsequent 4s with the one it's already done).
I don't know how you'd get around it - my only thought is to do something like this
{{sequence|region|,|jp,us,eu| * md_date_$1 }}
and then do a string replace on "$1" (Notepad++ uses $x for regex subtitutey bits). I tried doing a string replace on {{#var:{{{1|}}}}} but Mediawiki wasn't having it -Black Squirrel (talk) 14:58, 6 February 2018 (CST)