' 12-Feb.-2012 alternative Delay by J. van Zijl aka Slowdown. ' At this moment Wait(xx) isn't working but i needed some kind of Delay. ' i use for this in this example a Timer with a resolution of 1 milisec. ' keep in mind when doing this the program in not responsive when it's in the loop. ' Q7Basic for Windows? 7/Vista/XP BETA 22-December-2011 (32 bit) ' NOT tested on Linux/OSX. ' You can find me on, ' http://www.q7basic.org/forum/index.php and ' http://www.kbasic.com/forum/index.php Outlet PlayTone As QPushButton Outlet lcdNumber As QLCDNumber Dim Tm1 As Timer Dim Ticks As Integer Dim TicksSet As Integer Event Init() Tm1.Interval = 1 Tm1.Stop() End Event Signal on_PlayTone_clicked(Checked As Boolean) stdout("playdash") PlayDash() stdout("start delay") Pause(5000) stdout("end delay") PlayIt() End Signal Sub PlayIt() Dim ps As String ps = PlaySound(Application.Path + "/boom_boom.mp3") End Sub Sub PlayDot() Dim ps As String ps = PlaySound(Application.Path + "/short.mp3") End Sub Sub PlayDash() Dim ps As String ps = PlaySound(Application.Path + "/long.mp3") End Sub Sub Pause(msec As Integer) TicksSet = msec Ticks = 0 Tm1.Start() DoEvents() Do While Ticks < TicksSet lcdNumber!value = TicksSet - Ticks DoEvents() Loop Tm1.Stop() End Sub Signal on_Tm1_Event() Ticks = Ticks + 1 End Signal