Solved

retaining a variables value after the application has quit

Posted on 2009-04-03
3
236 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
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 85

Accepted Solution

by:
Mike Tomlinson earned 500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Preface: This article is part of a series focused on cross platform mobile app development (specifically Android and iOS) using the Alloy framework and Titanium Studio made by Appcelerator (https://www.appcelerator.com/). This article presumes a wor…
If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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