20211022 1505 

 

REF

[1] "https://jacks-autohotkey-blog.com/2016/05/27/autohotkey-toggles-and-the-ternary-operator-beginning-hotkeys-part-18/"

 

예제

var := x>y ? 2 : 3

 

Above is same as below

If(x>y) {

  var:=2

} else {

  var:=3

}

 

(문제) 만약에 else가 없는 ternary를 쓰고 싶다면?

x:=1
y:=2
var := x>y ? 1 : var
MsgBox,% var
  
x:=3
y:=2
var := x>y ? 1 : var
MsgBox,% var



Posted by Weneedu
,


출처: https://privatedevelopnote.tistory.com/81 [개인노트]