blanks in ternary operator Topic is solved

Discuss the future of the AutoHotkey language
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: blanks in ternary operator

24 Jan 2018, 16:53

- @coffee: Re. "". It's an important script error/conversion detail to know about. FWIW I did think up some of your for/against points, but my statement was neutral.

- This thread has a become a good collection of information re. omitted parameters. In that vein:
Object declaration syntax - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 37&t=43154
[] and {} already allow trailing commas in v2.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: blanks in ternary operator

25 Jan 2018, 17:33

If you are passing "", you are not omitting the parameter. "" is not a variable. For these built-in functions, the parameters are marked as "output variables", meaning only a variable is valid, and it must be writable.

ByRef does not require a variable, because that would defeat the ability to define a function to accept a varying number of variables. This might change if variadic functions are somehow improved to support variable references.

There is no good reason to pass "" when you mean to omit the parameter. If you get into that habit, you will get into trouble when you do it with a function which has a non-empty default value.

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 51 guests