Hi,
ich hab ein seltsames Problem,
bei meinem folgenden Code:
Spoiler anzeigen
#include <GUIConstants.au3>
#include <date.au3>
$LastTime = "00:00:00"
$TextColor = 0xDF1818
Global $H, $M, $S
$MainGui = GuiCreate("Timer",350,80,0,625,$WS_POPUP,$WS_EX_TOPMOST)
$CtrlTimePassed = GuiCtrlCreateLabel($LastTime,10,40,160)
GuiCtrlSetFont(-1,14)
WinSetTrans($MainGui,"",255)
$Timer = TimerInit()
AdlibEnable("_CountTime",50)
GuiSetState()
[/autoit] [autoit][/autoit] [autoit]while 1
sleep(500)
WEnd
Func _CountTime()
_TicksToTime(Int(TimerDiff($Timer)),$H,$M,$S)
If StringLen($H) = 1 then $H = "0" & $H
If StringLen($M) = 1 then $M = "0" & $M
If StringLen($S) = 1 then $S = "0" & $S
$CurTime = $H & ":" & $M & ":" & $S
IF $LastTime <> $CurTime Then
GuiCtrlSetData($CtrlTimePassed,$CurTime)
$LastTime = $H & ":" & $M & ":" & $S
EndIf
EndFunc
Der eigentliche Code spielt keine Rolle, es geht mir nur um Zeile 8.
Wenn ich es Compilen will sagt Au3 Errorcheck mir folgendes:
Spoiler anzeigen
D:\Autoit\BwTImer\GUI.au3(9,52) : WARNING: $WS_POPUP: possibly used before declaration.
$MainGui = GuiCreate("Timer",350,80,0,625,$WS_POPUP,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Autoit\BwTImer\GUI.au3(9,67) : WARNING: $WS_EX_TOPMOST: possibly used before declaration.
$MainGui = GuiCreate("Timer",350,80,0,625,$WS_POPUP,$WS_EX_TOPMOST)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Autoit\BwTImer\GUI.au3(9,52) : ERROR: $WS_POPUP: undeclared global variable.
$MainGui = GuiCreate("Timer",350,80,0,625,$WS_POPUP,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Autoit\BwTImer\GUI.au3 - 1 error(s), 2 warning(s)
aber warum?
Die Variablen wurden doch durch #include <GUIConstants.au3> definiert, oder nicht?
Jedenfalls finde ich das in Beispielen der AU3 Hilfe auch nicht anders ;O
Wo liegt da jetzt das Problem?
Greetz qon