Jump to content

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

AutoHotkey_L v1.0.97.02


  • Please log in to reply
10 replies to this topic
Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
v1.0.97.00 (March 28)

Added {key: value} as syntax sugar for Object("key", value).
Added [x, y, z] as syntax sugar for Array(x, y, z), which is a new function equivalent to Object(1, x, 2, y, 3, z).
Added slight optimization: resolve any reference to True, False, A_PtrSize or A_IsUnicode in expressions at load-time.
Fixed hotkey parser to treat x & ^y as an error instead of ignoring ^.

v1.0.97.01 (April 2)

Fixed the 64-bit build to not truncate HWNDs or SendMessage/PostMessage params to 32 bits.
Fixed */:: being treated as an invalid hotkey (broken since L54).
Fixed the icons.

v1.0.97.02 (April 14)

Fixed misinterpretation of comma as an arg delimiter when enclosed in {} in an expression.
Fixed For-loop to set A_Index only after the Expression arg is evaluated, so that the outer loop's value can be used.
Fixed default script location to be based on the directory containing the EXE (as documented), not the working directory.
Improved load-time validation to detect invalid attempts to jump out of a function with Goto.

Downloads (etc.)Background information about the new syntax features can be found in the following two threads:
[*:109xg9c3]AutoHotkey_L beta with JSON support
[*:109xg9c3]Wish List: JSON -- obj := {key: value}, arr := [x, y, z]

flak
  • Members
  • 283 posts
  • Last active: Jan 01 2012 06:20 PM
  • Joined: 02 Oct 2009
Is there any easy way to convert JSON string stored in variable to object without parsing it all over again?
Something roughly like Object("{ data: { translations: [ { translatedText: ""Test"" } ] }}")

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
That would be entirely impossible. Maybe you meant "without the script parsing it", in which case the answer is "no". These new features are simple extensions of expression syntax. Dynamic evaluation of expressions is not supported.

a4u
  • Guests
  • Last active:
  • Joined: --
Thank You Sir - I've been highly anticipating the JSON support since the release of the For-loop :) . Everything seems to be working good.

awesomeo
  • Members
  • 28 posts
  • Last active: Mar 06 2012 07:22 AM
  • Joined: 25 Feb 2009
Wow! Nice one - couldn't have come at a more appropriate time (for me anyway).

Works perfectly for me; combined with the ‘WinHttp.WinHttpRequest.5.1’ COM object makes for easy JSON-RPC conversations.

Thank you!!!!!!!!!

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
v1.0.97.01

Fixed the 64-bit build to not truncate HWNDs or SendMessage/PostMessage params to 32 bits.
Fixed */:: being treated as an invalid hotkey (broken since L54).
Fixed the icons.

Learning one
  • Members
  • 1483 posts
  • Last active: Jan 02 2016 02:30 PM
  • Joined: 04 Apr 2009
Thank you for continued support. As always, you are doing a great job! 8)

RaptorX
  • Members
  • 751 posts
  • Last active: Feb 19 2015 02:47 AM
  • Joined: 19 Feb 2010
I am not complaining or anything but is there any reason why you decided to not allow newlines before the braces when creating objects with the JSON format?

example:

; works
var1 := {  key1 : "this will work fine"
             ,  key2 : "because is the correct syntax" }


; doesnt work
var2 := {
	       key1 : "this wont work"
	      ,key2 : "it will cause an error"
	     }

AutoHotkey Toolkit [Main Project]
Scintilla Wrapper
LexAHKL

fragman
  • Members
  • 1591 posts
  • Last active: Nov 12 2012 08:51 PM
  • Joined: 13 Oct 2009
I think the comma might make it act like auto concatenation for expressions in your first case.

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Look for "continuation sections" in the help file index. This applies to all lines, including expressions and directives. Continuation sections and continuation lines take effect very early, before the virtual "line" (which may consist of multiple physical lines) is parsed. Your first example uses a continuation line, whereas your second does not.

Rather than "newlines before the braces" I think you meant newlines between the braces. It's simply not feasible with the current interpreter.

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
v1.0.97.02

Fixed misinterpretation of comma as an arg delimiter when enclosed in {} in an expression.
Fixed For-loop to set A_Index only after the Expression arg is evaluated, so that the outer loop's value can be used.
Fixed default script location to be based on the directory containing the EXE (as documented), not the working directory.
Improved load-time validation to detect invalid attempts to jump out of a function with Goto.