Search found 84 matches

by tester
19 Dec 2022, 00:15
Forum: AutoHotkey Development
Topic: Map shorthand
Replies: 71
Views: 33053

Re: Map shorthand

Just for brainstorming for future considerations, what about <>?

Code: Select all

myMap := <>
myMap := <"foo": "bar">
doSomething( myMap:=<> ) {
   for _k, _v in myMap {
       ; doing something
   }
}
by tester
18 Dec 2022, 02:19
Forum: AutoHotkey Development
Topic: Map shorthand
Replies: 71
Views: 33053

Re: Map shorthand

Sure, they can guess some meaning from : , and they still won't know how to use the Map . Assuming a code copy-paster tries to read code, the person doesn't necessarily have to know how to use the Map, but having a context of what kind of data is handled in advance to reading the documentation make...
by tester
18 Dec 2022, 01:09
Forum: AutoHotkey Development
Topic: Map shorthand
Replies: 71
Views: 33053

Re: Map shorthand

No one should be expected to guess what the code does based on visual patterns without having learned anything about the language or functions. Some light users just want things to get done without completely understanding the details of the language, seen as copy-pasting pieces of code posted on f...
by tester
17 Dec 2022, 01:38
Forum: AutoHotkey Development
Topic: Map shorthand
Replies: 71
Views: 33053

Re: Map shorthand

Do you want x := [] to create an empty Array or an empty Map? It can't do both. I got it now. Thank you for the explanation. That's a problem. There doesn't seem usable symbols left for associative arrays. ... which is crucial to those who's native language isn't English. I don't see the connection...
by tester
16 Dec 2022, 03:05
Forum: AutoHotkey Development
Topic: Map shorthand
Replies: 71
Views: 33053

Re: Map shorthand

[name : "Tedd", age : 37] +1 It is unlikely that any "shorthand" syntax I add for Map will allow quote marks to be omitted. +1 the main advantage of dedicated syntax (comparing the original Object() to {}) is the visual pairing. This is very important for me over shortness. I hadn't been able to co...
by tester
15 Dec 2022, 07:33
Forum: Ask for Help (v2)
Topic: Error: This value of type "VarRef" has no property named "Ptr"
Replies: 11
Views: 2110

Re: Error: This value of type "VarRef" has no property named "Ptr"

All right, so it must be something complicated to implement. I'll just use map objects. Thank you.
by tester
14 Dec 2022, 22:55
Forum: Ask for Help (v2)
Topic: Error: This value of type "VarRef" has no property named "Ptr"
Replies: 11
Views: 2110

Re: Error: This value of type "VarRef" has no property named "Ptr"

ntepa Thanks for the tip. I'd prefer the way to save a line but part of me still thinks it is a bit unintuitive. values := Map( "foo1", "bar1", "foo2", "bar2", "foo3", "bar3", "foo4", "bar4", ) lexikos Thanks for the supplementary advice. Is there a technical reason that { "user-agent": "bar" } isn...
by tester
14 Dec 2022, 08:45
Forum: Ask for Help (v2)
Topic: Error: This value of type "VarRef" has no property named "Ptr"
Replies: 11
Views: 2110

Re: Error: This value of type "VarRef" has no property named "Ptr"

just me That's something I posted initially and swagfag asked why I was doing it. He might be implying there is a better approach. In v1, this is valid { "user-agent": "bar" } but it seems not in v2. I've found { %"user-agent"%: "bar" } is accepted but this looks hacky, and it is probably not a goo...
by tester
14 Dec 2022, 02:16
Forum: Ask for Help (v2)
Topic: Error: This value of type "VarRef" has no property named "Ptr"
Replies: 11
Views: 2110

Re: Error: This value of type "VarRef" has no property named "Ptr"

