Skip to content

APCSLowell/SaveProgress

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • JavaScript 99.9%
  • Other 0.1%