read data from commandline arg
This commit is contained in:
parent
08875d0094
commit
a4e2eb65e8
|
@ -1,4 +1,5 @@
|
|||
Data = {
|
||||
-- example standings during the 2023 Cricket World Cup
|
||||
Ind={Pak=2, Aus=2},
|
||||
NZ={Eng=2},
|
||||
SA={Aus=2, SL=2},
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
on.initialize = function(arg)
|
||||
if #arg > 0 then
|
||||
Results_filename = absolutize(arg[1])
|
||||
Data = load_results(Results_filename)
|
||||
end
|
||||
Rows = ordered_keys(Data)
|
||||
end
|
||||
end
|
|
@ -1,4 +1,6 @@
|
|||
on.code_change = function()
|
||||
Data = load_results(App.current_dir..'results')
|
||||
if Results_filename then
|
||||
Data = load_results(Results_filename)
|
||||
end
|
||||
Rows = ordered_keys(Data)
|
||||
end
|
|
@ -0,0 +1,2 @@
|
|||
-- Filename to maintain results in
|
||||
Results_filename = nil
|
|
@ -0,0 +1,6 @@
|
|||
absolutize = function(path)
|
||||
if is_relative_path(path) then
|
||||
return App.current_dir..path
|
||||
end
|
||||
return path
|
||||
end
|
Loading…
Reference in New Issue