Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2006
    Posts
    355

    serious error with file.delete

    when using scrip to eliminate a file by means of file.delete leaves an error to me that puts:

    Error

    C stack overflow

    some suggestion?

    thx!

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    here, i googled it and got this

    http://www.devx.com/tips/Tip/14276
    Understanding Stack Overflow
    The stack is a region of memory on which local automatic variables are created and function arguments are passed. The implementation allocates a default stack size per process. On modern operating systems, a typical stack has at least 1 megabyte, which is sufficient for most purposes. Under anomalous conditions, the program exceeds its stack limit. This causes a stack overflow. The two most common causes for a stack overflow is an infinite recursion, as in:


    int f(){
    g();
    }
    int g() {
    f();
    }

    f() calls g(), which in turn calls f() and so on. Eventually, the stack overflows. Another common cause for stack overflow is an attempt to create a large array on the stack, for example:


    int main()
    {
    int n[10000000]; // array is too large
    int j =0; //j's address exceeds the stack's limits, error
    }

    If your program crashes due to a stack overflow, check for infinite recursion or too large local objects.
    so i would take it that your code is doing to much for your machine or your code is causing a error that ams dosent pick up on and the loop is overloading your memory
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Oct 2005
    Location
    MI
    Posts
    524
    RizlaUK is right. Stack overflows are common if you create an infinite loop in your AMS script. Try posting the chunk of code in question if need help finding the problem.
    Yeah right. Who's the only one here who knows the illegal ninja moves from the government?

    ()))))))))o)))))))==============================================

  4. #4
    Join Date
    Aug 2006
    Posts
    355
    ok

    this is my code:

    Code:
    d = ListBox.GetCount("ListBox1");
    if d == 0 then
    Application.ExitScript();
    end
    
    aaa = ListBox.GetSelectedCount("ListBox1");
    if aaa == 0 then
    Dialog.Message("NONE", "none selected", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
    Application.ExitScript();
    end
    
    sel = ListBox.GetSelected("ListBox1");
    if sel then
    
    LBData = ListBox.GetItemData("ListBox1", sel[1]);
    
    File.Delete(LBData, false, false, false, nil);
    error = Application.GetLastError();
        if (error ~= 0) then
    
        ListBox.DeselectItem("ListBox1", sel[1]);
    
        gg = ListBox.GetSelectedCount("ListBox1");
            if gg == 0 then
            Dialog.Message("Error", "error deleting items", MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
            Application.ExitScript();
            end
    
    else
    
    ListBox.DeleteItem("ListBox1", sel[1]);
    
    end
    
    result = ListBox.GetSelectedCount("ListBox1");
    if result == 0 then
    else
    Page.ClickObject("Plugin7"); ------(this action returns to press plugin that has this scrip to eliminate the following selected item)
    end
    
    end
    this I cosay this based on which put RizlaUK to me to eliminate all the archives selected of listbox, by means of the multiselection

    some suggestion please?

    thx!

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    here, try this
    Last edited by RizlaUK; 02-01-2009 at 11:35 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  6. #6
    Join Date
    Aug 2006
    Posts
    355
    that example is equal for which I use, is no ningun change no?

    some suggestion to avoid the error of C stack overflow?

    thanks

  7. #7
    Join Date
    May 2006
    Posts
    5,380
    well, the strange thing is that your code works on my system causeing no errors at all, i made that example with your code

    i put 50 txt files in a folder and got them in the listbox, push the delete button and it all worked fine, i posted it for you to try so i could assess weather the problem was in this code or in another part of your project

    as there is no error on my system i can not even begin to assess what bit of code is causeing it,

    my frist question to you would be "how much ram do you have" and "whats the speed of your cpu (MHz)"
    Open your eyes to Narcissism, Don't let her destroy your life!!

  8. #8
    Join Date
    Aug 2006
    Posts
    355
    if, my code works well, but ami me aparecio that message of error and not because. my CPU pentium 4 3GH ram 1 GB

  9. #9
    Join Date
    May 2006
    Posts
    5,380
    well, it was a stab in the dark,, have a go at rewriting the function a differant way and see if you still get any error,

    or explain in detail what it is you want to do and ill try and make a example for you
    Open your eyes to Narcissism, Don't let her destroy your life!!

  10. #10
    Join Date
    Aug 2006
    Posts
    355

    Huh?

    this it is an example when it leaves this message:

    digale to autorrun that _TemFolder looks for all the archives of the folder;

    in which you previously to position a great amount of unsuitable archives (about 600 megas, divided in about 100 archives... for example, premium 7.7.5.1 unloaded Nero 7 and when going to install it all those archives they will be in _ TempFolder)

    say to autorrun that it looks for in temp and shows all the archives to him in listbox, later check all and deletting all. when it takes about 200 eliminated megas will give that error:

    error

    C stack overflow

    some suggestion?

Similar Threads

  1. File.Delete PROBLEM
    By DjArko85 in forum AutoPlay Media Studio 6.0
    Replies: 6
    Last Post: 09-20-2006, 03:16 PM
  2. Serious AM6 Security Issue Question
    By travisperkins in forum AutoPlay Media Studio 6.0
    Replies: 17
    Last Post: 03-27-2006, 05:16 PM
  3. File.Delete(, true)
    By jassing in forum Setup Factory 7.0
    Replies: 0
    Last Post: 02-06-2005, 04:48 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