I populate table "all_stations_table" like this:
this_station_table = {};
this_station_table.FtpUsername = SessionVar.Expand("%FtpUsername%");
this_station_table.FtpPassword = SessionVar.Expand("%FtpPassword%");
this_station_table.DestinationFolderPath = SessionVar.Expand("%DestinationFolderPath%");
this_station_table.Comment = SessionVar.Expand("%Comment%");
Table.Insert(all_stations_table, Table.Count(all_stations_table)+1, this_station_table);
I can successfully retrieve individual stations like this:
Dialog.Message("First station", all_stations_table[1].FtpUsername..all_stations_table[1].FtpPassword..all_stations_table[1].DestinationFolderPath..all_stations_table[1].Comment);
Dialog.Message("Second station", all_stations_table[2].FtpUsername..all_stations_table[2].FtpPassword..all_stations_table[2].DestinationFolderPath..all_stations_table[2].Comment);
I tried to create a function to display each value of each station:
function DisplayValuesForAllStations()
for index,value in pairs(all_stations_table) do
each_station_table = {}; --declare a new table to store each row
each_station_table[index] = value;
for thisStationIndex,thisStationValue in pairs(each_station_table) do
Dialog.Message("Table Item", thisStationIndex .. "=" .. thisStationValue);
end
end
end
When I call that function, however, I get this error:
Why would those two Dialog.Message calls (shown above in blue) work - and that function fail?
Thank you!
this_station_table = {};
this_station_table.FtpUsername = SessionVar.Expand("%FtpUsername%");
this_station_table.FtpPassword = SessionVar.Expand("%FtpPassword%");
this_station_table.DestinationFolderPath = SessionVar.Expand("%DestinationFolderPath%");
this_station_table.Comment = SessionVar.Expand("%Comment%");
Table.Insert(all_stations_table, Table.Count(all_stations_table)+1, this_station_table);
I can successfully retrieve individual stations like this:
Dialog.Message("First station", all_stations_table[1].FtpUsername..all_stations_table[1].FtpPassword..all_stations_table[1].DestinationFolderPath..all_stations_table[1].Comment);
Dialog.Message("Second station", all_stations_table[2].FtpUsername..all_stations_table[2].FtpPassword..all_stations_table[2].DestinationFolderPath..all_stations_table[2].Comment);
I tried to create a function to display each value of each station:
function DisplayValuesForAllStations()
for index,value in pairs(all_stations_table) do
each_station_table = {}; --declare a new table to store each row
each_station_table[index] = value;
for thisStationIndex,thisStationValue in pairs(each_station_table) do
Dialog.Message("Table Item", thisStationIndex .. "=" .. thisStationValue);
end
end
end
When I call that function, however, I get this error:
Attempt to call global 'DisplayValuesForAllStations' (a nil value)
Why would those two Dialog.Message calls (shown above in blue) work - and that function fail?
Thank you!
Comment