single-line way to write if??

Propose new features and changes
cgx5871
Posts: 319
Joined: 26 Jul 2018, 14:02

single-line way to write if??

06 Oct 2023, 10:38

Does anyone think that if can be added in a single line?
Required in not very complex scenarios
appear legible

For example, add "then" or comma, or other identifiers
Ternary operator cannot replace a single if without else
It will make the expression difficult to read

single-line Can make the script appear clear
iseahound
Posts: 1471
Joined: 13 Aug 2016, 21:04
Contact:

Re: single-line way to write if??

06 Oct 2023, 16:02

Code: Select all

if true
   b := 5
   
(true) && (b := 5)
TAC109
Posts: 1129
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: single-line way to write if??

06 Oct 2023, 17:47

See this thread for up-to-date tricks.

Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe

Return to “Wish List”

Who is online

Users browsing this forum: No registered users and 11 guests