Solved

why not beep?

Posted on 2000-02-25
5
225 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
[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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 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