Module:Sports table: Difference between revisions

Content deleted Content added
Add tostring
Print it a different way
Line 48:
-- Declare status options
local status_code, status_called = {}
-- ------------------------------------------------------------
-- NOTE: If you add to status_code, also add to status_called and status_letters!!
-- Or functionality will be compromised
-- ------------------------------------------------------------
status_code = { A='Advances to a further round', C='Champion', D='Disqualified',
E='Eliminated', O='Play-off winner', P='Promoted', Q='Qualified to the phase indicated',
Line 53 ⟶ 57:
status_called = { A=false, C=false, D=false, E=false, O=false, P=false, Q=false,
R=false, T=false}
local status_letters = 'ACDEOPQRT'
-- Read in number of consecutive teams (ignore entries after skipping a spot)
Line 411 ⟶ 416:
local status_exist = false
local status_string = ''
for key,jjj value= in pairs1,mw.ustring.len(status_calledstatus_letters) do
curr_letter = mw.ustring.upper(mw.ustring.sub(status_letters,jjj,jjj))
-- Get letter in key and true/false in value
if status_called[curr_letter] then
table.insert(t_footer,'<br>key='..key..'; value='..tostring(value)..'; code='..status_code[key]) -- TEST LINE, REMOVE LATER
status_string = '<span style="font-weight:bold">('..keycurr_letter..')</span> '..status_code[keycurr_letter]..'; '
if value then
status_string = '<span style="font-weight:bold">('..key..')</span> '..status_code[key]..'; '
status_exist = true
end