version 6.30 0 Form1 1 6 0 0 0 3 0 0 3 1 0 0 0 0 0 0 0 0 0 1 238 268 1 dzHWdesktop.dll 1 dzHW.dll 1 dz:dzHW Sub designer addform(Form1,"Stoppuhr 1.0 ","",0,0,255)@ addtable(form1,TableLap,5,160,225,105,"",0,255,64,0,0,0,True,True,12)@ addbutton(form1,ButtonLap,5,5,225,50,"Lap",128,128,255,0,0,0,True,True,16)@ addtimer(form1,Timer1,95,5,31)@ addtextbox(form1,TextBoxTenSec,155,55,75,50,"",0,255,0,0,0,0,True,True,False,20)@ addtextbox(form1,TextBoxMin,5,55,75,50,"",0,255,0,0,0,0,True,True,False,20)@ addtextbox(form1,TextBoxSec,80,55,75,50,"",0,255,0,0,0,0,True,True,False,20)@ addbutton(form1,ButtonReset,155,105,75,50,"Reset",128,128,255,0,0,0,True,True,16)@ addbutton(form1,ButtonStop,80,105,75,50,"Stop",128,128,255,0,0,0,True,True,16)@ addbutton(form1,ButtonStart,5,105,75,50,"Start",128,128,255,0,0,0,True,True,16)@ End Sub @EndOfDesignText@Sub Globals 'Declare the global variables here. ' Stoppuhr 1.0 ' By Token ' Ver. 1.1 - Corrected timing-overflow constants TimerMin = 0 TimerSec = 0 TimerTenSec = 0 LapNr = 0 Dim StartTickCount, OldTenthsDigit End Sub Sub App_Start dz.New1 ' Millisec Tick Counter dz.GetTickCount ' Throw away first 2 calls dz.GetTickCount Form1.Show TableLap.AddCol(cNumber,"Lap",50) TableLap.AddCol(cString,"Time",175) End Sub Sub ButtonStart_Click StartTickCount = dz.GetTickCount OldTenthsDigit = Int(StartTickCount/100) Mod 10 Timer1.Enabled = true End Sub Sub Timer1_Tick TenthsDigit = Int((StartTickCount - dz.GetTickCount)/100) Mod 10 If TenthsDigit = OldTenthsDigit Then Return End If OldTenthsDigit = TenthsDigit If TimerTenSec < 9 Then TimerTenSec = TimerTenSec + 1 Else If TimerSec < 59 TimerSec = TimerSec + 1 TimerTenSec = 0 Else If TimerMin < 59 TimerMin = TimerMin + 1 TimerSec = 0 TimerTenSec = 0 Else TimerMin = 0 TimerSec = 0 TimerTenSec = 0 End If TextBoxMin.Text = TimerMin TextBoxSec.Text = TimerSec TextBoxTenSec.Text = TimerTenSec End Sub Sub ButtonStop_Click Timer1.Enabled = false End Sub Sub ButtonReset_Click TimerMin = 0 TimerSec = 0 TimerTenSec = 0 TextBoxMin.Text = TimerMin TextBoxSec.Text = TimerSec TextBoxTenSec.Text = TimerTenSec TableLap.Clear LapNr = 0 End Sub Sub ButtonAbout_Click Msgbox("V.1.0 - By Token","Stoppuhr 1.0") End Sub Sub ButtonLap_Click LapNr = LapNr + 1 TableLap.AddRow(LapNr,TimerMin&":"&TimerSec&":"&TimerTenSec) End Sub