This module is rated as ready for general use. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing. |
This module checks all positional parameters to see if any of them is equal to the parameter "value". If so, it will output "yes", otherwise "no".
{{#invoke:If any equal|main|a|b|c|d|value=c}}
gives yes{{#invoke:If any equal|main|a|b|c|d|value=r}}
gives no{{#invoke:If any equal|main|a|b|c|d|value=}}
gives no
require('strict')
local p = {}
p.main = function(frame)
local match = false
for name, value in pairs(frame.args) do
if type(name)=='number' and value:lower()==frame.args.value:lower() then
match = true
break
end
end
return match and 'yes' or 'no'
end
return p