Properties are enumerated with for name, value in obj.OwnProps() or ObjOwnProps(obj) . Thank you. This is what I've been looking for in addition to the topic question. I tried something like this first and didn't work so I chose Map() msgbox testParamKeyValues( { boo: "bar" } ) testParamKeyValues( ...
by tester
13 Dec 2022, 23:38
Forum: Ask for Help (v2)
Topic: Error: This value of type "VarRef" has no property named "Ptr"
Replies: 11
Views: 2110

Re: Error: This value of type "VarRef" has no property named "Ptr"

swagfag Thank you. One thing. The above code misses CP0 for FileOpen() . Downloaded files will be broken without it for scripts with different FileEncoding . FileEncoding "UTF-8" sURL := "https://upload.wikimedia.org/wikipedia/commons/thumb/7/76/%D7%96%D7%A8%D7%99%D7%97%D7%94_%D7%91%D7%90%D7%92%D7%...
by tester
13 Dec 2022, 13:28
Forum: Ask for Help (v2)
Topic: A wrapper function passing omitted parameters Topic is solved
Replies: 4
Views: 532

Re: A wrapper function passing omitted parameters Topic is solved

@Leafk Thanks but it will move the tooltip with offset of 0 relative to the screen so it cannot be said it's working.
by tester
13 Dec 2022, 13:24
Forum: Ask for Help (v2)
Topic: Error: This value of type "VarRef" has no property named "Ptr"
Replies: 11
Views: 2110

Error: This value of type "VarRef" has no property named "Ptr"

Hello, I'm trying to convert the following v1 function to v2 by supporting request headers so that a user agent can be set. ; https://www.autohotkey.com/board/topic/96316-downloading-and-saving-an-image-using-winhttprequest/ _download_to_file(u,s){ static r:=false,request:=comobjcreate("WinHttp.WinH...
by tester
13 Dec 2022, 06:49
Forum: Ask for Help (v2)
Topic: A wrapper function passing omitted parameters Topic is solved
Replies: 4
Views: 532

A wrapper function passing omitted parameters Topic is solved

Hello, I'm trying to convert the following v1 function to v2. It accepts a timeout for a tooltip. ; from https://www.autohotkey.com/boards/viewtopic.php?p=281346#p281346 ToolTip(Text := "", X := "", Y := "", WhichToolTip := 1, Timeout := "") { ToolTip, % Text, X, Y, WhichToolTip If (Timeout) { Remov...
by tester
13 Dec 2022, 05:52
Forum: Ask for Help (v2)
Topic: Auto-loading library functions Topic is solved
Replies: 2
Views: 582

Re: Auto-loading library functions Topic is solved

I see. Thank you for the detailed explanation while you could just say it was removed! I've overlooked the quoted part in the documentation, Scripts are no longer automatically included from the function library (Lib) folders when a function call is present without a definition And with this sentenc...
by tester
13 Dec 2022, 00:04
Forum: Ask for Help (v2)
Topic: Auto-loading library functions Topic is solved
Replies: 2
Views: 582

Auto-loading library functions Topic is solved

Hello, I've just started trying v2 and I'm wondering whether the feature of auto-loading library functions has been deprecated in v2. In v1, loading a library function in the Lib folders with #include isn't necessary unless it is a class. In v2, did it become required for functions? With the code be...
by tester
17 Nov 2022, 06:48
Forum: Scripts and Functions (v1)
Topic: [Class] SQLiteDB - Update on 2022-10-04
Replies: 303
Views: 226361

Re: [Class] SQLiteDB - Update on 2022-10-04

I'd just do class SQLiteDB2 extends SQLiteDB { __New( sPathSQLite3DLL:="" ) { this.base._SQLiteDLL := sPathSQLite3DLL && FileExist( sPathSQLite3DLL ) ? sPathSQLite3DLL : A_ScriptDir . "\SQLite3.dll" base.__New() } It seems the file name sqlite3.dll must not be renamed. Renaing it to sqlite3.x86.dll ...
by tester
16 Nov 2022, 20:54
Forum: Ask for Help (v1)
Topic: Send variables to another script Topic is solved
Replies: 8
Views: 5292

Re: Send variables to another script Topic is solved

Code: Select all

this._obj := ComObjGet("new:{C08AFD90-F2A1-11D1-8455-00A0C91F3880}")
I found this useful, thanks. It might be worth noting that set property values and callbacks will be lost after Explorer is restarted.
by tester
15 Nov 2022, 22:56
Forum: Scripts and Functions (v1)
Topic: [Class] SQLiteDB - Update on 2022-10-04
Replies: 303
Views: 226361

Re: [Class] SQLiteDB - Update on 2022-10-04

Hello,

What about implementing the ability to set a custom sqlite3.dll path from the constructor? Something like,

Code: Select all

db := new SQLiteDB( A_PtrSize == 4 ? A_ScriptDir "\bin\sqlite3.x86.dll" : A_ScriptDir "\bin\sqlite3.x64.dll" )
would be nice.

Go to advanced search