certainly a simple thing, but I don't know why.
I have a simple script to train the "times table / 1x1 / 101 / Einmaleins".
- a start dialogue
- a loop which asks for multiplications, checks the result (plus Beep and Menutray and counting ...)
- returns to start dialogue and displays the results
Everything is fine, but the "ElapsedTime" is not displayed with Guicontrol. I can see it in the variables, I can display it with MsgBox - but it is not displayed in the in the GUI
Thanks for advice.
EDIT:
I found that it works with
Code: Select all
SetFormat, float, 0.0
Code: Select all
; 1x1.ahk
#NoEnv
#Singleinstance force
Gosub, ShowStartDialog
Return
;; **********************************************************
ShowStartDialog:
Gui, new,
Gui, Add, Text, vZeit , Zeit: ----
Gui, Add, Text, vRichtig, Richtig: ----
Gui, Add, Text, vFalsch , Falsch: ----
Gui, Add, Button, Default gcalcloop vcalcloop, Starten...
Gui , Show, w200 h130
return
;; **********************************************************
calcloop:
countrichtig := 0
countfalsch := 0
StartTime := A_TickCount
Loop, 1
{
Random, fakt1, 0, 10 ; Faktor zwischen 0 und 10
Random, fakt2, 0, 10 ; Faktor zwischen 0 und 10
ergebnis := fakt1 * fakt2
anzeige = %fakt1% x %fakt2%
; InputBox, OutputVar [, Title, Prompt, HIDE, Width, Height, X, Y, Font, Timeout, Default]
InputBox, eingabe, 1x1 Trainer, Berechne`n%anzeige%,,130,150
IfEqual, eingabe, %ergebnis%
{
bewertung = Richtig
SoundBeep , 5000
countrichtig+=1
}
Else
{
bewertung = Falsch
SoundBeep , 2000
countfalsch+=1
}
TrayTip,Vergleich, Eingabe: %eingabe%`nErgebnis: %ergebnis%`nBewertung: %bewertung%
}
SetFormat, float, 0.2
ElapsedTime := (A_TickCount - StartTime)/1000
GuiControl,, Zeit, Zeit: %ElapsedTime% sec
GuiControl,, Richtig, Richtig: %countrichtig%
GuiControl,, Falsch, Falsch: %countfalsch%
return