Volatile:Search
From Metabolomics.JP
(Difference between revisions)
(27 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
+ | <!--- {{{1}}} ID numbers to search | ||
+ | {{{2}}} Result size per page | ||
+ | {{{3}}} Page number (starting from 0)---> | ||
{{#def:RESULT|{{#repeat:SearchTitle|1|{{{1}}}}}}} | {{#def:RESULT|{{#repeat:SearchTitle|1|{{{1}}}}}}} | ||
− | {{#def:SIZE|{{{ | + | <!--{{#def:SIZE|{{#if:{{#var:RESULT}}|{{#expr:1+{{#count:{{#var:RESULT}}| }}}}|0}}}}--> |
− | {{#def: | + | {{#def:SIZE|{{#if:{{#var:RESULT}}|{{#expr:{{#count:{{#var:RESULT}}}}}}|0}}}} |
+ | {{#def:ID|{{#encode:{{{1|}}}}}}} | ||
+ | ==Search Result ({{#var:SIZE}} Hits)== | ||
+ | View (previous {{#ifexpr: {{{3}}} <= 0 | {{{2}}} | [[{{FULLPAGENAME}}|{{#var:ID}}|{{{2}}}|{{#expr:{{{3}}}-1}}|{{{2}}}]]}}) (next {{#ifexpr: {{{3}}}*{{{2}}} > {{#var:SIZE}} | {{{2}}} | [[{{FULLPAGENAME}}|{{#var:ID}}|{{{2}}}|{{#expr:{{{3}}}+1}}|{{{2}}}]]}}) | ||
+ | ([[{{FULLPAGENAME}}|{{#var:ID}}|20|{{{3}}}|20]] | [[{{FULLPAGENAME}}|{{#var:ID}}|50|{{{3}}}|50]] | [[{{FULLPAGENAME}}|{{#var:ID}}|100|{{{3}}}|100]] | [[{{FULLPAGENAME}}|{{#var:ID}}|250|{{{3}}}|250]] | [[{{FULLPAGENAME}}|{{#var:ID}}|500|{{{3}}}|500]])<br> | ||
+ | {{#repeat: Search/Item|2| | ||
{{#lua: | {{#lua: | ||
local L = {}; | local L = {}; | ||
− | local | + | local start=tonumber({{{2}}})*tonumber({{{3}}}); |
− | + | local output =""; | |
− | local | + | |
for word in stdin:gmatch("%S+") do | for word in stdin:gmatch("%S+") do | ||
table.insert(L,word); | table.insert(L,word); | ||
end | end | ||
table.sort(L); | 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}} | |{{#var:RESULT}} | ||
− | }} | + | }}| }} |
Latest revision as of 21:12, 26 January 2009
[edit] Search Result (0 Hits)
View (previous Expression error: Unexpected <= operator.) (next Expression error: Unexpected * operator.)
(20 | 50 | 100 | 250 | 500)
./lua:. /tmp/mw_ex_lua_g66Qkv:2:
bad. argument