Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8942379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:30:02+00:00 2026-06-15T11:30:02+00:00

Writing a Windows 8 app in Javascript using Visual Studio Express. I’m not sure

  • 0

Writing a Windows 8 app in Javascript using Visual Studio Express. I’m not sure if I am missing a chaining dependency or something else, but I am giving my game users the ability to save their progress into a file (at least that’s the idea). However when I run the following code it appears that even though I can see the file out there, the file pointer is turning out to be undefined. See anything I’m missing?

var myStats = new Array();
myStats[0] = myTitle;
myStats[1] = currPage;
myStats[2] = currStep;
myStats[3] = currTune;
myStats[4] = musicon;
myStats[5] = gameComplete;

var save01File = null;

            Windows.Storage.KnownFolders.documentsLibrary.createFileAsync("Asave01.dat", Windows.Storage.CreationCollisionOption.replaceExisting).done(

                function (file) {
                    save01File = file;
                },
                function (error) {
                    WinJS.log && WinJS.log(error, "sample", "error");
                });
            Windows.Storage.FileIO.writeLinesAsync(save01File, myStats).done(
                function () {
                },
            function (error) {
                WinJS.log && WinJS.log(error, "sample", "error");
                errCount++;
            });
            if (errCount == 0) {
                fileMenuTitle.text = "File Saved - Click Cancel";
                fileMenuTitle.text = fileMenuTitle.text + "\nto Return or Select Another File to Load";
                fileMenuTitle.color = "green";
            }
            else {
                fileMenuTitle.text = "There was an error saving that file.";
                fileMenuTitle.text = fileMenuTitle.text + "\nPlease Make Another Selection.";
                fileMenuTitle.color = "firebrick";
            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:30:03+00:00Added an answer on June 15, 2026 at 11:30 am

    You need to use the promise pattern here:

    var myStats = new Array();
    myStats[0] = myTitle;
    myStats[1] = currPage;
    myStats[2] = currStep;
    myStats[3] = currTune;
    myStats[4] = musicon;
    myStats[5] = gameComplete;
    
    var save01File = null;
    
    Windows.Storage.KnownFolders.documentsLibrary.createFileAsync("Asave01.dat", Windows.Storage.CreationCollisionOption.replaceExisting).then(function (file) {
        save01File = file;
        return Windows.Storage.FileIO.writeLinesAsync(file, myStats);
    }).done(function() {
        fileMenuTitle.text = "File Saved - Click Cancel";
        fileMenuTitle.text = fileMenuTitle.text + "\nto Return or Select Another File to Load";
        fileMenuTitle.color = "green";
    }, function (error) {
        WinJS.log && WinJS.log(error, "sample", "error");
        fileMenuTitle.text = "There was an error saving that file.";
        fileMenuTitle.text = fileMenuTitle.text + "\nPlease Make Another Selection.";
        fileMenuTitle.color = "firebrick";
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a Windows Forms app in C#, using Visual Studio 2010. It has
I'm writing a Windows 8 app in C# using visual studio 2012 Ultimate. When
I am writing a Windows 7 Phone App on Visual Studio Express, and I
I am writing my first windows ce app. I am using an xml file
We're writing a mobile app using jQuery mobile and do most of the javascript
I'm writing a windows 8 app and I'm using jQuery. I have the following
I'm writing a JavaScript/HTML5 Windows 8 app. I occasionally get a InvalidStateError when writing
I'm writing a windows app using x64 windows. On the dev machine I can
I'm writing my first Windows CE app using the .NET Compact Framework v3.5. I
I'm writing a windows phone app and I would like to implement a tap

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.