Skip to content
master
Switch branches/tags
Code
This branch is 11 commits ahead of simart:master.
Contribute

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

How to Save Progress

In this program we are saving the number of times that the page has been loaded, but we could use the same technique to store any kind of progress. Processing offers two functions that allow you to read and write to a file loadStrings and saveStrings. In this program we are reading and writing to a text file called progress.txt. The first time a user visits the page, we load the number 1 from progress.txt and display it to the screen. Then we increment the counter and save the increased value using saveStrings.

When we save the increased value, it is stored in the users web browser cache, not in the progress.txt on the website. This is called HTML storage or Web storage. This means that each users progress will be saved independently of any other users. Note that the size of the stored data is limited to 5Mb.

About

No description, website, or topics provided.

Resources

Releases

No releases published

Packages

No packages published

Languages