Thursday, June 20, 2013
   
Text Size
Login

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:

 


  1.  If (ThisCondition = true) 
  2.      ThisVar:=1 
  3.  Else 
  4.      ThisVar:=2 

Converted to Ternary this would look like:


  1.  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.

Comments   

iBob35555VR
# iBob35555VR Thu, 26th July 2012
Oh ok So
Var := (Condition) ? Return_if_true : Return_If_false

Nice =P
Like | Dislike | 0 Reply | Reply with quote | Quote
Add Comment

Name:

Email:

Website:

Message:



Human Check:

Security code
Refresh

Please type what you see in the image above:

Latest Posts

  • Joes Quicklist Weblinks (JQW)

    • Tue 18-Jun-13
      Hi Joel, Great module, it really fills a need, and I'm not even using the thumbnails. It doesn't seem ...
      egrutz
  • Migrate Joomla! 1.5.x to 2.5.x+

    • Fri 07-Jun-13
      Hi Drew, I've got a silly question, are you sure the template you are using has been upgraded or ...
      Joel Lipman  
    • Wed 05-Jun-13
      Joel, Thanks for the newly updated instructions. I was nearly successful in getting everything working.
      drew  
    • Wed 05-Jun-13
      Hi Drew, Good point. You need to copy your images folder from your old site over to your new one. You ...
      Joel Lipman  
    • Tue 04-Jun-13
      Making a little progress here. I already had a copy of the live site running on this test server. So ...
      drew