Modul:HelloWorld: Unterschied zwischen den Versionen
Aus SchnuppTrupp
K |
K |
||
| Zeile 9: | Zeile 9: | ||
function p.len(frame) | function p.len(frame) | ||
local value = frame.args[1] | local value = frame.args[1] | ||
| − | local count = | + | local count = mw.string.len(value) |
return 'Das Wort ' .. value .. ' hat ' .. count .. ' Buchstaben' | return 'Das Wort ' .. value .. ' hat ' .. count .. ' Buchstaben' | ||
end | end | ||
return p | return p | ||
Version vom 24. September 2015, 20:21 Uhr
Die Dokumentation für dieses Modul kann unter Modul:HelloWorld/Doku erstellt werden
local p = {}
function p.hello(frame)
local name = frame.args[1]
if not name then
name = 'Welt'
end
return 'Hallo, ' .. name .. '! Dies ist Lua!'
end
function p.len(frame)
local value = frame.args[1]
local count = mw.string.len(value)
return 'Das Wort ' .. value .. ' hat ' .. count .. ' Buchstaben'
end
return p