?
Solved

retaining a variables value after the application has quit

Posted on 2009-04-03
3
Medium Priority
?
253 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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…
Learn how to use the free Acronis True Image app to easily transfer data between iPhones and Android phones.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

765 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