• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

While inside try/catch...

Enthusiast ,
Nov 21, 2014 Nov 21, 2014

Copy link to clipboard

Copied

I have this method:

private function rewriteQueue():void {

  try{

    var file:File = File.applicationStorageDirectory.resolvePath( DATA_FILE_NAME );

    file.deleteFile();

   while (users.length) {

     var aUser:Object = users.shift();

     writeUser(aUser);

    }

   }catch (e:Error) {

   }

}

That doesn't work and I'm just not sure why. Putting the while outside of the try/catch fixes it... but why?

TOPICS
ActionScript

Views

241

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 21, 2014 Nov 21, 2014

Copy link to clipboard

Copied

LATEST

OK, I figured out why the problem was occurring. It happened when there was no file to delete - the deleteFile() failed - also causing the while to not execute. My bad.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines