Since v1.1.01 a closing parenthesis may turn continuation section into an expression. Help file says, in order to do that, a closing parenthesis should appear in the line of options of the continuation section.
But I could not do that. If anybody used this feature, please leave your examples here.
A closing parenthesis as an option of continuation section
Re: A closing parenthesis as an option of continuation secti
do you have a link to that?
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: A closing parenthesis as an option of continuation secti
Very simple code:
Msgbox,
(
This
is
continuation
section
)
How to turn all the continuation section into expression by including closing ) in options line ?
Msgbox,
(
This
is
continuation
section
)
How to turn all the continuation section into expression by including closing ) in options line ?
Re: A closing parenthesis as an option of continuation secti
Continuation section is sort of like a preprocessor - it adjusts the code _before_ a given line is recognized as a command / an expression.
Code: Select all
Msgbox, % b := "
(
This
is
continuation
section
)"
Re: A closing parenthesis as an option of continuation secti
Thanks for advice above, that is known for me, and information about preprocessing. But I asked for using a closing parethesis on options line of continuation section. It is a feature defined in the help document. As I understand, it should interprete a content inside a pair of parentheses as an expression.
Re: A closing parenthesis as an option of continuation secti
Code: Select all
MsgBox, test
(x := 3)
Msgbox, %x%
Re: A closing parenthesis as an option of continuation secti
The code
works as well as this one (without parentheses)
I assume, possibly the option of a closing ")" does not work at all.
Code: Select all
MsgBox, test
(x := 3)
Msgbox, %x%
Code: Select all
MsgBox, test
x := 3
Msgbox, %x%
Re: A closing parenthesis as an option of continuation secti
It was a demonstration of the use of it, not an explanation why you might want to use it.
Here's a demonstration where it might actually be useful:
Here's a demonstration where it might actually be useful:
Code: Select all
; Some code
(x > 3+4) ? CallFunc1() : CallFunc2()
; some more code
Re: A closing parenthesis as an option of continuation secti
Never noticed it and had to read the docs more than once:
It's not an option of a continuation section, though mentioned there.) [v1.1.01+]: If a closing parenthesis appears in the continuation section's options (except as a parameter of the Join option), the line is reinterpreted as an expression instead of the beginning of a continuation section. This allows expressions like (x.y)[z]() to work without the need to escape the opening parenthesis.
Re: A closing parenthesis as an option of continuation secti
The code (x > 3+4) ? CallFunc1() : CallFunc2() works just like that x > 3+4 ? CallFunc1() : CallFunc2(). In this case parentheses enclosing the expression x > 3+4 are dispensable.
Anyway, I think, for more clarity in the help document, there would be better to appropiate the definition of a closing parenthesis on the subject of continuation section in “remarks” clause rather than in its options list.
Anyway, I think, for more clarity in the help document, there would be better to appropiate the definition of a closing parenthesis on the subject of continuation section in “remarks” clause rather than in its options list.
Re: A closing parenthesis as an option of continuation secti
I guess this could be another example:
Code: Select all
chicken := "aaaaaa" and 111 = "0x111"
;(chicken := "aaaaaa") and 111 = "0x111"
msgbox % chicken
Re: A closing parenthesis as an option of continuation secti
That's a good example. It lets see an effect of applying parentheses in expression.
mAny tHanKs !
mAny tHanKs !