Search found 45 matches

by coffee
01 Feb 2018, 00:58
Forum: AutoHotkey v2 Development
Topic: if var in/contains comma-separated list/array
Replies: 14
Views: 325

Re: if var in/contains comma-separated list/array

see also: StrSplit -> Delimiters He posted This would be less inconvenient to type, but still a bit bulky: if var contains StrSplit("Mon,Tue,Wed,Thu,Fri,Sat,Sun", ",") So "StrSplit" is bulky apparently, a function that already exists, is implemented and "s...
by coffee
24 Jan 2018, 14:33
Forum: AutoHotkey v2 Development
Topic: blanks in ternary operator Topic is solved
Replies: 21
Views: 754

Re: blanks in ternary operator Topic is solved

MsgBox(RegExReplace("aaaa", "a", "", "", 2)) ;doesn't work in AHK v2 Bug or not, this change just seems clearer to me (works in 2a083 and not in 2a086). When you do a byref, you want the name of a variable unquoted (the variable itself). An empty value, or a ...
by coffee
19 Jan 2018, 22:25
Forum: AutoHotkey v2 Development
Topic: a_iscompiled v2a082+
Replies: 4
Views: 207

a_iscompiled v2a082+

I'm gonna risk the bite and post this here. Can't find any changes relating to this, not sure if it extends to other a_ variables. For an uncompiled script containing if (a_iscompiled) msgbox("is compiled") else msgbox("not compiled") and A_IsCompiled — Contains 1 if the script i...
by coffee
17 Jan 2018, 15:33
Forum: Ask For Help
Topic: ahk v2+ahk_h COMPILER issue Topic is solved
Replies: 11
Views: 263

Re: ahk v2+ahk_h COMPILER issue Topic is solved

From here it looks like you are using lexikos' autohotkey's ahk2exe to compile an autohotkey_h script. Take from your quote Ahk2Exe.exe /in "C:\Program Files\AutoHotkey\Compiler\Ahk2Exe.ahk" /out "C:\Program Files\AutoHotkey\Compiler\Ahk2ExeH.exe" /bin "C:\Program Files\Auto...
by coffee
17 Jan 2018, 12:24
Forum: Ask For Help
Topic: ahk v2+ahk_h COMPILER issue Topic is solved
Replies: 11
Views: 263

Re: ahk v2+ahk_h COMPILER issue Topic is solved

/bin "C:\Program Files\AutoHotkey\Compiler\Unicode 32-bit.bin" Not sure what's up with your installation/download steps but that /bin path can't be used with autohotkey_h. Lexikos branch (main) is not compatible with autohotkey_h compilation mode. They use a different way to retrieve the ...
by coffee
09 Jan 2018, 22:24
Forum: AutoHotkey v2 Development
Topic: conversion logic, v1 = -> v1 := -> v2, two-way compatibility
Replies: 128
Views: 21602

Re: conversion logic, v1 = -> v1 := -> v2, two-way compatibility

What I want is something like this: ;libraries shared by multiple exe files: ;note: there is no A_AhkDir variable at present ;note: using A_AhkDir may not be necessary since you can do: ;path-to-the-currently-running-AutoHotkey.exe\Lib\ ; Standard library. #Include %A_AhkDir%\Lib\Lib1.ahk #Include ...
by coffee
09 Jan 2018, 21:29
Forum: AutoHotkey v2 Development
Topic: conversion logic, v1 = -> v1 := -> v2, two-way compatibility
Replies: 128
Views: 21602

Re: conversion logic, v1 = -> v1 := -> v2, two-way compatibility

- [EDIT:] I'm reminded of a fundamental problem with #Include, it is optimised to specify files relative to the path of the *script*, and not to the path of the *AHK exe*. There is this: Functions https://autohotkey.com/docs/Functions.htm#lib path-to-the-currently-running-AutoHotkey.exe\Lib\ ; Stan...
by coffee
02 Jan 2018, 01:18
Forum: AutoHotkey v2 Development
Topic: why was LoopParse (no space) removed?
Replies: 60
Views: 1809

Re: why was LoopParse (no space) removed?

Ah I see, none of these should have even been called that in the first place *from my perspective*, using the loop keyword. They all do different things, calling a different function. For and while could have also been handled by that block, and checked only when the users type loop in a line, savin...
by coffee
01 Jan 2018, 19:23
Forum: AutoHotkey v2 Development
Topic: why was LoopParse (no space) removed?
Replies: 60
Views: 1809

Re: why was LoopParse (no space) removed?

