PDA

View Full Version : Setting my Application to Expire After a Certain Date



Desmond
10-01-2003, 03:59 PM
<HTML> <HEAD> <TITLE>AutoPlay Media Studio 5.0 Knowledge Base</TITLE> </HEAD> <BODY> <h3>Setting my Application to Expire After a Certain Date</h3> <b>Document ID: IR10063</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 set your application to expire after a certain date.</p> <h3>DISCUSSION</h3> <p> To make your application expire after a certain date, set a variable in your program to the expiry date, and every time the program is run, check the current date against that value. <br> <br> To accomplish this, insert the following code into the On Startup event of your project:<pre><code>--Input your expiration date here, format YYYYMMDD
<br />--(no spaces, dashes, slashes, etc. just use numbers)
<br />--Below is the date Dec 12, 2003
<br />Expiration_Date = "20031212"
<br />
<br />--Get the system date in ISO format
<br />--Date = YYYY-MM-DD
<br />Date = System.GetDate(DATE_FMT_ISO);
<br />
<br />--Remove the dashes in the ISO format date
<br />--to reflect the format of our expiry date
<br />--Date == YYYYMMDD
<br />Date = String.Replace(Date, "-", "", false);
<br />
<br />--test to see if the application is expired
<br />if Date > Expiration_Date then
<br /> --The application has expired
<br /> Dialog.Message ("", "application is expired");
<br /> Application.Exit();
<br />end</code></pre> <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 | System | System.GetDate</b></li> </ul> <p>KEYWORDS: AutoPlay Media Studio 5.0, Expire, Trial, Version, Date </p> <hr> <FONT SIZE=1> Last reviewed: October 1, 2003<br> Copyright 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br> </FONT> </BODY> </HTML>