Code: Select all
a()
a(b?){
Switch b
{
Case unset(b):
MsgBox "unset"
Case 1:
MsgBox 1
}
}
Code: Select all
a()
a(b?){
Switch b
{
Case unset(b):
MsgBox "unset"
Case 1:
MsgBox 1
}
}
Code: Select all
#Requires AutoHotkey v2.0
c := 3
a()
a(c)
a(b?){
Switch {
Case IsSet(b):
MsgBox "Set"
Default:
MsgBox "Unset"
}
}
If present, SwitchValue is evaluated once and compared to each case value until a match is found, and then that case is executed. Otherwise, the first case which evaluates to true (non-zero and non-empty) is executed. If there is no matching case and a Default is present, it is executed.
Code: Select all
Case !IsSet(b):
MsgBox "Unset"