Search found 5659 matches

by lexikos
Today, 06:11
Forum: Ask For Help
Topic: OOP AHK good practise - validation, setters, throw exception
Replies: 9
Views: 180

Re: OOP AHK good practise - validation, setters, throw exception

[Edit: Somehow I overlooked the fact that SirRFI is not using properties.] The return value of set should be either the value which was assigned or the new value of the property. The return value of get or set becomes the result of the sub-expression which invoked the property. For example, val := o...
by lexikos
Today, 05:42
Forum: AutoHotkey v2 Development
Topic: Functions | &ByRef • ByVal
Replies: 18
Views: 356

Re: Functions | &ByRef • ByVal

I do not say that. I read this: if a function changes a parameter, and that is not the purpose of the function, it should specify that parameter to be byval. ...as "if changing a parameter is not the purpose of the function, it should specify that parameter to be byval". Assigning a value...
by lexikos
Today, 04:51
Forum: Ask For Help
Topic: ActiveX and HTML Version?
Replies: 1
Views: 53

Re: ActiveX and HTML Version?

"Gui Add, ActiveX" is not something designed for adding HTML to a GUI. ActiveX components such as the MSIE browser control can be embedded into a GUI window ActiveX is basically a set of patterns that controls from different developers may follow to allow programs to utilize those controls...
by lexikos
Today, 00:17
Forum: AutoHotkey v2 Development
Topic: Functions | &ByRef • ByVal
Replies: 18
Views: 356

Re: Functions | &ByRef • ByVal

