Solved

Coutdown witch depends on date (like trial sw)

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now