FLCLOCK.FRM CLOCK.BAS HELP.FRM FRMCLOCK.FRM FRMINPUT.FRM ProjWinSize=117,167,252,187 ProjWinShow=2 IconForm="FLClock" Title="CLOCK" ExeName="FLCLOCK3.EXE" ****************************CLOCK.BAS************************************** Global hours As Integer Global mins As Integer Global MinHandX(60), MinHandY(60) As Single Global HourHandX(120), HourHandY(120) As Single Global number(59) As String Global Hdigits, Mdigits As Integer Global fcol As Long Global Mprev, Hprev As Integer Global language As Integer Global showdigital As Integer Global Correct(10) As String Global answer As String Global wrong(10) As String Global lang(10) As String Global clockset, readtimes, writetimes, maketimes, actual, userandom, usedigital As Integer Global rndmins, rndhours, dighours, digmins As Integer Global Const KEY_LEFT = &H25 Global Const KEY_UP = &H26 Global Const KEY_RIGHT = &H27 Global Const KEY_DOWN = &H28 Global sayclock(7) As String Declare Function MCISendString Lib "MMSystem" (ByVal lpstrCommand As String, ByVal lpstrReturn As String, ByVal nSize As Integer, ByVal hCallBack As Integer) As Integer ************** Sub CheckTime () FrmClock.Label2.Caption = "" If (userandom = 1 And hours = rndhours And mins = rndmins) Or (usedigital = 1 And hours = dighours And mins = digmins) Then FrmClock.Label2.Caption = Correct(language) Else : FrmClock.Label2.Caption = wrong(language) End If End Sub ************** Sub DrawClock () Dim radius, xx, yy, xx1, yy1 As Single Dim n, sector As Integer FrmClock.Picture1.Scale (-300, 210)-(300, -210) Const pi = 3.141593 radius = 175 FrmClock.Picture1.FillColor = fcol FrmClock.Picture1.CurrentX = 0 FrmClock.Picture1.CurrentY = radius FrmClock.Picture1.Circle (0, 0), radius 'Clock Numbers For n = 1 To 12 xx = Sin((n * 30 * (pi / 180))) * (radius + 20) - 15 FrmClock.Picture1.CurrentX = xx yy = Cos((n * 30 * (pi / 180))) * (radius + 20) + 10 FrmClock.Picture1.CurrentY = yy FrmClock.Picture1.Print Str$(n); Next 'Clock Ticks For sector = 1 To 12 xx = Cos(sector * 30 * (pi / 180)) * radius yy = Sin(sector * 30 * (pi / 180)) * radius FrmClock.Picture1.CurrentX = xx FrmClock.Picture1.CurrentY = yy xx1 = Cos(sector * 30 * (pi / 180)) * (radius - 15) xx2 = Sin(sector * 30 * (pi / 180)) * (radius - 15) FrmClock.Picture1.Line -(xx1, xx2) Next FrmClock.Picture1.DrawWidth = 1 For sector = 1 To 60 xx = Cos(sector * 6 * (pi / 180)) * radius yy = Sin(sector * 6 * (pi / 180)) * radius FrmClock.Picture1.CurrentX = xx FrmClock.Picture1.CurrentY = yy xx1 = Cos(sector * 6 * (pi / 180)) * (radius - 10) xx2 = Sin(sector * 6 * (pi / 180)) * (radius - 10) FrmClock.Picture1.Line -(xx1, xx2) Next 'Clock Hand Coordinates For i = 1 To 60 MinHandX(i) = Sin(i * 6 * (pi / 180)) * (radius - 15) MinHandY(i) = Cos(i * 6 * (pi / 180)) * (radius - 15) Next For i = 1 To 120 HourHandX(i) = Sin(i * 3 * (pi / 180)) * (radius - 40) HourHandY(i) = Cos(i * 3 * (pi / 180)) * (radius - 40) Next End Sub Sub Drawhands () Dim x, y As String If showdigital = 1 Then If hours < 10 Then x = "0" + Str$(hours) Else x = Str$(hours) End If If mins < 10 Then y = "0" + Str$(mins) Else y = Str$(mins) End If FrmClock.Label5.Caption = x + " : " + y End If Hdigits = hours Mdigits = mins If Hdigits > 12 Then Hdigits = Hdigits - 12 Hdigits = Hdigits * 10 If Mdigits = 0 Then Mdigits = 60 If Mdigits > 0 And Mdigits < 60 Then Hdigits = Hdigits + Int(Mdigits / 6) If Hdigits > 120 Then Hdigits = Hdigits - 120 FrmClock.Picture1.DrawWidth = 3 FrmClock.Picture1.Line (0, 0)-(MinHandX(Mprev), MinHandY(Mprev)), fcol FrmClock.Picture1.DrawWidth = 5 FrmClock.Picture1.Line (0, 0)-(HourHandX(Hprev), HourHandY(Hprev)), fcol FrmClock.Picture1.DrawWidth = 3 FrmClock.Picture1.Line (0, 0)-(MinHandX(Mdigits), MinHandY(Mdigits)) FrmClock.Picture1.DrawWidth = 5 FrmClock.Picture1.Line (0, 0)-(HourHandX(Hdigits), HourHandY(Hdigits)) Mprev = Mdigits Hprev = Hdigits End Sub ******************************************** Sub EditAnswer () Dim temp As String, z As String answer = LCase(answer) For scan = 1 To Len(answer) z = Mid(answer, scan, 1) If z = "," Or z = "." Or z = ":" Or z = ";" Or z = "?" Or z = "!" Then z = "" If z = " " Then z = "" temp = temp + z Next answer = temp End Sub ********************************************************* Sub GetEnglishWords () Dim H, M As String Dim P As Integer mins = 0 hours = 0 FrmClock.Label2.Caption = "Enter an English Clock Time" answer = FrmClock.Text2.Text FrmClock.Text2.Text = "" EditAnswer If Left(answer, 4) = "itis" Then answer = Right(answer, Len(answer) - 4) If Len(answer) < 3 Then Exit Sub Call Swapstring("tyon", "ty-on") Call Swapstring("tytw", "ty-tw") Call Swapstring("tyth", "ty-th") Call Swapstring("tyf", "ty-f") Call Swapstring("tys", "ty-s") Call Swapstring("tyei", "ty-ei") Call Swapstring("tyni", "ty-ni") P = InStr(answer, "minutes") If P > 1 Then answer = Left(answer, P - 1) + Right(answer, Len(answer) - (P + 6)) If Left(answer, 13) = "oneminutepast" Then H = Right(answer, Len(answer) - 13) For z = 1 To 12 If H = number(z) Then hours = z mins = 1 Exit Sub Exit For End If Next End If If Left(answer, 11) = "oneminuteto" Then H = Right(answer, Len(answer) - 11) For z = 1 To 12 If H = number(z) Then hours = z - 1 If hours < 1 Then hours = 12 mins = 59 Exit Sub Exit For End If Next End If If Right(answer, 7) = "o'clock" Then H = Left(answer, Len(answer) - 7) For z = 1 To 12 If H = number(z) Then hours = z mins = 0 Exit Sub Exit For End If Next End If P = InStr(answer, "past") If P Then M = Left(answer, P - 1) H = Right(answer, Len(answer) - (P + 3)) For z = 1 To 12 If H = number(z) Then hours = z Next For z = 1 To 29 If M = number(z) Then mins = z If M = "half" Then mins = 30 If M = "quarter" Or M = "aquarter" Then mins = 15 Next Exit Sub End If P = InStr(answer, "to") If P Then M = Left(answer, P - 1) H = Right(answer, Len(answer) - (P + 1)) For z = 1 To 12 If H = number(z) Then hours = z - 1 If hours < 1 Then hours = 12 Next For z = 1 To 29 If M = number(z) Then mins = 60 - z If M = "quarter" Or M = "aquarter" Then mins = 45 Next Exit Sub End If For z = 1 To 24 If answer = number(z) Or answer = number(z) + "hours" Then hours = z mins = 0 End If Next For z = 1 To 24 For y = 1 To 59 If answer = number(z) + number(y) Then hours = z mins = y End If Next Next End Sub ****************************************************** Sub GetFrenchWords () Dim H, M As String Dim P As Integer mins = 0 hours = 0 FrmClock.Label2.Caption = "Enter a French Clock Time" answer = FrmClock.Text2.Text FrmClock.Text2.Text = "" EditAnswer If Left(answer, 5) = "ilest" Then answer = Right(answer, Len(answer) - 5) If Len(answer) < 4 Then Exit Sub If answer = "midi" Or answer = "minuit" Then hours = 12 mins = 0 Exit Sub End If For i = 1 To 59 If answer = "midi" + number(i) Or answer = "minuit" + number(i) Then hours = 12 mins = i Exit Sub Exit For End If Next If Left(answer, 4) = "midi" Then M = Right(answer, Len(answer) - 4) If Left(answer, 5) = "minuit" Then M = Right(answer, Len(answer) - 5) If M = "moinslequart" Or M = "moinsunquart" Then hours = 11 mins = 45 Exit Sub End If If M = "etdemi" Then hours = 12 mins = 30 Exit Sub End If If M = "etquart" Then hours = 12 mins = 15 Exit Sub End If For i = 1 To 59 If M = number(i) Then mins = i Exit Sub Exit For End If If M = "moins" + number(i) Then mins = 60 - i hours = 11 Exit Sub Exit For End If Next If answer = "uneheure" Then hours = 1 mins = 0 Exit Sub End If If Left(answer, 14) = "uneheureetdemi" Then hours = 1 mins = 30 Exit Sub End If If Left(answer, 8) = "uneheure" Then M = Right(answer, Len(answer) - 8) If M = "moinslequart" Or M = "moinsunquart" Then hours = 12 mins = 45 Exit Sub End If If M = "etquart" Then hours = 1 mins = 15 Exit Sub End If For i = 1 To 59 If M = number(i) Then hours = 1 mins = i Exit For End If If M = "moins" + number(i) Then mins = 60 - i hours = 12 Exit For End If Next If Right(answer, 7) = "minutes" Then answer = Left(answer, Len(answer) - 7) If Right(answer, 6) = "minute" Then answer = Left(answer, Len(answer) - 6) For i = 1 To 24 If Right(answer, 6) = "heures" And Left(answer, Len(answer) - 6) = number(i) Then hours = i mins = 0 Exit Sub Exit For End If Next For i = 1 To 24 For y = 1 To 59 If answer = number(i) + "heures" + number(y) Then hours = i mins = y Exit Sub Exit For Exit For End If Next Next If Right(answer, 12) = "moinslequart" Or Right(answer, 12) = "moinsunquart" Then mins = 45 H = Left(answer, Len(answer) - 18) For i = 1 To 12 If H = number(i) Then hours = i - 1 If hours < 1 Then hours = 12 End If Next Exit Sub End If P = InStr(answer, "moins") If P > 7 Then H = Left(answer, P - 7) M = Right(answer, Len(answer) - (P + 4)) For i = 1 To 29 If M = number(i) Then mins = 60 - i End If Next For i = 1 To 12 If H = number(i) Then hours = i - 1 If hours < 1 Then hours = 12 End If Next Exit Sub End If If Right(answer, 7) = "etquart" Then mins = 15 H = Left(answer, Len(answer) - 13) For i = 1 To 12 If H = number(i) Then hours = i End If Next End If If Right(answer, 7) = "etdemie" Then mins = 30 H = Left(answer, Len(answer) - 13) For i = 1 To 12 If H = number(i) Then hours = i End If Next End If End Sub ************************************************************ Sub GetGaelicWords () Dim H, M As String Dim P, Q, R As Integer mins = 0 hours = 0 FrmClock.Label2.Caption = "Enter a Gaelic Clock Time" answer = FrmClock.Text2.Text FrmClock.Text2.Text = "" EditAnswer If Left(answer, 4) = "thae" Then answer = Right(answer, Len(answer) - 4) If Len(answer) < 4 Then Exit Sub Call Swapstring("da", "dà") Call Swapstring("dàn", "dan") Call Swapstring("dha", "dhà") Call Swapstring("dhào", "dhao") Call Swapstring("cóig", "coig") Call Swapstring("déidh", "deidh") Call Swapstring("tri", "trì") Call Swapstring("ceathramh", "cairteal") Call Swapstring("ficheadmionaidean", "ficheadmionaid") Call Swapstring("leth-uair", "lethuair") If Right(answer, 7) = "uairean" Then H = Left(answer, Len(answer) - 7) For z = 3 To 10 If H = number(z) Then hours = z mins = 0 Exit Sub Exit For End If Next End If If answer = "uair" Then hours = 1 mins = 0 Exit Sub End If If answer = "dàuair" Then hours = 2 mins = 0 Exit Sub End If If answer = "aonuair deug" Then hours = 11 mins = 0 Exit Sub End If If answer = "dàuairdheug" Then hours = 1 mins = 0 Exit Sub End If If Left(answer, 18) = "aonmhionaidandeidh" Then mins = 1 H = Right(answer, Len(answer) - 18) If H = "uair" Then hours = 1 If H = "dà" Or H = "dhà" Then hours = 2 If H = "aonuairdeug" Then hours = 11 If H = "dàuairdheug" Or H = "dhàuairdheug" Then hours = 12 For z = 3 To 10 If H = number(z) Or H = "a" + number(z) Then hours = z End If Next Exit Sub End If If Left(answer, 13) = "aonmhionaidgu" Then mins = 59 H = Right(answer, Len(answer) - 13) If H = "uair" Then hours = 12 If H = "dà" Or H = "dhà" Then hours = 1 If H = "aonuairdeug" Then hours = 10 If H = "dàuairdheug" Or H = "dhàuairdheug" Then hours = 11 For z = 3 To 10 If H = number(z) Or H = "a" + number(z) Then hours = z - 1 End If Next Exit Sub End If If Left(answer, 17) = "dàmhionaidandeidh" Then H = Right(answer, Len(answer) - 17) mins = 2 If H = "uair" Then hours = 1 If H = "dà" Or H = "dhà" Then hours = 2 If H = "aonuairdeug" Then hours = 11 If H = "dàuairdheug" Or H = "dhàuairdheug" Then hours = 12 For z = 3 To 10 If H = number(z) Or H = "a" + number(z) Then hours = z End If Next Exit Sub End If If Left(answer, 12) = "dàmhionaidgu" Then mins = 58 H = Right(answer, Len(answer) - 12) If H = "uair" Then hours = 12 If H = "dà" Or H = "dhà" Then hours = 1 If H = "aonuairdeug" Then hours = 10 If H = "dàuairdheug" Or H = "dhàuairdheug" Then hours = 11 For z = 3 To 10 If H = number(z) Then hours = z - 1 End If Next Exit Sub End If If Left(answer, 15) = "cairtealandeidh" Then mins = 15 H = Right(answer, Len(answer) - 15) If H = "uair" Then hours = 1 If H = "dhà" Or H = "adhà" Then hours = 2 If H = "aonuairdeug" Then hours = 11 If H = "dàuairdheug" Or H = "adàuairdheug" Then hours = 12 For z = 3 To 10 If H = number(z) Or H = "a" + number(z) Then hours = z End If Next Exit Sub End If If Left(answer, 10) = "cairtealgu" Then mins = 45 H = Right(answer, Len(answer) - 10) If H = "uair" Then hours = 12 If H = "dhà" Or H = "adhà" Then hours = 1 If H = "aonuairdeug" Then hours = 10 If H = "dàuairdheug" Or H = "adàuairdheug" Then hours = 11 For z = 3 To 10 If H = number(z) Or H = "a" + number(z) Then hours = z - 1 End If Next Exit Sub End If If Left(answer, 16) = "ficheadmionaidgu" Then mins = 40 H = Right(answer, Len(answer) - 16) If H = "uair" Then hours = 12 If H = "dhà" Or H = "adhà" Then hours = 1 If H = "aonuairdeug" Then hours = 10 If H = "dàuairdheug" Or H = "adàuairdheug" Then hours = 11 For z = 3 To 10 If H = number(z) Or H = "a" + number(z) Then hours = z - 1 End If Next Exit Sub End If If Left(answer, 21) = "ficheadmionaidandeidh" Then mins = 20 H = Right(answer, Len(answer) - 21) If H = "uair" Then hours = 1 If H = "dhà" Or H = "adhà" Then hours = 2 If H = "aonuairdeug" Then hours = 11 If H = "dàuairdheug" Or H = "adàuairdheug" Then hours = 12 For z = 3 To 10 If H = number(z) Or H = "a" + number(z) Then hours = z End If Next Exit Sub End If If Left(answer, 15) = "lethuairandeidh" Then mins = 30 H = Right(answer, Len(answer) - 15) If H = "uair" Then hours = 1 If H = "dhà" Or H = "adhà" Then hours = 2 If H = "aonuairdeug" Then hours = 11 If H = "dàuairdheug" Or H = "adàuairdheug" Then hours = 12 For z = 3 To 10 If H = number(z) Or H = "a" + number(z) Then hours = z End If Next Exit Sub End If P = InStr(answer, "ionaid") Q = InStr(answer, "deidh") R = InStr(answer, "gu") If P > 1 Then M = Left(answer, P - 1) If Q Then H = Right(answer, Len(answer) - (Q + 4)) If R Then H = Right(answer, Len(answer) - (R + 1)) If H = "uair" And Q > 0 Then hours = 1 If H = "uair" And R > 0 Then hours = 1 If H = "dhà" Or H = "adhà" Then hours = 12 If H = "aonuairdeug" And Q > 0 Then hours = 11 If H = "aonuairdeug" And R > 0 Then hours = 10 If (H = "dàuairdheug" Or H = "dhàuairdheug") And Q > 0 Then hours = 12 If (H = "dàuairdheug" Or H = "dhàuairdheug") And R > 0 Then hours = 11 For z = 3 To 10 If (H = number(z) Or H = "a" + number(z)) And Q > 0 Then hours = z If (H = number(z) Or H = "a" + number(z)) And R > 0 Then hours = z - 1 Next For z = 3 To 10 If InStr(M, number(z)) > 0 And Q > 0 Then mins = z If InStr(M, number(z)) > 0 And R > 0 Then mins = 60 - z Next For z = 11 To 19 If InStr(M, number(z - 10)) > 0 And InStr(answer, "eug") > 0 And Q > 0 Then mins = z If InStr(M, number(z - 10)) > 0 And InStr(answer, "eug") > 0 And R > 0 Then mins = 60 - z Next For z = 21 To 29 If InStr(M, number(z - 20)) > 0 And InStr(answer, "ichead") > 0 And Q > 0 Then mins = z If InStr(M, number(z - 20)) > 0 And InStr(answer, "ichead") > 0 And R > 0 Then mins = 60 - z Next Exit Sub End If For z = 1 To 59 If answer = "aonuair" + number(z) Then hours = 1 mins = z End If If answer = "dàuair" + number(z) Then hours = 2 mins = z End If For y = 3 To 10 If answer = number(y) + "uairean" + number(z) Then hours = y mins = z End If Next If answer = "aonuairdeug" + number(z) Then hours = 11 mins = z End If If answer = "dàuairdheug" + number(z) Then hours = 12 mins = z End If Next End Sub *********************************************************** Sub GetGermanWords () Dim H, M As String Dim P As Integer mins = 0 hours = 0 FrmClock.Label2.Caption = "Enter a German Clock Time" answer = FrmClock.Text2.Text FrmClock.Text2.Text = "" EditAnswer If Left(answer, 5) = "esist" Then answer = Right(answer, Len(answer) - 5) If Len(answer) < 6 Then Exit Sub Call Swapstring("funf", "fünf") Call Swapstring("zwolf", "zwölf") Call Swapstring("ss", "ß") If Left(answer, 14) = "eineminutenach" Then H = Right(answer, Len(answer) - 14) For z = 1 To 12 If H = number(z) Then hours = z mins = 1 Exit Sub Exit For End If Next End If P = InStr(answer, "minuten") If P Then answer = Left(answer, P - 1) + Right(answer, Len(answer) - (P + 6)) If Left(answer, 13) = "eineminutevor" Then H = Right(answer, Len(answer) - 13) For z = 1 To 12 If H = number(z) Then hours = z - 1 If hours < 1 Then hours = 12 mins = 59 Exit Sub Exit For End If Next End If If Right(answer, 7) = "uhr" Then H = Left(answer, Len(answer) - 7) For z = 1 To 12 If H = number(z) Then hours = z mins = 0 Exit Sub Exit For End If Next Exit Sub End If P = InStr(answer, "vor") If P > 1 Then M = Left(answer, P - 1) H = Right(answer, Len(answer) - (P + 2)) For z = 1 To 12 If H = number(z) Then hours = z - 1 If hours < 1 Then hours = 12 Next For z = 1 To 29 If M = number(z) Then mins = 60 - z If M = "viertel" Or M = "einviertel" Then mins = 45 Next Exit Sub End If P = InStr(answer, "nach") If P > 1 Then M = Left(answer, P - 1) H = Right(answer, Len(answer) - (P + 3)) For z = 1 To 12 If H = number(z) Then hours = z Next For z = 1 To 29 If M = number(z) Then mins = z If M = "viertel" Or M = "einviertel" Then mins = 15 Next Exit Sub End If For z = 1 To 24 If answer = number(z) + "uhr" Then hours = z mins = 0 End If Next For z = 1 To 24 For y = 1 To 59 If answer = number(z) + "uhr" + number(y) Then hours = z mins = y End If Next Next If Left(answer, 4) = "halb" Then H = Right(answer, Len(answer) - 4) For z = 1 To 12 If H = number(z) Then hours = z - 1 If hours < 1 Then hours = 12 mins = 30 End If Next End If If Left(answer, 11) = "dreiviertel" Then H = Right(answer, Len(answer) - 11) For z = 1 To 12 If H = number(z) Then hours = z - 1 If hours < 1 Then hours = 12 mins = 45 End If Next End If End Sub ********************************************************************* Sub GetItalianWords () Dim H, M As String Dim P As Integer mins = 0 hours = 0 FrmClock.Label2.Caption = "Enter an Italian Clock Time" answer = FrmClock.Text2.Text FrmClock.Text2.Text = "" EditAnswer If Left(answer, 1) = "e" Or Left(answer, 1) = "È" Then answer = Right(answer, Len(answer) - 1) If Left(answer, 4) = "sono" Then answer = Right(answer, Len(answer) - 4) If Len(answer) < 4 Then Exit Sub If answer = "mezzogiorno" Or answer = "mezzanotte" Then hours = 12 mins = 0 Exit Sub End If If answer = "l'una" Then hours = 1 mins = 0 Exit Sub End If If Left(answer, 10) = "l'unaemezz" Then hours = 1 mins = 30 Exit Sub End If If Left(answer, 5) = "l'una" Then M = Right(answer, Len(answer) - 5) If M = "menounquarto" Then hours = 12 mins = 45 Exit Sub End If If M = "eunquarto" Then hours = 1 mins = 15 Exit Sub End If For i = 1 To 59 If M = "e" + number(i) Or M = number(i) Then hours = 1 mins = i Exit Sub Exit For End If If M = "meno" + number(i) Then mins = 60 - i hours = 12 Exit Sub Exit For End If Next For i = 1 To 24 If Left(answer, 2) = "le" And Right(answer, Len(answer) - 2) = number(i) Then hours = i mins = 0 Exit Sub Exit For End If Next For i = 1 To 24 For y = 1 To 59 If answer = "le" + number(i) + "e" + number(y) Or answer = "le" + number(i) + number(y) Then hours = i mins = y Exit Sub Exit For Exit For End If Next Next If Right(answer, 12) = "menounquarto" Then mins = 45 H = Mid(answer, 3, Len(answer) - 14) For i = 1 To 12 If H = number(i) Then hours = i - 1 If hours < 1 Then hours = 12 End If Next Exit Sub End If If Right(answer, 9) = "eunquarto" Then mins = 15 H = Mid(answer, 3, Len(answer) - 11) For i = 1 To 12 If H = number(i) Then hours = i End If Next Exit Sub End If P = InStr(answer, "meno") If P > 3 Then H = Mid(answer, 3, (P - 3)) M = Right(answer, Len(answer) - (P + 3)) For i = 1 To 29 If M = number(i) Then mins = 60 - i End If Next For i = 1 To 12 If H = number(i) Then hours = i - 1 If hours < 1 Then hours = 12 End If Next End If If Right(answer, 6) = "emezzo" Or Right(answer, 6) = "emezza" Then mins = 30 H = Mid(answer, 3, Len(answer) - 8) For i = 1 To 12 If H = number(i) Then hours = i End If Next End If If hours = -1 Then hours = 12 End Sub *********************************************************************** Sub GetNumbers () Open "FLnums" For Random As #1 Len = 30 For i = 1 To 59 Get #1, i + (59 * (language - 1)), number(i) Next Close #1 End Sub *********************************************************** Sub GetSpanishWords () Dim H, M As String Dim P As Integer mins = 0 hours = 0 FrmClock.Label2.Caption = "Enter a Spanish Clock Time" answer = FrmClock.Text2.Text FrmClock.Text2.Text = "" EditAnswer If Left(answer, 2) = "es" Then answer = Right(answer, Len(answer) - 2) If Left(answer, 3) = "son" Then answer = Right(answer, Len(answer) - 3) If Len(answer) < 4 Then Exit Sub Call Swapstring("dieciseis", "dieciséis") Call Swapstring("veintidos", "veintidós") Call Swapstring("veintitres", "veintitrés") If answer = "mediodía" Or answer = "mediodia" Or answer = "medianoche" Then hours = 12 mins = 0 Exit Sub End If If answer = "launa" Then hours = 1 mins = 0 Exit Sub End If If answer = "launaymedia" Then hours = 1 mins = 30 Exit Sub End If If Left(answer, 5) = "launa" Then M = Right(answer, Len(answer) - 5) If M = "menoscuarto" Then hours = 11 mins = 45 Exit Sub End If If M = "ycuarto" Then hours = 1 mins = 15 Exit Sub End If For i = 1 To 59 If M = "y" + number(i) Or M = number(i) Then hours = 1 mins = i Exit Sub Exit For End If If M = "menos" + number(i) Then mins = 60 - i hours = 12 Exit Sub Exit For End If Next For i = 1 To 24 If Left(answer, 3) = "las" And Right(answer, Len(answer) - 3) = number(i) Then hours = i mins = 0 Exit Sub Exit For End If Next For i = 1 To 24 For y = 1 To 59 If answer = "las" + number(i) + "y" + number(y) Or answer = "las" + number(i) + number(y) Then hours = i mins = y Exit Sub Exit For Exit For End If Next Next If Right(answer, 11) = "menoscuarto" Then mins = 45 H = Mid(answer, 4, Len(answer) - 14) For i = 1 To 12 If H = number(i) Then hours = i - 1 If hours < 1 Then hours = 12 End If Next Exit Sub End If If Right(answer, 7) = "ycuarto" Then mins = 15 H = Mid(answer, 4, Len(answer) - 10) For i = 1 To 12 If H = number(i) Then hours = i End If Next Exit Sub End If P = InStr(answer, "menos") If P > 4 Then H = Mid(answer, 4, (P - 4)) M = Right(answer, Len(answer) - (P + 4)) For i = 1 To 29 If M = number(i) Then mins = 60 - i End If Next For i = 1 To 12 If H = number(i) Then hours = i - 1 If hours < 1 Then hours = 12 End If Next End If If Right(answer, 6) = "ymedia" Then mins = 30 H = Mid(answer, 4, Len(answer) - 9) For i = 1 To 12 If H = number(i) Then hours = i End If Next End If If hours = -1 Then hours = 12 End Sub *********************************************************************** Sub PrintEnglishWords () Dim T, IT, H, M As String For i = 1 To 5 sayclock(i) = "" Next IT = "It is " If hours > 12 Then hours = hours - 12 If hours = 0 Or hours = 12 Then H = "twelve" sayclock(4) = "12.wav" End If If hours = 0 And mins > 30 Then H = "one" sayclock(4) = "1.wav" End If For z = 1 To 12 If hours = z Then H = number(z) sayclock(4) = Str$(z) + ".wav" End If If hours = z And mins > 30 And hours < 12 Then H = number(z + 1) sayclock(4) = Str$(z + 1) + ".wav" End If If hours = 12 And mins > 30 Then H = "one" sayclock(4) = "1.wav" End If Next If mins = 0 Then T = IT + H + " o'clock" sayclock(5) = "oclock.wav" End If If mins = 30 Then T = IT + "half past " + H sayclock(1) = "halfpast.wav" End If If mins = 45 Then T = IT + "quarter to " + H sayclock(1) = "quarto.wav" End If If mins = 15 Then T = IT + "quarter past " + H sayclock(1) = "quarpast.wav" End If For z = 1 To 59 If mins = z And mins <> 1 And mins <> 15 And mins < 30 Then M = number(z) + " minutes " sayclock(1) = Str$(z) + ".wav" sayclock(2) = "min.wav" End If If mins = z And mins <> 1 And mins <> 45 And mins > 30 Then M = number(60 - z) + " minutes " sayclock(1) = Str$(60 - z) + ".wav" sayclock(2) = "min.wav" End If If mins Mod 5 = 0 And mins = z And mins <> 0 And mins < 30 Then M = number(z) + " " sayclock(2) = "" End If If mins Mod 5 = 0 And mins = z And mins <> 0 And mins > 30 Then M = number(60 - z) + " " sayclock(2) = "" End If Next If mins < 30 And mins <> 0 And mins <> 15 Then T = IT + M + "past " + H sayclock(3) = "past.wav" End If If mins > 30 And mins <> 45 Then T = IT + M + "to " + H sayclock(3) = "to.wav" End If If mins = 1 Then T = IT + M + "one minute past " + H sayclock(1) = "1past.wav" sayclock(2) = "" sayclock(3) = "" End If If mins = 59 Then T = IT + "one minute to " + H sayclock(1) = "1to.wav" sayclock(2) = "" sayclock(3) = "" End If FrmClock.Label6.Caption = T End Sub ****************************************************************** Sub PrintFrenchWords () Dim T, IT, H, M As String IT = "Il est " If hours > 12 Then hours = hours - 12 For i = 1 To 3 sayclock(i) = "" Next If hours = 0 Then T = IT + "midi" sayclock(1) = "12h.wav" End If If hours = 1 And mins = 0 Then T = IT + "une heure" sayclock(1) = "1h.wav" FrmClock.Label6.Caption = T Exit Sub End If If hours = 12 And mins = 30 Then T = IT + "midi et demi" sayclock(1) = "12h.wav" sayclock(2) = "demi.wav" FrmClock.Label6.Caption = T Exit Sub End If If hours = 12 And mins = 0 Then T = IT + "midi" sayclock(1) = "12h.wav" FrmClock.Label6.Caption = T Exit Sub End If For z = 1 To 12 If hours = z Then H = number(z) sayclock(1) = Str$(z) + "h.wav" End If If hours = z And mins > 30 And hours < 11 Then H = number(z + 1) sayclock(1) = Str$(z + 1) + "h.wav" End If Next T = IT + H + " heures " If hours = 12 And mins < 30 Then T = IT + "midi " sayclock(1) = "12h.wav" End If If hours = 12 And mins > 30 Then T = IT + "une heure " sayclock(1) = "1h.wav" End If If hours = 11 And mins > 30 Then T = IT + "midi " sayclock(1) = "12h.wav" End If If hours = 1 And mins < 31 Then T = IT + "une heure " sayclock(1) = "1h.wav" End If For z = 1 To 59 If mins = z And mins > 30 Then M = number(60 - z) If mins = 21 Then M = "vingt et une" sayclock(3) = Str$(60 - z) + ".wav" End If If mins = z And mins < 30 Then M = number(z) If mins = 21 Then M = "vingt et une" sayclock(3) = Str$(z) + ".wav" End If Next If mins = 15 Then M = "et quart" sayclock(2) = "etquart.wav" sayclock(3) = "" Exit Sub End If If mins = 45 Then M = "le quart" sayclock(2) = "moinsqu.wav" sayclock(3) = "" Exit Sub End If If mins = 30 Then T = T + "et demie" sayclock(2) = "demi.wav" sayclock(3) = "" Exit Sub End If If mins = 21 Then M = "vingt et un" If mins > 30 Then T = T + "moins " + M sayclock(2) = "moins.wav" If mins = 59 Then sayclock(2) = "moins1.wav" sayclock(3) = "" End If End If If mins < 30 Then T = T + M sayclock(2) = "" End If FrmClock.Label6.Caption = T End Sub **************************************************************** Sub PrintGaelicWords () Dim T, IT, H, M As String IT = "Tha e " For i = 1 To 7 sayclock(i) = "" Next If hours > 12 Then hours = hours - 12 If (hours = 0 Or hours = 12) And mins < 30 Then H = "dà uair dheug" sayclock(5) = "dauairdh.wav" End If If (hours = 12 Or hours = 0) And mins > 30 Then H = "uair" sayclock(5) = "1h.wav" End If If hours = 1 And mins < 31 Then H = "uair" sayclock(5) = "1h.wav" End If If hours = 1 And mins > 30 Then H = "dhà" sayclock(5) = "dha.wav" End If If hours = 2 And mins = 0 Then H = "dà uair" sayclock(5) = "2.wav" sayclock(6) = "1h.wav" End If If hours = 2 And mins < 31 And mins <> 0 Then H = "dhà" sayclock(5) = "dha.wav" End If If hours = 2 And mins > 30 Then H = "trì" sayclock(5) = "3.wav" End If If hours = 11 And mins < 31 Then H = "aon uair deug" sayclock(5) = "11uair.wav" End If If hours = 11 And mins > 30 Then H = "dà uair dheug" sayclock(5) = "12uair.wav" End If If hours = 10 And mins > 30 Then H = "aon uair deug" sayclock(5) = "11uair.wav" End If If hours = 12 And mins < 31 Then H = "dà uair dheug" sayclock(5) = "12uair.wav" End If For z = 3 To 10 If hours = z Then H = number(z) sayclock(5) = Str$(z) + ".wav" End If If hours = z And mins = 0 Then H = number(z) + " uairean" sayclock(6) = "oclock.wav" End If If hours = z And hours < 10 And mins > 30 Then H = number(z + 1) sayclock(5) = Str$(z + 1) + ".wav" End If Next For z = 3 To 10 If mins = z Then M = number(z) + " mionaidean an deidh " T = IT + M + H sayclock(1) = Str$(z) + ".wav" sayclock(2) = "min.wav" sayclock(4) = "past.wav" FrmClock.Label6.Caption = T Exit Sub Exit For End If Next For z = 13 To 19 If mins = z And mins <> 15 Then P = InStr(number(z), "deug") If P Then M = Left(number(z), P - 1) + " mionaidean " + Right(number(z), Len(number(z)) - (P - 1)) + " an deidh " T = IT + M + H sayclock(1) = Str$(z - 10) + ".wav" sayclock(2) = "min.wav" sayclock(3) = "deug.wav" sayclock(4) = "past.wav" FrmClock.Label6.Caption = T Exit Sub Exit For End If Next For z = 23 To 29 If mins = z Then P = InStr(number(z), "air") If P Then M = Left(number(z), P - 1) + " mionaidean " + Right(number(z), Len(number(z)) - (P - 1)) + " an deidh " P = InStr(M, "fh") If P Then M = Left(M, P - 1) + " " + Right(M, Len(M) - (P - 1)) T = IT + M + H sayclock(1) = Str$(z - 20) + ".wav" sayclock(2) = "min.wav" sayclock(3) = "airfh.wav" sayclock(4) = "past.wav" FrmClock.Label6.Caption = T Exit Sub Exit For End If Next For z = 31 To 37 If mins = z Then P = InStr(number(60 - z), "air") If P Then M = Left(number(60 - z), P - 1) + " mionaidean " + Right(number(60 - z), Len(number(60 - z)) - (P - 1)) + " gu " P = InStr(M, "fh") If P Then M = Left(M, P - 1) + " " + Right(M, Len(M) - (P - 1)) T = IT + M + H sayclock(1) = Str$(40 - z) + ".wav" sayclock(2) = "min.wav" sayclock(3) = "airfh.wav" sayclock(4) = "to.wav" FrmClock.Label6.Caption = T Exit Sub Exit For End If Next For z = 41 To 47 If mins = z And mins <> 45 Then P = InStr(number(60 - z), "deug") If P Then M = Left(number(60 - z), P - 1) + " mionaidean " + Right(number(60 - z), Len(number(60 - z)) - (P - 1)) + " gu " T = IT + M + H sayclock(1) = Str$(50 - z) + ".wav" sayclock(2) = "min.wav" sayclock(3) = "deug.wav" sayclock(4) = "to.wav" FrmClock.Label6.Caption = T Exit Sub Exit For End If Next For z = 50 To 57 If mins = z Then M = number(60 - z) + " mionaidean gu " T = IT + M + H sayclock(1) = Str$(60 - z) + ".wav" sayclock(2) = "min.wav" sayclock(4) = "to.wav" FrmClock.Label6.Caption = T Exit Sub Exit For End If Next If mins = 0 Then T = IT + H If mins = 30 Then T = IT + "leth-uair an deidh " + H sayclock(1) = "halfpast.wav" End If If mins = 45 Then T = IT + "cairteal gu " + H sayclock(1) = "cairteal.wav" sayclock(4) = "to.wav" End If If mins = 15 Then T = IT + "cairteal an deidh " + H sayclock(1) = "cairteal.wav" sayclock(4) = "past.wav" End If If mins = 1 Then T = IT + "aon mhionaid an deidh " + H sayclock(1) = "1mh.wav" sayclock(4) = "past.wav" End If If mins = 59 Then T = IT + "aon mhionaid gu " + H sayclock(1) = "1mh.wav" sayclock(4) = "to.wav" End If If mins = 2 Then T = IT + "dà mhionaid an deidh " + H sayclock(1) = "2mh.wav" sayclock(4) = "past.wav" End If If mins = 58 Then T = IT + " dà mhionaid gu " + H sayclock(1) = "2mh.wav" sayclock(4) = "to.wav" End If If mins = 11 Then T = IT + "aon mhionaid deug an deidh " + H sayclock(1) = "1mh.wav" sayclock(3) = "deug.wav" sayclock(4) = "past.wav" End If If mins = 49 Then T = IT + "aon mhionaid deug gu " + H sayclock(1) = "1mh.wav" sayclock(3) = "deug.wav" sayclock(4) = "to.wav" End If If mins = 12 Then T = IT + "dà mhionaid dheug an deidh " + H sayclock(1) = "2mh.wav" sayclock(3) = "dheug.wav" sayclock(4) = "past.wav" End If If mins = 48 Then T = IT + "dà mhionaid dheug gu " + H sayclock(1) = "2mh.wav" sayclock(3) = "dheug.wav" sayclock(4) = "to.wav" End If If mins = 20 Then T = IT + " fichead mionaid an deidh " + H sayclock(1) = "20.wav" sayclock(2) = "mionaid.wav" sayclock(4) = "past.wav" End If If mins = 40 Then T = IT + " fichead mionaid gu " + H sayclock(1) = "20.wav" sayclock(3) = "mionaid.wav" sayclock(4) = "to.wav" End If If mins = 21 Then T = IT + "aon mhionaid air fhichead an deidh " + H sayclock(1) = "1mh.wav" sayclock(3) = "airfh.wav" sayclock(4) = "past.wav" End If If mins = 39 Then T = IT + "aon mhionaid air fhichead gu " + H sayclock(1) = "1mh.wav" sayclock(3) = "airfh.wav" sayclock(4) = "to.wav" End If If mins = 22 Then T = IT + "dà mhionaid air fhichead an deidh " + H sayclock(1) = "2mh.wav" sayclock(3) = "airfh.wav" sayclock(4) = "past.wav" End If If mins = 38 Then T = IT + "dà mhionaid air fhichead gu " + H sayclock(1) = "2mh.wav" sayclock(3) = "airfh.wav" sayclock(4) = "to.wav" End If FrmClock.Label6.Caption = T End Sub ********************************************************************** Sub PrintGermanWords () Dim T, IT, H, M As String IT = "Es ist " If hours > 12 Then hours = hours - 12 For i = 1 To 5 sayclock(i) = "" Next If hours = 1 And mins = 0 Then T = IT + "ein Uhr" sayclock(4) = "1uhr.wav" Exit Sub End If If hours = 0 Or hours = 12 Then H = "zwölf" sayclock(4) = "12.wav" End If If hours = 0 And mins > 30 Then H = "eins" sayclock(4) = "1.wav" End If For z = 1 To 12 If hours = z Then H = number(z) sayclock(4) = Str$(z) + ".wav" End If If hours = z And mins > 29 And hours < 12 Then H = number(z + 1) sayclock(4) = Str$(z + 1) + ".wav" End If If hours = 12 And mins > 29 Then H = "eins" sayclock(4) = "1.wav" End If Next If mins = 0 Then T = IT + H + " Uhr" sayclock(5) = "uhr.wav" End If If mins = 30 Then T = IT + "halb " + H sayclock(1) = "halb.wav" End If If mins = 45 Then T = IT + "viertel vor " + H sayclock(1) = "viervor.wav" sayclock(2) = "" End If If mins = 15 Then T = IT + "viertel nach " + H sayclock(1) = "viernach.wav" sayclock(2) = "" End If For z = 1 To 59 If mins = z And mins <> 1 And mins <> 15 And mins < 30 Then M = number(z) + " Minuten " sayclock(1) = Str$(z) + ".wav" sayclock(2) = "min.wav" End If If mins = z And mins <> 1 And mins <> 45 And mins > 30 Then M = number(60 - z) + " Minuten " sayclock(1) = Str$(60 - z) + ".wav" sayclock(2) = "min.wav" End If Next If mins < 30 And mins <> 0 And mins <> 15 Then T = IT + M + "nach " + H sayclock(3) = "nach.wav" End If If mins > 30 And mins <> 45 Then T = IT + M + "vor " + H sayclock(3) = "vor.wav" End If If mins = 1 Then T = IT + M + "eine Minute nach " + H sayclock(1) = "1nach.wav" sayclock(2) = "" sayclock(3) = "" End If If mins = 59 Then T = IT + "eine Minute vor " + H sayclock(1) = "1vor.wav" sayclock(2) = "" sayclock(3) = "" End If FrmClock.Label6.Caption = T End Sub ********************************************************************* Sub PrintItalianWords () Dim T, IT, H, M As String IT = "Sono " For i = 1 To 3 sayclock(i) = "" Next If hours > 12 Then hours = hours - 12 If hours = 1 And mins = 0 Then T = "È l'una" sayclock(1) = "1h.wav" FrmClock.Label6.Caption = T Exit Sub End If For z = 1 To 12 If hours = z Then H = number(z) sayclock(1) = Str$(z) + "h.wav" End If If hours = z And mins > 30 And hours < 12 Then H = number(z + 1) sayclock(1) = Str$(z + 1) + "h.wav" End If Next T = IT + " le " + H If hours = 12 And mins > 30 Then T = "È l'una" sayclock(1) = "1h.wav" End If If hours = 1 And mins < 31 Then T = "È l'una" sayclock(1) = "1h.wav" End If For z = 1 To 59 If mins = z And mins > 30 Then M = number(60 - z) sayclock(3) = Str$(60 - z) + ".wav" End If If mins = z And mins < 30 Then M = number(z) sayclock(3) = Str$(z) + ".wav" End If Next If mins = 15 Or mins = 45 Then M = " un quarto" sayclock(3) = "quarto.wav" End If If mins > 30 Then T = T + " meno " + M sayclock(2) = "meno.wav" End If If mins < 30 And mins <> 0 Then T = T + " e " + M sayclock(2) = "e.wav" End If If mins = 30 Then T = T + " e mezzo" sayclock(2) = "mezzo.wav" sayclock(3) = "" End If FrmClock.Label6.Caption = T End Sub *************************************************************************** Sub PrintSpanishWords () Dim T, IT, H, M As String IT = "Son " For i = 1 To 3 sayclock(i) = "" Next If hours > 12 Then hours = hours - 12 If hours = 1 And mins = 0 Then T = "Es la una" sayclock(1) = "1h.wav" FrmClock.Label6.Caption = T Exit Sub End If For z = 1 To 12 If hours = z Then H = number(z) sayclock(1) = Str$(z) + "h.wav" End If If hours = z And mins > 30 And hours < 12 Then H = number(z + 1) sayclock(1) = Str$(z + 1) + "h.wav" End If Next T = IT + " las " + H If hours = 12 And mins > 30 Then T = "Es la una" sayclock(1) = "1h.wav" End If If hours = 1 And mins < 31 Then T = "Es la una" sayclock(1) = "1h.wav" End If For z = 1 To 59 If mins = z And mins > 30 Then M = number(60 - z) sayclock(3) = Str$(60 - z) + ".wav" End If If mins = z And mins < 30 Then M = number(z) sayclock(3) = Str$(z) + ".wav" End If Next If mins = 15 Or mins = 45 Then M = " cuarto" sayclock(3) = "cuarto.wav" End If If mins > 30 Then T = T + " menos " + M sayclock(2) = "menos.wav" End If If mins < 30 And mins <> 0 Then T = T + " y " + M sayclock(2) = "y.wav" End If If mins = 30 Then T = T + " y media" sayclock(3) = "media.wav" End If FrmClock.Label6.Caption = T End Sub ************************************************************* Sub RandomTime () Dim x, y As String Randomize rndmins = Int(59 * Rnd + 1) rndhours = Int(12 * Rnd + 1) If showdigital = 1 Then If rndhours < 10 Then x = "0" + Str$(rndhours) Else x = Str$(rndhours) End If If rndmins < 10 Then y = "0" + Str$(rndmins) Else y = Str$(rndmins) End If FrmClock.Label5.Caption = x + " : " + y End If End Sub ************************************************************************* Sub RealTime () mins = Val(Mid(Time, 4, 2)) hours = Val(Left(Time, 2)) End Sub Sub Swapstring (string1 As String, string2 As String) If Left(answer, Len(string1)) = string1 Then answer = string2 + Right(answer, Len(answer) - Len(string1)) End If If Right(answer, Len(string1)) = string1 Then answer = Left(answer, Len(answer) - Len(string1)) + string2 End If P = InStr(answer, string1) If P Then answer = Left(answer, P - 1) + string2 + Right(answer, Len(answer) - (P + (Len(string1) - 1))) End If End Sub ************************************************************************ ***************************FrmFLClock*************************************** Sub Command1_Click () fcol = QBColor(7) DrawClock FrmClock.Show Drawhands FrmClock.Label6.Visible = 0 FrmClock.Text2.Visible = 0 FrmClock.Label4.Visible = 0 FrmClock.Text1.Visible = 0 End Sub Sub Command2_Click () End End Sub ***************************************************************************** *******************************FrmClock************************************** Sub Command1_Click () Unload FrmClock End Sub ********************************************************************* Sub Command2_Click () Dim wavefile, dothis, sounddir, itis As String Dim ReturnString As String * 255 Dim elements As Integer itis = "itis.wav" Select Case language Case 1 sounddir = "engspeak" elements = 5 Case 2 sounddir = "frspeak" elements = 3 Case 3 sounddir = "gerspeak" elements = 5 Case 4 sounddir = "itspeak" elements = 3 Case 5 sounddir = "spspeak" elements = 3 Case 6 sounddir = "gaspeak" elements = 7 End Select If maketimes = 1 Or writetimes = 1 Then Select Case language Case 1 PrintEnglishWords Case 2 PrintFrenchWords Case 3 PrintGermanWords Case 4 PrintItalianWords Case 5 PrintSpanishWords Case 6 PrintGaelicWords End Select End If FrmClock.Text1.Enabled = 0 If (language = 4 Or language = 5) And sayclock(1) = "1h.wav" Then GoTo Skipbit dothis = "Open " + CurDir + "\" + sounddir + "\" + itis + " type waveaudio alias audioclip" x% = MCISendString(dothis, ReturnString, 255, 0) dothis = "Play audioclip wait" x% = MCISendString(dothis, ReturnString, 255, 0) dothis = "Close audioclip" x% = MCISendString(dothis, ReturnString, 255, 0) Skipbit: For i = 1 To elements wavefile = sayclock(i) wavefile = LTrim(wavefile) If Len(wavefile) > 0 Then dothis = "Open " + CurDir + "\" + sounddir + "\" + wavefile + " type waveaudio alias audioclip" x% = MCISendString(dothis, ReturnString, 255, 0) dothis = "Play audioclip wait" x% = MCISendString(dothis, ReturnString, 255, 0) dothis = "Close audioclip" x% = MCISendString(dothis, ReturnString, 255, 0) End If Next If readtimes = 1 Or clockset = 1 Then FrmClock.Text1.Enabled = 1 FrmClock.Text1.SetFocus End If End Sub ********************************************************************* Sub Form_Load () Timer1.Enabled = True userandom = 1 showdigital = 0 language = 1 lang(language) = "English" Correct(language) = "Yes, that's right" Wrong(language) = "No, that's not right" GetNumbers End Sub **************************************************************** Sub Label4_Click () FrmClock.Label2.Caption = "" If userandom = 1 Then RandomTime mins = rndmins hours = rndhours End If If usedigital = 1 Then FrmInput.Show 1 mins = digmins hours = dighours End If If writetimes = 1 Then Drawhands FrmClock.Text2.Text = "" FrmClock.Text2.SetFocus End If If clockset = 1 Then Select Case language Case 1 PrintEnglishWords Case 2 PrintFrenchWords Case 3 PrintGermanWords Case 4 PrintItalianWords Case 5 PrintSpanishWords Case 6 PrintGaelicWords End Select mins = 0 hours = 0 Drawhands End If End Sub ****************************************************************** Sub MnuActual_Click () actual = 1 readtimes = 0 writetimes = 0 clockset = 0 maketimes = 0 Timer1.Enabled = True FrmClock.Label6.Visible = True FrmClock.Text1.Visible = 0 FrmClock.Text2.Visible = 0 FrmClock.Label4.Visible = 0 FrmClock.Label3.Visible = 0 FrmClock.Label5.Visible = 0 FrmClock.Label1.Caption = "Actual Time by Your PC" FrmClock.Label2.Caption = "" fcol = QBColor(8) DrawClock Drawhands End Sub ***************************************************************** Sub MnuEnglish_Click () FrmClock.Label1.Caption = "ENGLISH CLOCK" FrmClock.Label2.Caption = "ENGLISH " language = 1 lang(language) = "English" Correct(language) = "Yes, that's right" Wrong(language) = "No, that's not right" GetNumbers If readtimes = 1 Or clockset = 1 Or actual = 1 Then PrintEnglishWords End Sub ***************************************************************** Sub MnuEnterDigital_Click () usedigital = 1 userandom = 0 FrmClock.Label4.Visible = 1 End Sub ************************************************************************* Sub MnuFrench_Click () FrmClock.Label1.Caption = "FRENCH CLOCK" FrmClock.Label2.Caption = "FRANÇAIS " language = 2 lang(language) = "French" Correct(language) = "Oui, c'est juste" Wrong(language) = "Non, ce n'est pas juste" GetNumbers If readtimes = 1 Or clockset = 1 Or actual = 1 Then PrintFrenchWords End Sub ***************************************************************** Sub MnuGaelic_Click () FrmClock.Label1.Caption = "GAELIC CLOCK" FrmClock.Label2.Caption = "SCOTTISH GAELIC" language = 6 lang(language) = "Gaelic" Correct(language) = "Tha sin ceart" Wrong(language) = "Chan eil sin ceart" GetNumbers If readtimes = 1 Or clockset = 1 Or actual = 1 Then PrintGaelicWords End Sub ************************************************************************** Sub MnuGerman_Click () FrmClock.Label1.Caption = "GERMAN CLOCK" FrmClock.Label2.Caption = "DEUTSCH" language = 3 lang(language) = "German" Correct(language) = "Ja, das ist richtig" Wrong(language) = "Nein, das ist falsch" GetNumbers If readtimes = 1 Or clockset = 1 Or actual = 1 Then PrintGermanWords End Sub ******************************************************************* Sub MnuHelp_Click () Frmhelp.Show 1 End Sub ****************************************************************** Sub MnuHideDigital_Click () showdigital = 0 FrmClock.Label3.Visible = 0 FrmClock.Label5.Visible = 0 End Sub *************************************************************** Sub MnuItalian_Click () FrmClock.Label1.Caption = "ITALIAN CLOCK" FrmClock.Label2.Caption = "ITALIANO" language = 4 lang(language) = "Italian" Correct(language) = "Si, è corretto" Wrong(language) = "No, non è corretto" GetNumbers If readtimes = 1 Or clockset = 1 Or actual = 1 Then PrintItalianWords End Sub *********************************************************************** Sub MnuMakeTimes_Click () maketimes = 1 MnuEnterDigital.Enabled = 0 writetimes = 0 clockset = 0 readtimes = 0 actual = 0 Timer1.Enabled = 0 FrmClock.Label6.Visible = 0 FrmClock.Label6.Enabled = 0 FrmClock.Text2.Visible = True FrmClock.Label4.Visible = 0 Text1.Visible = 0 fcol = QBColor(14) FrmClock.FillStyle = 0 DrawClock mins = 0 hours = 0 Drawhands FrmClock.Label1.Caption = "Make up " + lang(language) + " Clock Times" If language = 1 Then FrmClock.Label2.Caption = "Enter an English Clock Time" Else FrmClock.Label2.Caption = "Enter a " + lang(language) + " Clock Time" End If Text2.SetFocus End Sub ****************************************************************** Sub MnuQuit_Click () End End Sub ***************************************************************** Sub MnuReadTimes_Click () MnuEnterDigital.Enabled = 0 writetimes = 0 clockset = 0 maketimes = 0 readtimes = 1 actual = 0 Timer1.Enabled = 0 FrmClock.Text1.Visible = True FrmClock.Text1.Enabled = True FrmClock.Label6.Visible = True FrmClock.Text2.Visible = 0 FrmClock.Label4.Visible = 0 fcol = QBColor(12) DrawClock FrmClock.Label1.Caption = "Read " + lang(language) + " Clock Times" FrmClock.Label2.Caption = "Move the clock hands with the arrow keys" mins = 0 hours = 12 Select Case language Case 1 PrintEnglishWords Case 2 PrintFrenchWords Case 3 PrintGermanWords Case 4 PrintItalianWords Case 5 PrintSpanishWords Case 6 PrintGaelicWords End Select Drawhands FrmClock.Text1.SetFocus End Sub ******************************************************************** Sub MnuSayTime_Click () Command2_Click End Sub *************************************************************** Sub MnuSetClock_Click () Timer1.Enabled = 0 clockset = 1 writetimes = 0 maketimes = 0 readtimes = 0 actual = 0 MnuEnterDigital.Enabled = True FrmClock.Text2.Visible = 0 FrmClock.Label6.Visible = True FrmClock.Text1.Visible = True FrmClock.Text1.Enabled = True FrmClock.Text1.SetFocus FrmClock.Label4.Visible = True FrmClock.Label4.Caption = "Click here for Time" fcol = QBColor(10) DrawClock mins = 0 hours = 0 Drawhands FrmClock.Label1.Caption = "Read and set " + lang(language) + " Clock Times" FrmClock.Label2.Caption = "Read " + lang(language) + " Time and set clock to right time with arrow keys" End Sub **************************************************************** Sub MnuShowDigital_Click () Dim x, y As String showdigital = 1 FrmClock.Label3.Visible = True FrmClock.Label5.Visible = True FrmClock.Label3.Caption = "Digital Time" If hours < 10 Then x = "0" + Str$(hours) Else x = Str$(hours) End If If mins < 10 Then y = "0" + Str$(mins) Else y = Str$(mins) End If FrmClock.Label5.Caption = x + " : " + y End Sub ************************************************************ Sub MnuSpanish_Click () FrmClock.Label1.Caption = "SPANISH CLOCK" FrmClock.Label2.Caption = "ESPAÑOL" language = 5 lang(language) = "Spanish" Correct(language) = "Si, eso es" Wrong(language) = "No, no es correcto" GetNumbers If readtimes = 1 Or clockset = 1 Or actual = 1 Then PrintSpanishWords End Sub *********************************************************** Sub MnuUseRandom_Click () userandom = 1 usedigital = 0 FrmClock.Label4.Visible = True End Sub **************************************************************** Sub MnuWriteTimes_Click () Timer1.Enabled = 0 MnuEnterDigital.Enabled = True writetimes = 1 clockset = 0 maketimes = 0 readtimes = 0 actual = 0 FrmClock.Label6.Visible = 0 FrmClock.Text2.Visible = True FrmClock.Label4.Visible = True FrmClock.Label4.Caption = "Click here to start" fcol = QBColor(15) DrawClock mins = 0 hours = 0 Drawhands FrmClock.Label1.Caption = "Write " + lang(language) + " Clock Times" FrmClock.Label2.Caption = "Enter the " + lang(language) + " Clock Time for the time shown" End Sub *********************************************************** Sub Text1_KeyDown (KeyCode As Integer, Shift As Integer) If KeyCode = Key_Right Then mins = mins + 1 If KeyCode = Key_Left Then mins = mins - 1 If KeyCode = Key_Up Then hours = hours + 1 If KeyCode = Key_Down Then hours = hours - 1 If mins = 60 Then hours = hours + 1 mins = 0 End If If hours > 12 Then hours = hours - 12 If hours = 0 Then hours = 12 If mins = -1 Then hours = hours - 1 mins = 59 End If If hours = -1 Then hours = 11 Drawhands If readtimes = 1 Then Select Case language Case 1 PrintEnglishWords Case 2 PrintFrenchWords Case 3 PrintGermanWords Case 4 PrintItalianWords Case 5 PrintSpanishWords Case 6 PrintGaelicWords End Select End If End Sub ***************************************************************** Sub Text1_KeyPress (KeyAscii As Integer) If KeyAscii > 32 Then KeyAscii = 0 If clockset = 1 And (KeyAscii = 32 Or KeyAscii = 13) Then CheckTime End Sub ******************************************************** Sub Text2_KeyPress (keyascii As Integer) If clockset = 1 Or readtimes = 1 Then keyascii = 0 If keyascii = 47 Then keyascii = 0 Text2.Text = "" End If If keyascii > 47 And keyascii < 58 Then FrmClock.Text2.Text = "Enter words - not digits! (Press '/' to clear)" Exit Sub End If If keyascii = 13 Then Select Case language Case 1 GetEnglishWords Case 2 GetFrenchWords Case 3 GetGermanWords Case 4 GetItalianWords Case 5 GetSpanishWords Case 6 GetGaelicWords End Select If maketimes = 1 Then Text2.Text = " Your Time= " + Str$(hours) + ":" + Str$(mins) + " (Press '/' to clear)" Drawhands End If If writetimes = 1 Then CheckTime If usedigital = 1 Then Text2.Text = "Time Set= " + Str$(dighours) + ":" + Str$(digmins) + " Your Time= " + Str$(hours) + ":" + Str$(mins) + " (Press '/' to clear)" If userandom = 1 Then Text2.Text = "Time Set= " + Str$(rndhours) + ":" + Str$(rndmins) + " Your Time= " + Str$(hours) + ":" + Str$(mins) + " (Press '/' to clear)" End If End If End Sub ************************************************************* Sub Timer1_Timer () RealTime Drawhands If actual = 1 Then Select Case language Case 1 PrintEnglishWords Case 2 PrintFrenchWords Case 3 PrintGermanWords Case 4 PrintItalianWords Case 5 PrintSpanishWords Case 6 PrintGaelicWords End Select End If End Sub ******************************FrmInput**************************************VERSION 2.00 Sub Command1_Click () dighours = Val(Text1.Text) digmins = Val(Text2.Text) If dighours > 24 Or digmins > 59 Then Exit Sub If dighours > 12 Then dighours = dighours - 12 Unload FrmInput End Sub Sub Text1_KeyPress (keyAscii As Integer) If keyAscii = 13 Then Text2.SetFocus If keyAscii > 13 And keyAscii < 48 Then keyAscii = 0 If keyAscii > 57 Then keyAscii = 0 End Sub Sub Text2_KeyPress (keyAscii As Integer) If keyAscii = 13 Then Text1.SetFocus If keyAscii > 13 And keyAscii < 48 Then keyAscii = 0 If keyAscii > 57 Then keyAscii = 0 End Sub ********************************FrmHelp************************************* Sub Command1_Click () Unload FrmHelp End Sub Private Sub Form_Load () Dim T, NL As String NL = Chr$(13) + Chr$(10) T = T + " ACTUAL TIME" + NL + NL T = T + " The actual time by your PC's internal clock will be printed out" + NL T = T + " in words below the clock" + NL + NL T = T + " READ TIMES" + NL + NL T = T + " Move the arrow keys to set the clock to a time of your choice." + NL T = T + " Use the Left and Right arrow keys to move the minute hand." + NL T = T + " Use the Up and Down arrow keys to move the hour hand" + NL T = T + " The time you choose to set will be printed out in words below" + NL + NL T = T + " MAKE UP TIMES" + NL + NL T = T + " Enter a time in words below the clock, and press ENTER" + NL T = T + " The clock will set itself to the entered time if the entry " + NL T = T + " is accurate. If you get it wrong you can try again" + NL + NL T = T + " SET CLOCK" + NL + NL T = T + " Click the start button to get a random time printed out in words" + NL T = T + " Move the arrow keys to set the clock to the time indicated" + NL T = T + " Use the Left and Right arrow keys to move the minute hand." + NL T = T + " Use the Up and Down arrow keys to move the hour hand" + NL T = T + " Press SPACE or ENTER to check if you have set the correct time" + NL + NL T = T + " WRITE TIMES" + NL + NL T = T + " Click the start button to get the clock set to a random time" + NL T = T + " Enter the time in words under the clock" + NL T = T + " Press ENTER to check if your entry is correct" + NL + NL T = T + " TEACHER SETTINGS" + NL + NL T = T + " Click on SHOW DIGITAL to display a digital clock time as well as the" + NL T = T + " analogue display" + NL T = T + " Click on HIDE DIGITAL to remove the digital clock display" + NL T = T + " Click on ENTER DIGITAL to enter a chosen time (in digital format)" + NL T = T + " instead of using the random times which are the default setting" + NL T = T + " Click on USE RANDOM to restore random time settings " + NL FrmHelp.Text1.Text = T End Sub