AutoHotkey Community

It is currently May 27th, 2012, 12:11 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: AutoHotkey_L v1.0.97.02
PostPosted: March 28th, 2011, 3:36 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.

Background information about the new syntax features can be found in the following two threads:


Last edited by Lexikos on April 14th, 2011, 1:59 pm, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2011, 6:03 am 
Offline

Joined: October 2nd, 2009, 12:43 pm
Posts: 283
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"" } ] }}")


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2011, 6:08 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 28th, 2011, 10:38 pm 
Thank You Sir - I've been highly anticipating the JSON support since the release of the For-loop :) . Everything seems to be working good.


Top
  
Reply with quote  
 Post subject:
PostPosted: March 29th, 2011, 9:34 am 
Offline

Joined: February 25th, 2009, 5:50 am
Posts: 28
Location: Auckland, New Zealand
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!!!!!!!!!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 2nd, 2011, 2:23 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 2nd, 2011, 8:05 am 
Offline
User avatar

Joined: April 4th, 2009, 8:19 pm
Posts: 1143
Location: Croatia
Thank you for continued support. As always, you are doing a great job! 8)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2011, 8:06 pm 
Offline

Joined: February 19th, 2010, 8:07 pm
Posts: 615
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:

Code:

; 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"
        }

_________________
Main Project: AutoHotkey Toolkit
Unless specified otherwise all my code is written for the latest Autohotkey L Unicode version.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2011, 9:56 pm 
Offline

Joined: October 13th, 2009, 10:09 pm
Posts: 1389
I think the comma might make it act like auto concatenation for expressions in your first case.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 7th, 2011, 10:37 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 2:02 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group