>Kamil,
>
>1) I would put the beep function in a DO WHILE...ENDDO loop and the condition would be while a key was being pressed. i.e.:
>
>>FUNCTION BeepSound
>
> Parameter nKeyCode
>
> DO WHILE INKEY() = nKeyCode
> ?? CHR(7)
> ENDDO
>
>ENDFUNC
>
>
>2) For the second part of your question look at the forms KEYPRESS event. It gets a parameter, nKeyCode, and in this event you could call your beep function with the nKeyCode value. Then loop for as long the key continues to be pressed.
Hi, Jos.
I am afraid both of the approaches have flaws.
1) Chr(7) can produce different sounds on different PCs. On my PC it gives away a ding not exactly a beep.
2) Keypress rate on different PCs is different, so interscepting Keypress event will not work.
Best wishes.
Kamil
A moment of silence is our cosmic reset button.