Results 1 to 2 of 2

Thread: Sastraxi - or others: Tick wave file for clock

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    9

    Unhappy

    Sastraxi:
    I followed your module for the tick wave file to tick on the seconds (Can be found under "Anyone have questions out there?". I have come up with a problem!

    When I click on the sound option button that has a message box come up and ask "Do you want the clock to tick?" - Yes / No response required. Under "tmrRealTime" event I had the response to the message box = 6 then call "Main" to start the tick sound. It worked but the time froze???

    Then I thought about calling the "Main" function in the modTick in its own timer event "tmrTick" and make the interval = to that of the "tmrRealTime". If "Yes" is clicked it would tick on seconds but not aligned with "tmrRealTime". But yet another problem has arose, if I went back to click on the sound option button and "No" for the message box that prompts "Do you want the clock to tick?", it does not turn off the wave file.

    I think I am close to tying this up but need a little help!
    In Summary:

    1.) When I click on the "Yes" from the message box that it turns on the "Tick" wave file. It is aligned with the seconds on the clock.

    2.) When I click on the "No" from the message box that it turns off the "Tick" wave file

    What do you think? I now this is a lengthy message but I wanted to give the most background.

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134

    Thumbs up

    Set the startup form to submain. Add this code to the start of Sub Main():

    Code:
    Option Explicit
    ...
    
    Public Tick As String 'instead of Const Tick = "tick.wav"
    
    Sub Main()
    Dim A
    Dim OldSecond As Long
    Dim RetVal As Long
    
    tick = "tick.wav"
    
    RetVal = Msgbox("Would you like the clock to tick?", VbYesNo, "Clock Ticker")
    
    If RetVal = VbYes Then
    ElseIf RetVal = VbNo Then
       tick = ""
    End If
    
    OldSecond = Second(Now)
    
    Do
    ...
    PlayWav Tick, SND_ASYNC AND SND_NODEFAULT
    ...
    Loop
    End Sub
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width