Volatile:Search

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
 
(28 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|{{{2|50}}}}}
+
<!--{{#def:SIZE|{{#if:{{#var:RESULT}}|{{#expr:1+{{#count:{{#var:RESULT}}|&#160;}}}}|0}}}}-->
{{#def:PAGE|{{{3|1}}}}}
+
{{#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 size = SIZE;
+
   local start=tonumber({{{2}}})*tonumber({{{3}}});
  local page = PAGE;
+
  local output ="";
   local start = tonumber(size)*tonumber(page);
+
 
   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);
   print(start);
+
   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}}
}}
+
}}|&#160;}}

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_sI8NiO:2:  
bad.   argument  

  1. 1.   to  
    'tonumber'.   (value  
    expected).   [[{{{2}}}]]  
Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox