Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173

    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. #2
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173
    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

  3. #3
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173
    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!!

  4. #4
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    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 ]]

  5. #5
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173
    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!

  6. #6
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    173
    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

Similar Threads

  1. Can anyone help with System.GetLANInfo ???
    By Brunzwick in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 04-12-2004, 06:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts