Solved

beep vs. beep(100,100)

Posted on 2000-02-27
3
233 Views
Last Modified: 2010-04-04
There seem to be 2 beeps in Delphi 4.  Sometimes I have access to one function and not the other.  What are the exact circumstances/unit uses that I need to have to control which version of beep I get.  Could I potentially be able to have access to both version of beep in the same unit?

thanks
0
Comment
Question by:abulka
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
ahalya earned 50 total points
ID: 2563443
yes, you can use both.

One is coming from Windows.pas (& finally from kernel32.dll) & the otherone from SysUtils.pas (& finally from User32.dll).  


you can call like this to select the one you prefer:

sysutils.beep;
windows.beep(100, 100);

0
 
LVL 7

Expert Comment

by:ahalya
ID: 2563453
and btw, if you don't qualify the function name with the unit, then the order in which you define units in the uses clause becomes critical.


e.g:


uses Windows, sysUtils;

beep; //<---- comes from sys utils.



uses SysUtils, Windows;

beep(10, 10); //<---- comes from windows.
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 2563636
Of note:

Windows.Beep ignores the duration in Windows 95/98.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

17 Experts available now in Live!

Get 1:1 Help Now