Solved

retaining a variables value after the application has quit

Posted on 2009-04-03
3
226 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
3 Comments
 
LVL 16

Expert Comment

by:CuteBug
Comment Utility
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
Comment Utility
ok that sounds easy enough but how do u create a config file? is it just a text file?
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

With Windows Embedded Handheld, called Windows Mobile, Microsoft re-designed the user interface. The Start Icon moved down to the bottom, inside the menu bar area.   If you need to hide the Start Icon and/or the SIP (soft input panel, softwar…
A short article about problems I had with the new location API and permissions in Marshmallow
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now