I read the documentation. Sometimes I feel you may be in the minority on that. ;) v1 has many quirks that are well-documented, and yet still frequently cause confusion. Real confusion is what causes the NumXXX functions, or things like this that are still allowed: DllCall("MessageBox"...
by lexikos
22 Apr 2018, 06:05
Forum: AutoHotkey v2 Development
Topic: long path support
Replies: 8
Views: 187

Re: long path support

... curiously, some but not all long paths are retrieved if you omit it.
I already explained this behaviour in the test build topic.
I'm not sure whether you stated anywhere that '\\?\' must be used
I did, in the test build topic.
by lexikos
22 Apr 2018, 05:42
Forum: AutoHotkey v2 Development
Topic: AutoHotkey v2 alpha (UPDATES)
Replies: 48
Views: 24101

v2.0-a094-29bbc64

Improved error reporting for unbalanced ()/[]/{}. Fixed detection of invalid v1 legacy assignments. Fixed Func/DllCall optimization and OutputVar detection with ternary and short-circuit operators. Split "Unknown property or method" into two messages. Fixed return string_var optimization f...
by lexikos
22 Apr 2018, 05:31
Forum: AutoHotkey v2 Development
Topic: Functions | &ByRef • ByVal
Replies: 18
Views: 356

Re: Functions | &ByRef • ByVal

As it is now, when you call a function you need to check which parameters are byref, if it was changed, you'd have to look to see which parameters are byval. I think you missed the point. Supposing that no functions are ByVal, what you're saying is that it's easy to tell which functions might chang...
by lexikos
22 Apr 2018, 05:15
Forum: AutoHotkey v2 Development
Topic: long path support
Replies: 8
Views: 187

Re: long path support

Oh dear, with a maximum component length of 255, there's virtually no benefit in having long paths. That's ridiculous. Of course, the purpose of long paths is to create files with absurdly long names in the root of the drive. MAX_PATH is exactly enough for the drive letter (C:\), a name of 255 char...
by lexikos
22 Apr 2018, 04:48
Forum: Announcements
Topic: Test build - Obj.Count(), OnError(), long paths, experimental switch-case
Replies: 9
Views: 349

Re: Test build - Obj.Count(), OnError(), long paths, experimental switch-case

I have uploaded a new build which fixes: ⋅  Switch crashing, as reported by Helgef. ⋅  Loop Files, .., D reporting the directory's path incorrectly (an old bug). ⋅  Loop Files, C:* failing to iterate (a new bug). ⋅  Loop Files, C:, D failing to iterate (it pre...
by lexikos
22 Apr 2018, 02:43
Forum: AutoHotkey v2 Development
Topic: long path support
Replies: 8
Views: 187

Re: long path support

vNum := 300 ;didn't work Your destination path is invalid, not too long. No individual component within the path can exceed the maximum length of a name supported by the file system. The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum t...
by lexikos
22 Apr 2018, 02:28
Forum: AutoHotkey v2 Development
Topic: For-loops | Range object
Replies: 11
Views: 207

Re: For-loops | Range object

I was comparing a for loop which stores each value in a variable to a Loop Count which stores each value in a variable, and my conclusion was backed by benchmarks in v1. Your theory does not cover all of the factors, such as the overhead of creating the enumerator object and invoking it via dynamic ...
by lexikos
21 Apr 2018, 22:27
Forum: AutoHotkey v2 Development
Topic: Functions | &ByRef • ByVal
Replies: 18
Views: 356

Re: Functions | &ByRef • ByVal

I will not make parameters ByRef by default. Doing so would make it much harder, when looking at the code, to determine whether a variable passed to a function might be modified by that function. When a global variable is passed to a (ByRef) parameter, it is also possible for that parameter's value ...
by lexikos
21 Apr 2018, 21:34
Forum: AutoHotkey v2 Development
Topic: For-loops | Range object
Replies: 11
Views: 207

Re: For-loops | Range object

What's stopping you from making it yourself? "Performance" is overrated. If you want performance iterating over a range of integers, allocating an enumerator object (built-in or not) is not the way to get it. The outdated for loop you suggested would be slower when operating on arrays than...
by lexikos
21 Apr 2018, 21:11
Forum: AutoHotkey v2 Development
Topic: long path support
Replies: 8
Views: 187

Re: long path support

Does this topic have some relevance to AutoHotkey v2 Development that I'm not seeing? The file loop currently handles '260+' files in full, but not folders. It will list '260+' folders, but it will not recurse into them, and it will not accept '260+' folders as the starting directory. I did some tes...
by lexikos
20 Apr 2018, 19:04
Forum: AutoHotkey v2 Development
Topic: MAX_PATH
Replies: 1
Views: 2354

Re: MAX_PATH

I initially thought that some scripts might rely on the current behaviour of Loop Files to skip long paths, so the suggestion to consider this as part of v2 was justified. However, I found a discrepancy between how Loop Files limits paths and how the OS limits paths. Basically, scripts cannot rely o...
by lexikos
20 Apr 2018, 18:33
Forum: Wish List
Topic: Exception Handling Directive
Replies: 8
Views: 1870

Re: Exception Handling Directive

I have uploaded a test build including the OnError() function which will be added in v1.1.29.00.
by lexikos
20 Apr 2018, 18:31
Forum: Scripts and Functions
Topic: Switch(case)
Replies: 8
Views: 438

Re: Switch(case)

by lexikos
20 Apr 2018, 18:26
Forum: Announcements
Topic: Test build - Obj.Count(), OnError(), long paths, experimental switch-case
Replies: 9
Views: 349

Test build - experimental switch-case

Switch In 2012 I wrote a basic implementation of switch-case to help weigh up cost vs. benefit of adding it to the language. The result wasn't really favourable, so I shelved it. There have been a few more requests for (and imitations of) switch-case, so I chose to complete the experiment, though I...
by lexikos
20 Apr 2018, 18:18
Forum: Announcements
Topic: Test build - Obj.Count(), OnError(), long paths, experimental switch-case
Replies: 9
Views: 349

Test build - incomplete long path support

This test build includes heavy revision of Loop Files: ⋅ Fixes A_Loop variables and the loop itself failing or behaving incorrectly if the working directory is changed during the loop. ⋅ Fixes a significant performance issue with A_LoopFileLongPath (and A_LoopFileShortPath is als...
by lexikos
20 Apr 2018, 17:48
Forum: Announcements
Topic: Test build - Obj.Count(), OnError(), long paths, experimental switch-case
Replies: 9
Views: 349

Test build - Obj.Count(), OnError(), long paths, experimental switch-case

v1.1.28.02-10+g1a41623 For v1.1.29.00: ⋅ Added Obj.Count() and ObjCount(Obj) . ⋅ Added ObjGetBase(Obj) and ObjSetBase(Obj, BaseObj) . ⋅ Added ObjRawGet(Obj, Key) . ⋅ Added OnError(Func [, AddRemove]) . OnError s...

Go to advanced search