Announcement

Collapse
No announcement yet.

Turning Sound On/Off

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Turning Sound On/Off

    I am trying to write a code to turn sound on and off at will.
    This statement "sound 400,b" occurs 25 places in my program,where
    "b" can be 0 or 2.
    Example:
    Sub SetSound
    Input "Do you want sound? (Y/N)";an$
    if instr(an$, any "Yy") then b = 2
    if instr(an$, any "Nn") then b = 0
    end sub
    The b = 2 will not carry through in every instance where the statement "sound 400,b" occurs in other subs. Why?
    Is there any easier way to do this? (I'm not familiar with assembly code language).

    Thanks,
    Keith

  • #2
    Try adding this line...

    Code:
    SHARED B
    ...to your SetSound function, and all of the subs and functions where you need the B value to be "visible".

    -- Eric

    ------------------
    Perfect Sync: Perfect Sync Development Tools
    Email: mailto:[email protected][email protected]</A>

    "Not my circus, not my monkeys."

    Comment


    • #3
      You might try something like this:

      If X = Y then sound 800,5

      or
      If X = Y then
      sound 800,5
      another statement
      another statment
      end if


      ------------------
      There are no atheists in a fox hole or the morning of a math test.
      If my flag offends you, I'll help you pack.

      Comment

      Working...
      X