Solved

why not beep?

Posted on 2000-02-25
5
222 Views
Last Modified: 2010-04-04
Why not beep when I select today

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ComCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    DateTimePicker1: TDateTimePicker;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
if date=DateTimePicker1.date then beep;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;


end.
0
Comment
Question by:chiro
  • 3
5 Comments
 
LVL 6

Accepted Solution

by:
edey earned 100 total points
ID: 2559107
TDateTimePicker.date returns that value of the date& time, try:

if date=trunc(DateTimePicker1.date) then beep;


GL
Mike


0
 
LVL 3

Expert Comment

by:ckaneta
ID: 2559223
my computer doesn't beep at all, but when I typecast them both to strings it showed a 'beep' message;

if datetotstr(date)=datetostr(DateTimePicker1.date) then showmessage('beep');
0
 
LVL 6

Expert Comment

by:edey
ID: 2559472
I'm a little confused

Will it beep if you tell it too unconditionaly?

GL
Mike
0
 

Author Comment

by:chiro
ID: 2559587
thank
0
 
LVL 6

Expert Comment

by:edey
ID: 2559679
Glad to be of service :)


Gl
Mike
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

930 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

12 Experts available now in Live!

Get 1:1 Help Now