Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

retaining a variables value after the application has quit

Posted on 2009-04-03
3
Medium Priority
?
257 Views
Last Modified: 2013-12-27
So I am developing an application for a Windows Mobile Device.  In visual studio it is a Pocket PC 2003 Project.  This application brings up the camera, and saves pictures as a filename that i have specified.  I want to number the images in the order they were taken, but the problem is, when a user quits the program the number variable that gets in the filename gets reset, is there a way for me to initialize this variable once and have it retain its value the next time the user starts the program so that the images are numbered in sequential order?
0
Comment
Question by:bquinn10
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Expert Comment

by:CuteBug
ID: 24060515
Create a config file for the application and store the latest value of the variable when the application quits.

When the application is started, check if the config file exists:
If it does, retrieve the value and assign it to the variable.
If it does not, initialize the variable, create a new config file and store the value in the file.
0
 

Author Comment

by:bquinn10
ID: 24060528
ok that sounds easy enough but how do u create a config file? is it just a text file?
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 24060848
Yes...a "config" file is just a text file with the data formatted in it however you choose.

Another option is to query the system and look at all the existing files that match your pattern...and then determine the next available number based on what is already present on the system.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question