PDA

View Full Version : Making Data Persist Across Sessions


Desmond
09-26-2003, 02:08 PM
<HTML> <HEAD> <TITLE>Making Data Persist Across Sessions</TITLE> </HEAD> <BODY> <h3>Making Data Persist Across Sessions</h3> <b>Document ID: IR10037</b> <hr> The information in this article applies to: <ul> <li>AutoPlay Media Studio 5.0 Standard Edition</li> <li>AutoPlay Media Studio 5.0 Professional Edition</li> </ul> <hr> <h3>SUMMARY</h3> <p>This article describes how to persist data across sessions. </p> <h3>DISCUSSION</h3> <p>It is often nice to add a personal touch to your Application, such as greeting the user by name whenever your application is run.<br> <br> As an example, we will create an application that prompts the user for their name the first time it is run, and stores that data in the registry. Every subsequent time that the application is run, it will greet the user with the name that they have inputted:<br> <br> Place the following code in your Project's On Startup event:<code><pre>user = Application.LoadValue("Information", "Name");
<br />
<br />if user == "" then
<br /> user = "Unknown User";
<br /> user = Dialog.Input("Information Requested", "Please enter your full name:", "", MB_ICONQUESTION);
<br /> Application.SaveValue("Information", "Name", user);
<br />end
<br />
<br />Dialog.Message("Welcome", "Hello "..user..", welcome to my application");</pre></code> <br> This example prompts the user to enter their full name the first time they run your application, and stores that value in the registry. Every subsequent time that the user runs your application a message will pop up on the screen greeting them by name.<br> <h3>MORE INFORMATION</h3> <p>For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:</p> <ul> <li><b>Program Reference | Actions | Application | Application.LoadValue</b></li> <li><b>Program Reference | Actions | Application | Application.SaveValue</b></li> </ul> <p>KEYWORDS: AutoPlay Media Studio 5.0, Actions, Load, Save, Persist, Sessions, Remember </p> <hr> <FONT SIZE=1> Last reviewed: September 26, 2003<br> Copyright © 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br> </FONT> </BODY> </HTML>