Search found 6367 matches

by jeeswg
Yesterday, 22:23
Forum: Ask For Help
Topic: Help with random function Topic is solved
Replies: 6
Views: 118

Re: Help with random function Topic is solved

- I tend to mention only the differences that can't easily be resolved by automated conversion.
- Plus, it's uncommon in programming languages to allow variable names that start with digits.
by jeeswg
Yesterday, 18:17
Forum: Ask For Help
Topic: Help with random function Topic is solved
Replies: 6
Views: 118

Re: Help with random function Topic is solved

I would avoid variable names that start with numbers (e.g. 16min, 16max) as these are not forwards compatible with AHK v2.
by jeeswg
Yesterday, 01:23
Forum: Ask For Help
Topic: #IfWinActive does not support variables? Topic is solved
Replies: 6
Views: 134

Re: #IfWinActive does not support variables? Topic is solved

An alternative solution is to use GroupAdd, and #IfWinActive with ahk_group,
by jeeswg
14 Jun 2019, 15:10
Forum: Ask For Help
Topic: Convert Timestamp to Local Time Topic is solved
Replies: 3
Views: 107

Re: Convert Timestamp to Local Time Topic is solved

Here are various bits of code to do the conversion. Two examples: Unix date to AHK (local date based on current time zone). One example: Unix date to AHK (local date based on time zone at the time). And a FormatTime example. Cheers. q:: ;convert Unix date to local AHK date (based on current time zon...
by jeeswg
14 Jun 2019, 13:46
Forum: Ask For Help
Topic: Problem with Dynamic Script Function
Replies: 7
Views: 162

Re: Problem with Dynamic Script Function

@1100++: Re. multi-statements, just FYI re. forwards compatibility:

Code: Select all

var1 := (1, 2)
var2 := MyFunc()
;MsgBox, % var1 " " var2 ;1 1 ;AHK v1
MsgBox(var1 " " var2) ;2 2 ;AHK v2

MyFunc()
{
	return (1, 2)
}
by jeeswg
14 Jun 2019, 01:32
Forum: Ask For Help
Topic: ErrorLevel overwritten? Topic is solved
Replies: 9
Views: 307

Re: ErrorLevel overwritten? Topic is solved

- I'd use a hypothetical 'A_InputBoxResult' more than many other thread settings. - Wasn't ErrorLevel being phased out (replaced with function return values/try-catch handling), in which case new function parameters or A_ variables would be needed anyway. ErrorLevel - Definition & Usage | AutoHotkey...
by jeeswg
13 Jun 2019, 14:02
Forum: Wish List
Topic: classic simple functions: Swap / Assign / Sign
Replies: 6
Views: 484

Re: classic simple functions: Swap / Assign / Sign

ASSIGN: CYCLE VALUES Here are some nice examples for Assign and ObjAssign: q:: ;cycle values via Assign/ObjAssign v1 := "a", v2 := "b", v3 := "c", v4 := "d", v5 := "e" Loop, 11 { MsgBox, % Format("{} {} {} {} {}", v1, v2, v3, v4, v5) Assign(v5, Assign(v4, Assign(v3, Assign(v2, Assign(v1, v5))))) } M...
by jeeswg
13 Jun 2019, 04:24
Forum: Forum Issues
Topic: v2 help subforum
Replies: 6
Views: 160

Re: v2 help subforum

Seems like a good idea.
by jeeswg
12 Jun 2019, 23:24
Forum: Ask For Help
Topic: pass object key ByRef?
Replies: 6
Views: 191

Re: pass object key ByRef?

- @YoucefHam: Your RegEx and ObjRawGet/ObjRawSet code looks good. - For 'abc.def' I would probably do the following: ;AHK v1 (notice 'O)'): RegExMatch("abc.def", "O)^([^.]+)\.([^.]+)$", oMatch) MsgBox, % oMatch.1 " " oMatch.2 ;AHK v2: RegExMatch("abc.def", "^([^.]+)\.([^.]+)$", oMatch) MsgBox(oMatch...
by jeeswg
12 Jun 2019, 12:34
Forum: Ask For Help
Topic: ErrorLevel overwritten? Topic is solved
Replies: 9
Views: 307

Re: ErrorLevel overwritten? Topic is solved

I checked my main scripts/libraries and forum posts for references to CallbackCreate/RegisterCallback: comdlg32\GetOpenFileName [OPENFILENAME] gdi32\EnumFontFamiliesEx user32\CallWindowProc user32\DialogBoxIndirectParam user32\EnumChildWindows user32\EnumWindows user32\RegisterClass [WNDCLASS] user3...
by jeeswg
12 Jun 2019, 11:43
Forum: Ask For Help
Topic: ErrorLevel overwritten? Topic is solved
Replies: 9
Views: 307

Re: ErrorLevel overwritten? Topic is solved

- Do you understand why it's a bad idea to write things like this: if you don't know what it does ... That tells me you still do not understand what it does - Posts that are 100% reply-proof are as long as the dictionary. A bit of good-faith responding someone? - If you 'have control' (cf. an event ...
by jeeswg
12 Jun 2019, 11:14
Forum: Ask For Help
Topic: pass object key ByRef?
Replies: 6
Views: 191

Re: pass object key ByRef?

One potential solution, would be functions that accept a string like "obj.key" and could dereference it. This could be useful for a small number of built-in/custom functions, but some Deref functionality would be needed. Another solution, would be an object type that stores "obj.key" in one of its k...
by jeeswg
12 Jun 2019, 01:55
Forum: Ask For Help
Topic: pass object key ByRef?
Replies: 6
Views: 191

pass object key ByRef?

- It's not the most-needed feature, but it would be potentially useful if you could pass an object key ByRef. - E.g. for the example below, you can't use object keys in the Swap function, and so a separate ObjSwap function is needed. obj := {} obj.key1 := "1" obj.key2 := "2" MsgBox, % obj.key1 " " o...
by jeeswg
11 Jun 2019, 21:37
Forum: Scripts and Functions
Topic: Acc library (MSAA) and AccViewer download links
Replies: 22
Views: 13115

Re: Acc library (MSAA) and AccViewer download links

- 3 possible solutions: - (1) Create a folder called 'Lib' (in the same folder as the AutoHotkey exe), and copy Acc.ahk and Anchor.ahk into that folder. - (2) Edit 'iWB2 Learner UPDATED.ahk', add these 2 lines at the top (or bottom): #Include %A_ScriptDir%\Acc.ahk #Include %A_ScriptDir%\Anchor.ahk -...
by jeeswg
11 Jun 2019, 19:20
Forum: Ask For Help
Topic: array descriptions - what's differ
Replies: 26
Views: 500

Re: array descriptions - what's differ

- As ever, if the requirements change, so must the code: aCol := RegExReplace(aCol, "\x22\K[ `t]*\|[ `t]*(?=\x22)", ":") - By replacing + with *, that changes '1 or more' to '0 or more'. - I also added ...\K and (?=...) to check for double quotes. - To keep things simple I might do: key1|value1 , an...
by jeeswg
11 Jun 2019, 13:19
Forum: Ask For Help
Topic: array descriptions - what's differ
Replies: 26
Views: 500

Re: array descriptions - what's differ

This works, the complicating factors would be: what if there are spaces or tabs within the key names, and other considerations like that, whenever you parse strings. vText = ;continuation section ( LTrim Comments "NameA" | "Value1" ; Key and value1 "NameC" | "Value2" ; Key and value2 "NameB" | "Valu...
by jeeswg
11 Jun 2019, 12:59
Forum: Ask For Help
Topic: array descriptions - what's differ
Replies: 26
Views: 500

Re: array descriptions - what's differ

I commonly use StrSplit to do string to linear array: aTest := StrSplit("A,B,C", ",") bTest := ["A", "B", "C"] MsgBox % "aTest.count() .: " aTest.count() "`naTest.1 .: " aTest.1 "`n`nbTest.count() .: " bTest.count() "`nbTest.1 .: " bTest.1 And there's this trick for associative arrays: ;from: ;jeesw...
by jeeswg
11 Jun 2019, 12:01
Forum: Ask For Help
Topic: ErrorLevel overwritten? Topic is solved
Replies: 9
Views: 307

Re: ErrorLevel overwritten? Topic is solved

- Thanks Helgef, great info. - (Btw the example you gave in that other thread was so complicated, it made it seem that 'F' was unlikely ever to be a problem, but this is not the case, 'F' is very likely to be a problem.) - The problem is ... it's not clear when you *can* safely use RegisterCallback ...
by jeeswg
10 Jun 2019, 23:29
Forum: Wish List
Topic: VarIsInit/VarExist or static for global variables
Replies: 5
Views: 451

Re: VarExist or static for global variables

I wrote some C++ code for a potential VarIsInit function, here:
C++: AHK source code: VarIsInit - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=75&t=65308
by jeeswg
10 Jun 2019, 23:25
Forum: C/C++
Topic: C++: AHK source code: Base64Get/Base64Put and HexGet/HexPut
Replies: 1
Views: 109

Re: C++: AHK source code: Base64Get/Base64Put and HexGet/HexPut

I wrote some code to replace spaces/CRs/LFs. Out of interest, are there any existing macros to facilitate this?

Go to advanced search