Results 1 to 2 of 2

Thread: Continuing loop

  1. #1

    Thread Starter
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Continuing loop

    I've set up a basic loop to delete all the files in a particular folder. I've set the loop in a Try block so it doesn't crash the application when it gets to a file it can't delete.

    I'd like for the app to just pass over these type of files. At the moment, my loop stops completely when it gets to that exception.

    Can anyone provide me with any general information on how to accomplish? I thought this would be pretty straightforward so I don't think it will require me to post any code, but I can if needed.

    Thanks
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Continuing loop

    Your mistake is this:
    I've set the loop in a Try block
    It should be the other way around. Once the Try block completes you want the loop to continue, therefore the Try block must be inside the loop.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Click Here to Expand Forum to Full Width