مندرجات کا رخ کریں

ماڈیول:If empty

From ورلڈپیڈیا, the free encyclopedia
نظرثانی بتاریخ 00:51، 24 دسمبر 2014ء از enwiki>Codehydro (lua doesn't cast nil into blank strings apparently)

"اس ماڈیول کی دستاویز ماڈیول:If empty/دستاویز پر بنائی جاسکتی ہے"

-- this is intended to replace {{If empty}}
local p = {};
function p.run(frame)
	local args = require('Module:Arguments').getArgs(frame)
	local i = 0
	args[table.getn(args)] = ''
	while args[i] == nil or string.len(args[i]) == 0 do
		i = i + 1
	end
	return args[i]
end
return p