Modify ↓
#3034 closed Feature Request (Completed)
_Timer_SetTimer() doc example
| Reported by: | c.haslam | Owned by: | J-Paul Mesnage |
|---|---|---|---|
| Milestone: | 3.3.13.21 | Component: | Documentation |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
A simple example for newbies might be helpful:
#include <timers.au3>
Global $giMsecs = 0, $gsResult = ''
_Example_TimeOut()
Func _Example_TimeOut()
Local $hGUI = GUICreate("", 140, 64, -1, -1, 0)
GUICtrlCreateLabel("Insert a CD into the tray", 8, 8, 115, 17)
GUISetState(@SW_SHOW)
Local $iIDtimer = _Timer_SetTimer($hGUI, 1000, "Check_mounted") ; create timer
While $gsResult=''
sleep(200)
WEnd
MsgBox(0,'',$gsResult)
_Timer_KillTimer($hGUI,$iIDtimer)
GUIDelete($hGUI)
EndFunc
Func Check_mounted($hWnd, $iMsg, $iIDTimer,$iTime)
$gsResult = ''
If FileExists('E:\') Then ; CD drive letter
$gsResult = 'inserted'
Else
$giMsecs += 1000
If $giMsecs=10000 Then
$gsResult = 'timed out'
EndIf
EndIf
EndFunc
This exmaple might also be included for _Timer_KillTimer.
Attachments (0)
Change History (6)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
| Type: | Bug → Feature Request |
|---|
comment:4 by , 11 years ago
| Summary: | _Timer_SetTimer → _Timer_SetTimer() doc example |
|---|
comment:5 by , 11 years ago
| Milestone: | → 3.3.13.21 |
|---|---|
| Owner: | set to |
| Resolution: | → Completed |
| Status: | new → closed |
Added by revision [11310] in version: 3.3.13.21
Note:
See TracTickets
for help on using tickets.

Insert this line into Check_mounted():