Code: Select all
if (true){OutputDebug(77)}
Code: Select all
if (true){OutputDebug(77)}
Code: Select all
if (b == "")
b := 1
; becomes
(b == "") && b := 1
; Lift color to 32-bits if first 8 bits are zero.
if not (color >> 24)
color |= 0xFF000000
; Becomes
(color >> 24) || color |= 0xFF000000
The precedence of the assignment operators is automatically raised when it would avoid a syntax error or provide more intuitive behavior. For example: not x:=y is evaluated as not (x:=y). Similarly, ++Var := X is evaluated as ++(Var := X); and Z>0 ? X:=2 : Y:=2 is evaluated as Z>0 ? (X:=2) : (Y:=2).
Thank you very much. It really helps me. And I am sorry for the late reply as I didn't see it until now.iseahound wrote: ↑30 Jan 2023, 10:49I generally use the boolean operators.
Note 1: The beginning must have an open parentheses. This acts as a guard to prevent !a && a := 3 from being appended to the previous line.Code: Select all
if (b == "") b := 1 ; becomes (b == "") && b := 1 ; Lift color to 32-bits if first 8 bits are zero. if not (color >> 24) color |= 0xFF000000 ; Becomes (color >> 24) || color |= 0xFF000000
Note 2: The assignment operator has its precedence lifted. See https://www.autohotkey.com/docs/v1/Variables.htm#AssignOp
The precedence of the assignment operators is automatically raised when it would avoid a syntax error or provide more intuitive behavior. For example: not x:=y is evaluated as not (x:=y). Similarly, ++Var := X is evaluated as ++(Var := X); and Z>0 ? X:=2 : Y:=2 is evaluated as Z>0 ? (X:=2) : (Y:=2).