Sandbox92
From Metabolomics.JP
(Difference between revisions)
Line 3: | Line 3: | ||
{{{3}}} Page number (starting from 0)---> | {{{3}}} Page number (starting from 0)---> | ||
{{#def:RESULT|{{#repeat:SearchTitle|1|{{{1}}}}}}} | {{#def:RESULT|{{#repeat:SearchTitle|1|{{{1}}}}}}} | ||
+ | <!--{{#def:SIZE|{{#if:{{#var:RESULT}}|{{#expr:1+{{#count:{{#var:RESULT}}| }}}}|0}}}}--> | ||
{{#def:SIZE|{{#if:{{#var:RESULT}}|{{#expr:{{#count:{{#var:RESULT}}}}}}|0}}}} | {{#def:SIZE|{{#if:{{#var:RESULT}}|{{#expr:{{#count:{{#var:RESULT}}}}}}|0}}}} | ||
==Search Result ({{#var:SIZE}} Hits)== | ==Search Result ({{#var:SIZE}} Hits)== | ||
− | View (previous | + | View (previous {{#ifexpr: {{{3}}} <= 0 | {{{2}}} | [[{{FULLPAGENAME}}|{{{1}}}|{{{2}}}|{{#expr:{{{3}}}-1}}|{{{2}}}]]}}) (next {{#ifexpr: {{{3}}}*{{{2}}} > {{#var:SIZE}} | {{{2}}} | [[{{FULLPAGENAME}}|{{{1}}}|{{{2}}}|{{#expr:{{{3}}}+1}}|{{{2}}}]]}}) |
− | {{#ifexpr: {{{3}}} <= 0 | {{{2}}} | [[{{FULLPAGENAME}}|{{{1}}}|{{{2}}}|{{#expr:{{{3}}}-1}}|{{{2}}}]]}}) (next {{#ifexpr: {{{3}}}*{{{2}}} > {{#var:SIZE}} | {{{2}}} | [[{{FULLPAGENAME}}|{{{1}}}|{{{2}}}|{{#expr:{{{3}}}+1}}|{{{2}}}]]}}) | + | |
([[{{FULLPAGENAME}}|{{{1}}}|20|{{{3}}}|20]] | [[{{FULLPAGENAME}}|{{{1}}}|50|{{{3}}}|50]] | [[{{FULLPAGENAME}}|{{{1}}}|100|{{{3}}}|100]] | [[{{FULLPAGENAME}}|{{{1}}}|250|{{{3}}}|250]] | [[{{FULLPAGENAME}}|{{{1}}}|500|{{{3}}}|500]])<br> | ([[{{FULLPAGENAME}}|{{{1}}}|20|{{{3}}}|20]] | [[{{FULLPAGENAME}}|{{{1}}}|50|{{{3}}}|50]] | [[{{FULLPAGENAME}}|{{{1}}}|100|{{{3}}}|100]] | [[{{FULLPAGENAME}}|{{{1}}}|250|{{{3}}}|250]] | [[{{FULLPAGENAME}}|{{{1}}}|500|{{{3}}}|500]])<br> | ||
− | | }} | + | {{#repeat: Search/Item|2| |
+ | {{#lua: | ||
+ | local L = {}; | ||
+ | local start=tonumber({{{2}}})*tonumber({{{3}}}); | ||
+ | local output =""; | ||
+ | for word in stdin:gmatch("%S+") do | ||
+ | table.insert(L,word); | ||
+ | end | ||
+ | table.sort(L); | ||
+ | for idx=start+1, math.min(table.getn(L),start+tonumber({{{2}}})) do | ||
+ | output=output .. idx .. " " .. L[idx] .. " "; | ||
+ | end | ||
+ | print(output); | ||
+ | |{{#var:RESULT}} | ||
+ | }}| }} |
Latest revision as of 22:44, 25 January 2009
[edit] Search Result (0 Hits)
View (previous Expression error: Unrecognised punctuation character "{".) (next Expression error: Unrecognised punctuation character "{".)
({{{1}}}|20|{{{3}}}|20 | {{{1}}}|50|{{{3}}}|50 | {{{1}}}|100|{{{3}}}|100 | {{{1}}}|250|{{{3}}}|250 | {{{1}}}|500|{{{3}}}|500)
./lua:. /tmp/mw_ex_lua_V5Y20s:2:
attempt. to
perform. arithmetic
on. a
nil. value