when project preview, when the following code is executing the 1st tme everything is fine but when executing a second time (that code is assigned to a refresh button) i am getting the following error: "attempt to index a string value". Please help, that is the last error i need to fix before publishing my app.
code is below:
Page.StartTimer(100);
Plugin.SetVisible("Plugin1", true);
--
File.Run("Bin\\acclist.BAT", insightsystem, "Bin", SW_MINIMIZE, true);
--
------------------------------------------------Parsing the text file
--
ParseTable ={}
txt_table2={}
--ParseFile="Siemens.txt"
--ParseFolder=_SourceFolder.."\\Autoplay\\Docs\\"
ParseText="LoginName"
ParseTable = TextFile.ReadToTable("Bin\\acclist.txt");
TableLines = Table.Count(ParseTable);
--
--
--Progress.SetStep("Plugin1", 10);
--
for count = 1, TableLines do
if (String.Find(ParseTable[count], ParseText, 1, false))~=(-1) then
count=count+1;
pass1 = ParseTable[count];
pass2 = String.TrimLeft(pass1, nil);
pass3 = String.Replace(pass2, "_VS =", "", false);
pass4 = String.Replace(pass3, "\\000", "", false);
pass5 = String.Replace(pass4, "\\\\", "\\", false);
pass6 = String.Replace(pass5, "\"", "", false);
pass7 = String.TrimLeft(pass6, nil);
--
--
if (pass7 ~= "SYSTEM")and(pass7 ~= "INSIGHT")then
result = ListBox.AddItem("Account List", pass7, "");
end
end
end
Page.StopTimer();
Progress.SetCurrentPos("Plugin1", 100);
Plugin.SetVisible("Plugin1", false);
Paragraph.SetVisible("Text5_initial", true);
code is below:
Page.StartTimer(100);
Plugin.SetVisible("Plugin1", true);
--
File.Run("Bin\\acclist.BAT", insightsystem, "Bin", SW_MINIMIZE, true);
--
------------------------------------------------Parsing the text file
--
ParseTable ={}
txt_table2={}
--ParseFile="Siemens.txt"
--ParseFolder=_SourceFolder.."\\Autoplay\\Docs\\"
ParseText="LoginName"
ParseTable = TextFile.ReadToTable("Bin\\acclist.txt");
TableLines = Table.Count(ParseTable);
--
--
--Progress.SetStep("Plugin1", 10);
--
for count = 1, TableLines do
if (String.Find(ParseTable[count], ParseText, 1, false))~=(-1) then
count=count+1;
pass1 = ParseTable[count];
pass2 = String.TrimLeft(pass1, nil);
pass3 = String.Replace(pass2, "_VS =", "", false);
pass4 = String.Replace(pass3, "\\000", "", false);
pass5 = String.Replace(pass4, "\\\\", "\\", false);
pass6 = String.Replace(pass5, "\"", "", false);
pass7 = String.TrimLeft(pass6, nil);
--
--
if (pass7 ~= "SYSTEM")and(pass7 ~= "INSIGHT")then
result = ListBox.AddItem("Account List", pass7, "");
end
end
end
Page.StopTimer();
Progress.SetCurrentPos("Plugin1", 100);
Plugin.SetVisible("Plugin1", false);
Paragraph.SetVisible("Text5_initial", true);
Comment