[futurebasic] FB] Check/Unchecking Menu Item

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

From: Ken Shmidheiser <kshmidheiser@...>
Date: Tue, 18 May 1999 13:45:22 -0400
tedd wrote:

>It's not so much optimizing your code as it is setting up a standard
>sequence for doing stuff. Look at the difference between your code and what
>I wrote below. Most of it is the same except for the sound logic. I like to
>use flags for this type of logic.
>
>For example, the FN playSound can be called by any part of your program and
>you don't have to worry about it playing a sound when it isn't supposed to.
>When the user indicates that he/she wants the program to use sounds, then
>the flag (gSoundFlag) is set and all routines that use sound are written
>without concern if the sound is going to be played or not. That decision is
>made within the playSound FN and not within the routines that use sound.
>Therein lies an important concept.


tedd,

You have really taught me a valuable concept. Thanks so very much. I find I
think better in terms of pictures, so thanks for "drawing it out for me." I
was thrown by:

MENU 1,2, gSoundFlag + 1,"Sound"

since I was thinking in terms of gSoundFlag been either _true or _false.
Took me a few minutes to realize this is menu status, i.e., _disable,
_enable or _checked.

Also, thanks for putting FN playSound under the map menu to demonstrate the
concept.

Progress is slow-- but steady-- for me.

Ken
___________________________________________________________________
Ken Shmidheiser               Systems Administrator/General Manager

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