#NoTrayIcon
#Region AutoIt3Wrapper directives section
#AutoIt3Wrapper_Icon=icon.ico
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=Y
#EndRegion
#include <Misc.au3>
_Singleton(@ScriptName)
#Region Options
Opt('MustDeclareVars', 1)
Opt('WinTitleMatchMode', 2)
Opt('GUICloseOnESC', 0)
Opt('GUIOnEventMode', 1)
#EndRegion
Const $AUTHOR = 'Juno_okyo'
Global $year = 2016
Global $JunoDepTrai = True
Global $aData[3]
$aData[0] = 'Hello World'
$aData[1] = @YEAR
$aData[2] = True
Func example($variable1, $variable2 = Default)
If $variable1 > 0 Then
MsgBox(0, 'Message', 'Value is positive.')
ElseIf $variable1 < 0 Then
MsgBox(0, 'Message', 'Value is negative.')
Else
If StringIsXDigit($variable1) Then
MsgBox(0, 'Message', 'Value might be hexadecimal!')
Else
MsgBox(0, 'Message', 'Value is a string.')
EndIf
EndIf
Local $iValue = 0
Local $sBlank = 'Test'
Select
Case $iValue = 1
MsgBox(0, 'Message', 'The first expression was True.')
Case $sBlank = 'Test'
MsgBox(0, 'Message', 'The second expression was True')
Case Else
MsgBox(0, 'Message', 'No preceding case was True.')
EndSelect
Local $sMsg = 'Message'
Switch @HOUR
Case 6 To 11
$sMsg = 'Good Morning'
Case 12 To 17
$sMsg = 'Good Afternoon'
Case 18 To 21
$sMsg = 'Good Evening'
Case Else
$sMsg = 'What are you still doing up?'
EndSwitch
MsgBox(0, 'Message', $sMsg)
Local $i = 0
For $i = 0 To 10 Step + 2
ConsoleWrite('Current value: ' & $i)
Next
Local $i = 0
While $i <= 10
MsgBox(0, 'Message', 'Value of $i is: ' & $i)
$i = $i + 1
WEnd
Local $i = 0
Do
MsgBox(0, 'Message', 'The value of $i is: ' & $i)
$i = $i + 1
Until $i = 10
For $x In $aData
ConsoleWrite($x)
Next
EndFunc
example(15)