Using commas and Parens to condense code in AutoHotkey

AutoHotkey is a pretty flexible language and can be condensed down (which I like) in many ways.

I recorded this video to demonstrate using parens and commas. BTW, you might also be interested in my one-line operator examples in AutoHotkey.

Using commas and Parens to condense code in AutoHotkey

Below is the code I demonstrated Using commas and Parens to condense code in AutoHotkey


#Include  
;**************************************
#SingleInstance,Force
Var1:="bob",Var2:="fred", Var3:="Joe"
(Var1:="bob")(Var2:="fred") (Var3:="Joe")
MsgBox % Var1 a_tab Var2 a_tab Var3

txt:="this is what I just typed"
;~ Obj:=StrSplit(txt," ")
Obj:=StrSplit(txt," "),Var1:=obj.1,Var2:=obj.2
Var1:=(obj:=StrSplit(txt," ")).1,Var2:=obj.2
;~ MsgBox % IsObject(txt)
m(obj,Var1,var2)

Comments are closed.