Andromo - Start Making Apps - Free Signup

Announcement

Collapse
No announcement yet.

need help with error

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • need help with error

    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);

  • #2
    Anyone??

    The problem is that there is no line number referenced in the error meaasge that pops up! If at least i had a way to get more details on the error such as which line is causing that error, that would be a good start.


    thanks

    Comment


    • #3
      by using the debug trace feature it tell me that this is the line


      if (String.Find(_ParseTable[count], ParseText, 1, false))~=(-1) then


      that is causing the error!!! Just dont know what is wrong with it!!

      Comment


      • #4
        Is the variable named _ParseTable or ParseTable? You used it both ways above...

        Code:
        if (String.Find(_ParseTable[count], ParseText, 1, false))~=(-1) then
        I'm thinking you need this:

        Code:
        if (String.Find(ParseTable[count], ParseText, 1, false))~=(-1) then
        --[[ Indigo Rose Software Developer ]]

        Comment


        • #5
          Hi Lorne

          Noo it is just that after my 1st post above, i tried to change the name of the variable by adding an underscore cause stefan suspected that AMS had maybe a problem with some variable names. But it still doesnt work. I am really scratching my head with this problem!! I dont see what is wrong!

          Comment


          • #6
            arggggg! i found what it was! i used the same variable name for 2 different use, variable named "string" was causing that!!! I must put more attention on what variable names i am using!


            thanks guys

            Comment

            Working...
            X