Well i did a quick untested mockup and reverted the commit that removed loopfiles into the latest alpha version, I karate chopped the loop subtype block loopfiles a_scriptdir "\*", "df" msgbox(a_loopfilename) loopfiles(a_scriptdir "\*", "df") msgbox(a_loopfile...
by coffee
01 Jan 2018, 17:55
Forum: AutoHotkey v2 Development
Topic: why was LoopParse (no space) removed?
Replies: 60
Views: 1809

Re: why was LoopParse (no space) removed?

Yes I understand. If Parse is not an expression why don`t be reserved word concatenated to loop. In this case loop family will become with clear syntax: loop(count) { } loopParse(string, delimiters, omitchars) { } loopFiles(filepattern, mode) { } ... loop<Name>(param*) { ; Name:= ["", &qu...
by coffee
01 Jan 2018, 15:14
Forum: AutoHotkey v2 Development
Topic: why was LoopParse (no space) removed?
Replies: 60
Views: 1809

Re: why was LoopParse (no space) removed?

loopParse vs loop "Parse" There 2 main syntaxes for loop: loop [count] { ;loop "Count," } [until [expression]] loop "loopCase" [param*] { ;loop "<Parse|Files|Read|Reg>," } [until [expression]] in other words: loop "<Count|Parse|Files|Read|Reg>," [pa...
by coffee
30 Dec 2017, 21:30
Forum: AutoHotkey v2 Development
Topic: A_ variables
Replies: 18
Views: 805

Re: A_ variables

My initial plan was this: - I want to share some AHK v1 code on the forum, but I want that code to be more forwards compatible, and therefore I would like InStr/SubStr/RegExMatch(/RegExReplace) to work like they do in AHK v2. Apply SetAhkV2Mode at the start of the subroutine, turn it off at the end...
by coffee
29 Dec 2017, 00:36
Forum: Ask For Help
Topic: cycle through windows with explanations PLEASE
Replies: 9
Views: 232

Re: cycle through windows with explanations PLEASE

thank you for taking the time to respond. I decided yesterday that I wouldn't sleep it off and come on fresh today but reading your response is putting me back into the same mood. I dont understand why some of your script has a percent sign once instead of on both sides of the variable. I dont know...
by coffee
27 Dec 2017, 19:16
Forum: AutoHotkey v2 Development
Topic: A_ variables
Replies: 18
Views: 805

Re: A_ variables

- A_ScriptPID. Good point about ProcessExist(), although that's not currently in AHK v1. A_ScriptPID looks good, and is consistent with A_ScriptHwnd. How so? process, exist behaves the same way. If you don't specify a process, it sets errorlevel to the script's pid, you can just return errorlevel w...
by coffee
26 Dec 2017, 13:38
Forum: AutoHotkey v2 Development
Topic: why was LoopParse (no space) removed?
Replies: 60
Views: 1809

Re: why was LoopParse (no space) removed?

Comma sucks, in rulz Loop Files in path Loop Files in path, "df" Loop Files in "c:\folder\folder", "dfr" Loop Files in "c:\folder\folder\file.ext" Loop Parse in var, delims Loop Parse in var, "|" Loop Parse in "a,b,c,d,e", "," Loo...
by coffee
20 Dec 2017, 12:56
Forum: AutoHotkey v2 Development
Topic: blanks in ternary operator Topic is solved
Replies: 21
Views: 754

Re: blanks in ternary operator Topic is solved

- This reminded me of 2 things re. functions and blank parameters: - It seems that AHK v2 lets you use blank trailing parameters in custom functions, whereas AHK v1 doesn't. Please point to any documentation on this. ;MyFunc(111,,) ;AHK v1: doesn't work ;Error: Blank parameter ;MyFunc(,222,) ;AHK v...
by coffee
20 Dec 2017, 11:01
Forum: AutoHotkey v2 Development
Topic: blanks in ternary operator Topic is solved
Replies: 21
Views: 754

Re: blanks in ternary operator Topic is solved

Note: depending on the function, and the parameter, AHK does allow blanks in functions. The reason it allows "blanks"/"nothing" in function parameters is because the value has already been preset, in the function definition. function(param1:="bop", param2:="hello&...
by coffee
19 Dec 2017, 14:41
Forum: AutoHotkey v2 Development
Topic: blanks in ternary operator Topic is solved
Replies: 21
Views: 754

Re: blanks in ternary operator Topic is solved

I'm not sure why this would evaluate to anything because it's not a function call? var := (var = 1) ? 2 : (0,) ;doesn't work var := (var = 1) ? 2 : (,0) ;doesn't work It should be var := (var = 1) ? 2 : (0,"") ; for false, in v1 result is 0, in v2 result is "" var := (var = 1) ? ...
by coffee
19 Dec 2017, 11:42
Forum: AutoHotkey v2 Development
Topic: blanks in ternary operator Topic is solved
Replies: 21
Views: 754

Re: blanks in ternary operator Topic is solved

(var = 1) ? (var:=2) : ("") ("") can be used anywhere as the "do nothing" expression, which to me looks better than assigning a 0. That makes it kind of clearer to be honest than having no :. Otherwise I would just rewrite the ternary and simply assign it to itself if ...
by coffee
13 Dec 2017, 20:15
Forum: Tutorials
Topic: Beginners OOP with AHK
Replies: 33
Views: 2686

Re: OOP with AHK

An Object is always the instance of a Class. Does this mean that array objects are considered classes in AHK, even though they are not defined using the "Class" keyword? The "An Object is always the instance of a Class" applies to languages like java and other class-based langua...

Go to advanced search