Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

v1.0.31 released: Functions (parameters and return values)


  • Please log in to reply
31 replies to this topic
Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Although this release has been extensively tested, quite a few low-level changes were made. It is recommended that mission-critical scripts be re-tested -- or that you wait two weeks for any bugs to get fixed -- prior to adopting this version.

Here are the changes for v1.0.31:

Fixed the inability of a timer to reset itself. For example, if "SetTimer, MyTimer" is done within the MyTimer subroutine, the timer will begin waiting for an entirely new interval to expire before running again.

Fixed syntax checker reporting parentheses inside of quoted strings as unbalanced.

Fixed GuiControl to be able to change the ReadOnly attribute of an Edit control. [thanks Bahri]

Changed expressions so that references to invalid dynamic variables such as Array%VarContainingSpaces% produces a runtime warning.

Lowered the precedence of string concatenation in expressions. Although this is unlikely to affect any scripts, if you have any doubt please consult the operator precedence table.

Improved string concatenation in expressions to work on anything (e.g. arrays and sub-expressions). In addition, a period can be used as a concatenation operator to improve readability.

Dynamic variables such as Array%i% are up to 1000 times faster. A script may now have several million variables without a large slow-down. [thanks Lazlo]

Improved the performance of GuiControl and GuiControlGet when used on a window that has hundreds of controls.

Expressions that use a lot of ANDs and ORs are faster due to short-circuit boolean evaluation.

Improved memory conservation in scripts that use thousands of variables by adding two new variable capacities: 1 and 6. Formerly, the smallest capacity other than zero was 63.

Added built-in variables A_LineNumber and A_LineFile, which contain the currently executing line number and the file name to which it belongs. [thanks toralf]

Added directive #ClipboardTimeout, which changes how long the script persists in trying to open the clipboard (default 1000 ms). [thanks Tekl & Jason Payam Ahdoot]

Added the ability to pass parameters and receive return values from functions. Functions also support local variables. In addition, ListVars can show the contents of local variables to help debugging. See functions for details.

http://www.autohotkey.com/download/

jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004
YES!!!!!!!

('nuff said)

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
WooHoo!! Thanks Chris :) .

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
That function parameter feature must've taken lot of time... no wonder it took you so long to release this one. Thanx Chris, and congratulations on another fine release!

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Yes, a lot of code was added this time. The disadvantage of this is that compiled scripts will all probably be about 6 KB larger than they were before.

Jon
  • Members
  • 349 posts
  • Last active: Aug 30 2011 08:35 PM
  • Joined: 28 Apr 2004
That's brilliant. Thanks for all the work you've put into this version Chris. I've got a few scripts I'd like to re-write with functions to make the code neater and easier to update.

CarlosTheTackle
  • Members
  • 102 posts
  • Last active: Jan 29 2007 12:07 PM
  • Joined: 19 Oct 2004
I guess now we could do with a 'Functions repository' here on the forum to share functions. Chances are someone's already done a similar function to the one you need, so why re-invent the wheel.

I'll get the ball rolling by re-writing my 'Convert YYYYMMDDHHMMSS to Unix Epoch time' code as a function.

dijiyd
  • Members
  • 87 posts
  • Last active: Oct 22 2005 01:29 PM
  • Joined: 31 Mar 2004
Has probably been said many times before, but: Woohooo!!!! and Yeeaaaaaah!!!

Thanks Chris, must'ave been very hard adding new features and yet, still keep backwards-compatibility.

It'll probably be much easier to integrate scripts from now on, I mean, no more naming conflicts. Much.

Nemroth
  • Members
  • 278 posts
  • Last active: Dec 31 2011 10:53 PM
  • Joined: 07 Sep 2004
Wahooou !! The features are great !!! It's a major release.
Congratulations, and thanks a lot !!!

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

I guess now we could do with a 'Functions repository' here on the forum to share functions.

Good idea. I'll rename the Scripts forum to indicate that functions should also be posted there.

niwi
  • Members
  • 140 posts
  • Last active: Feb 04 2013 02:51 PM
  • Joined: 27 Feb 2005
Hi Chris,

the arrays are processed really faster than in the earlier version. Thanks.

But the function-feature: now I have to redesign my big script on which I'm working... ;-)

Chris, you are the man... :p

NiWi.

deguix
  • Members
  • 87 posts
  • Last active: Jun 17 2014 05:18 AM
  • Joined: 26 Aug 2004
Functions make scripting a lot easier! Thanks!

I'm going to update some of my scripts this week... :D

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
Awesome!

What can we expect to get more of in built-in functions in future next releases? -It's really useful and might change how everybody scripts (v2 :p).

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


jonny
  • Members
  • 2951 posts
  • Last active: Feb 24 2008 04:22 AM
  • Joined: 13 Nov 2004

Awesome!

What can we expect to get more of in built-in functions in future next releases? -It's really useful and might change how everybody scripts (v2 :p).


I think to have an AutoHotkey 2.0 would mean a revolutionary change that throws off the burden of backwards compatibilty. One thing I've always thought would be great is different "wrappers," different syntax sets that could suit different needs. Of course, that would take forever, and there might be more unforeseen improvements. We'll just have to wait and see.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

What can we expect to get more of in built-in functions in future next releases?

Certainly. If there's a way to do it without bloating the code, there should eventually be a function equivalent for every command that accepts an output variable.