Wednesday, May 16, 2012

AutoHotkey Ternary Operator

Just a quick note for the moment on how to use ternary operators in AutoHotkey.  A ternary operator for those who are unfamiliar with this is an "If...Then...Else..." statement written in a small amount of code, usually on one line, and exists in most programming languages.

For Example, the statement:

 

If (ThisCondition = true)
    ThisVar:=1
Else
    ThisVar:=2

Converted to Ternary this would look like:

ThisVar:=(ThisCondition = true) ? 1 : 2
I'll add as there are a whole bunch of methods using the Ternary Operator in AutoHotkey (discussed on http://www.autohotkey.com/forum/topic29752.html) which I'll put in soon. I just needed something on my site now as I find myself looking for this bit of info every now and again.

Add comment

Please note: all comments are reviewed before being published.


Security code
Refresh

Member Login

Joes Latest Members

A huge WELCOME goes to today's newest members:

  • infonat
Member Signups (Activated)
BeforeCurrentTrend
Day21=
Week105ê
Month11224ê
Year2,265612ê

Member Stats
78 guests are currently online.
1,178 members are still deciding.
There are 5,935 members in total.

Latest Comments

Paypal Donations

Want to support my work? Any donation is a blessing :c)