• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

why not beep?

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
chiro
Asked:
chiro
  • 3
1 Solution
 
edeyCommented:
TDateTimePicker.date returns that value of the date& time, try:

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


GL
Mike


0
 
ckanetaCommented:
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
 
edeyCommented:
I'm a little confused

Will it beep if you tell it too unconditionaly?

GL
Mike
0
 
chiroAuthor Commented:
thank
0
 
edeyCommented:
Glad to be of service :)


Gl
Mike
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.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now