很劣质..#include <File.au3>
#include <Array.au3>
#include <StaticConstants.au3>
Opt("GUIOnEventMode", 1)
Dim $aArray, $iNumber, $iMaxNumber, $iStart, $iMaxCount = 3, $iCount, $sResult
_FileReadToArray(@ScriptName, $aArray)
$iMaxNumber = $aArray[0]
$hGUI = GUICreate("Test", 200, 100)
GUISetOnEvent(-3, "_Quit")
$iLabel = GUICtrlCreateLabel("", 20, 20, 160, 20, bitOr($SS_SUNKEN, $SS_CENTER))
$ibtnStart = GUICtrlCreateButton("Start", 30, 50, 140, 20)
GUICtrlSetOnEvent(-1, "_Start")
GUISetState()
While True
Sleep(15)
If $iStart Then
$iNumber += 1
If $iNumber > $iMaxNumber Then $iNumber = 1
GUICtrlSetData($iLabel, $aArray[$iNumber])
EndIf
WEnd
Func _Quit()
Msgbox(64, "Finished", $sResult)
Exit
EndFunc
Func _Start()
If GUICtrlRead(@Gui_CtrlId) = "Start" Then
$iStart = 1
GUICtrlSetData(@Gui_CtrlId, "Stop")
Else
$iStart = 0
GUICtrlSetData(@Gui_CtrlId, "Start")
$iMaxNumber -= 1
$iCount += 1
Msgbox(0, $iNumber, $aArray[$iNumber])
$sResult &= $aArray[$iNumber] & @CRLF
If $iCount = $iMaxCount Then _Quit()
_ArrayDelete($aArray, $iNumber)
EndIf
EndFunc ;==>_Start()
|