Solved

Coutdown witch depends on date (like trial sw)

Posted on 1997-07-16
1
148 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 100
Delphi cmd execution 6 60
Run video youtube webbrowse 10 62
LAN or WAN ? 11 91
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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…

778 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