Obsolete test build - Some v2 features in v1

Community news and information about new or upcoming versions of AutoHotkey
lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Obsolete test build - Some v2 features in v1

13 Mar 2015, 22:36

OBSOLETE: Get v1.1.21 instead.



v1.1.20.02-5+g6fdd7fa
Changes:

  • Added Loop Files and Loop Reg sub-commands as in v2.

    Code: [Select all] [Download] GeSHi © Codebox Plus

        Loop, Reg, RootKey[\Key, Mode]
    Loop, Files, FilePattern [, Mode]

    Mode:
    K or D -- include keys/directories
    V or F -- include values/files
    R -- recurse
  • Changed the parser to allow % expression for InputVar args of Loop Parse, SplitPath and String commands. This is primarily for Loop Parse, so that Loop Parse, % var will work in both v1 and v2 (whereas var in Loop Parse, var is interpreted as a literal string in v2).

  • Revised Object methods.

    Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

    Insert and Remove are deprecated.

v1.1.20.02-9+g9996e86

Added Ord() and StrReplace().
Updated Chr(), RegRead, RegWrite and RegDelete.
Details in a later post.

Background info:

Coco
Posts: 771
Joined: 29 Sep 2013, 20:37
GitHub: cocobelgica

Re: New test build - Some v2 features in v1

13 Mar 2015, 22:49

Nice. Loop, Parse, % expression is really convenient. Btw, will you also consider Backport v2 quoted literal "strings"/'strings' duality.? You did mention it here.
lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Some v2 features in v1

13 Mar 2015, 23:15

As implied by omission from my previous post, I do not plan to implement it. I would either need to port a considerable amount of refactored code and modify it to be backward-compatible, or re-implement it all over again. Just allowing single quotes wouldn't be difficult, but it wouldn't be compatible with v2 without also allowing variable references in the single-quoted string.
Coco
Posts: 771
Joined: 29 Sep 2013, 20:37
GitHub: cocobelgica

Re: New test build - Some v2 features in v1

13 Mar 2015, 23:29

I understand. Would allowing escaping of " as `" within quoted literal strings present the same challenges above? An error is thrown currently in v1.1+, so it should be backwards compatible. I never understood why Chris opted with "" as escaping.

Edit:
By allowing at the least the `" escaping (and promoting its usage moving forward), scripts written from here on out, will be more future-proof. Just my stance in relation to the request.
lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Some v2 features in v1

15 Mar 2015, 00:39

v1.1.20.02-9+g9996e86

  • Added Ord():
    On Unicode builds, it returns a Unicode code point -- so it differs from Asc() only if the first two UTF-16 code units represent a supplementary character (>0xFFFF).
    On ANSI builds, it is equivalent to Asc().
  • Updated Chr() to support values >0xFFFF on Unicode builds.
  • Added StrReplace() as in v2.
  • Added backward/forward-compatible RootKey\SubKey syntax to Reg commands. If no slash is present, SubKey must be present as a separate parameter as in previous versions (but can be empty).
  • Removed the obsolete and undocumented 5-parameter mode of RegRead, which was exclusively for AutoIt compatibility (the extra parameter was never used).

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


The benefits of this syntax are:
  • RootKey\SubKey can be contained within a single variable.
  • Easier copy-paste from other sources, such as the internet or regedit.

Note that in a registry loop, these commands support an additional syntax mode which isn't affected by these changes:

Code: [Select all] [Download] GeSHi © Codebox Plus

RegRead OutputVar  ; Reads the current loop item.
RegWrite Value ; Writes the current loop item.
RegDelete ; Deletes the current loop item.
ahk7
Posts: 100
Joined: 06 Nov 2013, 16:35

Re: New test build - Some v2 features in v1

15 Mar 2015, 04:00

In v1.1.20.02 and earlier the code below worked, with v1.1.20.02-9+g9996e86 64-bit it gives an error "Unexpected %"

Code: [Select all] [Download] GeSHi © Codebox Plus

o:={ext:"a,b,c"}
MsgBox % o.ext
test:="b"

If test in % o.ext ; v1.1.20.02-9+g9996e86 gives Error: Unexpected %
MsgBox Found
lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Some v2 features in v1

15 Mar 2015, 04:47

Fixed in v1.1.20.02-10+gef256dc.
User avatar
jNizM
Posts: 2295
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: New test build - Some v2 features in v1

19 Mar 2015, 05:46

Just for reference AHK v1.1.20.XX
A_OSVersion and latest Win10 Build (10041)
Image

Thanks again for implement
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you

Return to “Announcements”

Who is online

Users browsing this forum: No registered users and 2 guests