Module:SPageString.lua

From Guild of Archivists
Revision as of 07:26, 30 October 2015 by Alahmnat (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:SPageString.lua/doc

local p = {}
p.bigStr = [[
|01001=22.4
|01002=17.3
|01004=21.1
|01005=20.0
|01006=9.3
]]
function p.lookUp(frame)
    p.lookFor = frame.args[1]
    p.result = 'Hello, my ' .. frame.args[1] .. ' is ' .. frame.args[2] .. ' and my bigStr len is ' .. string.len( p.bigStr )
    p.findStr = '|' .. p.lookFor .. '='
    p.begin, p.ending = string.find( p.bigStr, p.findStr )
    p.result = p.result .. 'findStr=' .. p.findStr .. 'begin and end=' .. p.begin .. ',' .. p.ending
    return p.result
end
return p