jeudi 16 septembre 2021

Is it possible to keep `if ... in` and `{` on the same line without breaking the code?

; 👇 not work
Var := "Var"

if Var in Foo,Bar,Baz {
  MsgBox statement 1
  MsgBox statement 2
} else {
  MsgBox statement 3
  MsgBox statement 4
}

; 👇 not work
Var := "Var"

if (Var in Foo,Bar,Baz) {
  MsgBox statement 1
  MsgBox statement 2
} else {
  MsgBox statement 3
  MsgBox statement 4
}

; 👇 works, but the brace positions are inconsistent,
;    is it possible to keep `if ... in` and `{`
;    on the same line without breaking the code?
Var := "Var"

if Var in Foo,Bar,Baz
{
  MsgBox statement 1
  MsgBox statement 2
} else {
  MsgBox statement 3
  MsgBox statement 4
}

Aucun commentaire:

Enregistrer un commentaire