• Intro to AutoHotkey HotStrings with AutoHotkey Intermediate AutoHotkey GUIs are Easy with AutoHotkey Intro to DOS & AutoHotkey

Demystifying the Ternary Operator in AutoHotkey: Short-hand If-Else logic

TernAutoHotkey has pretty straight-forward If-Then-Else logic however it can take quite a few lines of code to do some simple evaluations.   Ternary Operators are a great way to write short / concise code in one line!  🙂

The basic form is that you first evaluate a condition.  If the value resolves to being true, the first parameter is returned.  If it is False, the second parameter is returned.

(Condition)?(True) : (False)

Ternary Operator video walk-throughAutoHotkey Merchandise-White Stress ball

Comments are closed.

  • Intro to AutoHotkey HotStrings with AutoHotkey Intermediate AutoHotkey GUIs are Easy with AutoHotkey Intro to DOS & AutoHotkey