Solved

Beep is beeping only once

Posted on 2003-12-04
7
371 Views
Last Modified: 2010-05-03
I wrote the code
for i = to 5
     Beep
next i
but the computer beeps only once.
Why?
0
Comment
Question by:SaadDani
7 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 9880601
for i = 0 to 5
     Beep
next i
0
 

Author Comment

by:SaadDani
ID: 9880614
Its the same...
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 9880726
Try this:

for i = 1 to 5
     Beep
     Doevents
next i

( I haven't tested it 'cos I don't have speakers at the moment )
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 11

Expert Comment

by:dbrckovi
ID: 9880750
If this doesn't work then try using Timer to do the beeping in some time interval.    (Maybe the loop goes too fast.     Loop is finished even before the first beep finishes )

Create command button and a timer:
--------------------------------------------------------------------
Private Sub Command1_Click()
    Timer1.Interval = 300
    Timer1.Tag = 0
    Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
    Timer1.Tag = Timer1.Tag + 1
    Beep
    DoEvents
    If Timer1.Tag = 5 Then Timer1.Enabled = False
End Sub
--------------------------------------------------------------------
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 100 total points
ID: 9880751
All the beeps are merged together.
Try this
Dim i As Integer
Dim j As Long
For i = 0 To 5
     Beep
     For j = 1 To 10000000
     Next j
Next

0
 

Author Comment

by:SaadDani
ID: 9880756
dosn't help...
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 9880793
Timer method works fine for me.
The lowest value of Timer1.Interval that gives multiple beeps on my comp. is 50. Everything larger than this works fine.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

777 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