Is it possible to have a function (actually a procedure, because the return value is discarded), called without the parentheses, like an inbuilt command or a sub in VBA?
So if we have a function Do_things(X, Y) is it possible to call it with "Do_things X, Y".
The reason I ask this is that functions are very useful to encapsulate the code (with local variables), unlike subs.
Andrew
Functions without parenthesis Topic is solved
Re: Functions without parenthesis Topic is solved
Hey this feature is available in our v2! (alpha)
https://lexikos.github.io/v2/docs/Functions.htm#intro
Code: Select all
Add(2, 3)
Add 2, 3 ; Parentheses can be omitted if used at the start of a line.
Re: Functions without parenthesis
Ahh, I wait with bated breath ...
Re: Functions without parenthesis
What's the difference instead of calling it by
Do_things(X, Y)
?
Regards
Do_things(X, Y)
?
Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Re: Functions without parenthesis
Well, for a start you don't need to remember that the ( can't be preceded by a space.
Seriously though, a few times I've need to replace 'commands' with my own functions (which *use* the command), and found this quite tedious.
Seriously though, a few times I've need to replace 'commands' with my own functions (which *use* the command), and found this quite tedious.
Re: Functions without parenthesis
Do you have a concrete example?
Regards
Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
Re: Functions without parenthesis
OK. Consider a block including several Send statements, which we decide to change to a call to a function Fsend to send in a different way, or with delays.
So 'send {F3}' needs to be changed to 'Fsend("{F3}")'. Takes some time to change them, and doesn't read anywhere else as well.
So 'send {F3}' needs to be changed to 'Fsend("{F3}")'. Takes some time to change them, and doesn't read anywhere else as well.
Who is online
Users browsing this forum: No registered users and 250 guests