[futurebasic] RE: [FB] Double beeps

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 1999 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Tue, 12 Oct 1999 14:30:31 -0400
Stewart wrote:

>I have a baffling situation that occurs when I unmark a group of
>buttons:
>
>LOCAL FN UnmarkBtns(frst%,last%)
>   DIM i%
>   FOR i% = frst% TO last%
>      BUTTON i%, _activeBtn
>   NEXT i%
>END FN
>
>The function changes to buttons properly, but part way through, not in
>the beginning, it starts issuing double beeps. When I step through the
>process, the pointer never leaves the function so it must be in the
>runtime.
>
>Any idea how I can shut it up?


Stewart,

Your code works fine on my system, no beeps at all. Try this little 
working demo and see if you still have the beeping problem. Could the 
beeps be coming from a call outside your function, perhaps in a timer 
event?

Ken

(Please adjust code for e-mail line breaks)


'---------- Begin demo --------------

dim gProgramEnds

local fn initialize

window 1, "Button Beep Problem", (0,0)-(380,220), _docNoGrow
MENU 1,0, _enable, "File"
MENU 1,1, _enable, "/QQuit"
 
APPLE MENU "(Button beep problem demo...."
 
Edit Menu 2

BUTTON 1, 1, "Press Me ...", ( 21, 35)-( 126, 70),_push
BUTTON 2, 1, "... and Me ...", ( 136, 35)-( 241, 70),_push
BUTTON 3, 1, "... and Me, too", ( 251, 35)-( 356, 70),_push

BUTTON 4, 1, "Reset", ( 136, 102)-( 241, 137),_push

BUTTON 10, 1, "Quit", ( 293, 159)-( 356, 184),_shadow

end fn

LOCAL FN UnmarkBtns(frst%,last%) 'Stewart's function
    DIM i%
    FOR i% = frst% TO last%
       BUTTON i%, _activeBtn
    NEXT i%
END FN

CLEAR LOCAL
DIM rect;8
LOCAL FN doDialog

dim evnt%
dim id%

   evnt% = DIALOG(0)
   id% = DIALOG(evnt)

SELECT evnt%

CASE _wndClose
gProgramEnds = _true

CASE _efReturn

CASE _btnClick

SELECT id%
CASE 1
BUTTON 1, 2
CASE 2
BUTTON 2, 2
CASE 3
BUTTON 3, 2

CASE 4
FN UnmarkBtns(1, 3) 'Implement Stewart's function

case 10
End
gProgramEnds = _true
END SELECT

CASE _cursOver

END SELECT
END FN


LOCAL FN doMenu
dim menuID%
dim itemID%
 
menuID% = MENU(_menuID)
itemID% = MENU(_itemID)

IF menuID% = 1 AND itemID% = 1 THEN END
MENU
END FN


on dialog fn doDialog
on menu FN doMenu

fn initialize

do
handleevents
until gProgramEnds

___________________________________________________________________
Ken Shmidheiser               Systems Administrator/General Manager

Internet: kshmidheiser@...    Fax:  606.679.9225
Somerset, KY 42502-0221                        Phone:  606.679.4266
___________________________________________________________________