Solved

Coutdown witch depends on date (like trial sw)

Posted on 1997-07-16
1
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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