Solved

Coutdown witch depends on date (like trial sw)

Posted on 1997-07-16
1
154 Views
Last Modified: 2010-04-06
I would like to do same kind of thing, which is
on trial software (you have 30 days time to try it,
and the number is getting smaller every day you use it).
How do I do it? I have looked into date/time things, but
I have no idea how to do it! :( :( Gimme some help!

My english ain't so good and I'm very beginner in Delphi 2.

0
Comment
Question by:tonitop
1 Comment
 
LVL 2

Accepted Solution

by:
icampbe1 earned 100 total points
ID: 1338983
The first time the program is run, you call 'now'.  This returns the current date and time.  This you must save somewhere (thats up to you) in a TDateTime var.

VAR
   SaveDate: TDateTime;
BEGIN
   SaveDate := Now;  {Save this in a file or something}
END;

 When the program is next run, you retrieve the saved date back into SaveDate.  Then you can do this:

VAR
  DaysInUse: Integer;

DaysInUse := (Now - SaveDate) ;

This is a simple example of how you can do it.

Cheers,
Ian C.

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 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