Code: Select all
Switch 1
{
Case 1:
if true {
a:=1
}
Default: ;Error: Unexpected "Case"
a:=1
}
Code: Select all
Switch 1
{
Case 1:
if true
{
a:=1
}
Default:
a:=1
}
Code: Select all
Switch 1
{
Case 1:
if true {
a:=1
}
Default: ;Error: Unexpected "Case"
a:=1
}
Code: Select all
Switch 1
{
Case 1:
if true
{
a:=1
}
Default:
a:=1
}
Code: Select all
switch 1 {
case 1:
if (true) {
a:=1
}
default:
a:=1
}
Code: Select all
blah(args*) {
hotkey args*
}
Code: Select all
Case 1:
if true {
a:=1
}
Default:
Code: Select all
Case 1: if true { a:=1 }
Default:
Code: Select all
Case 1: if true
{
a:=1
}
Default:
Code: Select all
Case 1: if (true) {
a:=1
}
Default:
a line that ends with an expression operator is automatically merged with the line below it.
Source: Scripts - Definition & Usage | AutoHotkey v2
Function call statements cannot be variadic; that is, the parameter list must be enclosed in parentheses (or brackets for a property).
Source: Functions - Definition & Usage | AutoHotkey v2
Aside from changing the variadic syntax (which I avoid), I don't think there's any other way to resolve the ambiguity between a variadic function call statement and multiplication spanning multiple lines. The rule is effectively that *) or *] denotes a variadic call, and not just *. This was already implied, and is actually how it was implemented, but function call statements effectively insert the parentheses at load time (after line continuation).When optional parameters are omitted, any commas at the end of the parameter list must also be omitted to prevent line continuation.
Function call statements cannot be variadic, although they can pass a fixed number of parameters to a variadic function.
Source: Scripting Language | AutoHotkey v2
I wasn't 100% sure about the change but figured there would be some problems that would only be revealed if I try it.There must not be any non-whitespace characters between the asterisk (*) and the symbol which ends the parameter list.
Source: Functions - Definition & Usage | AutoHotkey v2
Code: Select all
switch StrLower(arg) {
case "input":
try {
DetectHiddenWindows(1)
}
case "main":
return 1
}
Users browsing this forum: No registered users and 61 guests