Search found 277 matches

by _3D_
10 Jan 2020, 01:21
Forum: AutoHotkey Development
Topic: [AHKv2.0-a108] Object members exception
Replies: 7
Views: 3704

Re: [AHKv2.0-a108] Object members exception

nnnik wrote:
09 Jan 2020, 06:14
Please ask questions like these in Ask for Help.
nnnik, I don`t ask for help, I am disagree with object concept. So place of this post must be in "AutoHotkey v2 Development".
by _3D_
08 Jan 2020, 10:26
Forum: AutoHotkey Development
Topic: [AHKv2.0-a108] Object members exception
Replies: 7
Views: 3704

Re: [AHKv2.0-a108] Object members exception

the mechanics have been reversed. previously, returning blank was the default and if u wanted protection against accidental reads of nonexistent properties u would have had to implement something custom in metaget urself. now its the other way around. presumably, noobs will be less likely to become...
by _3D_
08 Jan 2020, 07:34
Forum: AutoHotkey Development
Topic: [AHKv2.0-a108] Object members exception
Replies: 7
Views: 3704

Re: [AHKv2.0-a108] Object members exception

In neither case is the target of the operation an already-initialized variable/field: this.stat:=!this.stat : This is a GET operation on a not-yet-existing field followed by a SET. Since it's reading from a field that doesn't exist it throws an exception. stat:=!stat : This reads an uninitialized g...
by _3D_
08 Jan 2020, 06:54
Forum: AutoHotkey Development
Topic: [AHKv2.0-a108] Object members exception
Replies: 7
Views: 3704

[AHKv2.0-a108] Object members exception

And again about __Get and Has but this time for classes. In AutoHotkey, variables are created simply by using them. ;In AutoHotkey, variables are created simply by using them. class Item { __New() { ;this.stat:= "" ;uncomment to init first this.stat:=!this.stat ;variable (object member) is NOT creat...
by _3D_
31 Dec 2019, 07:29
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 102129

[AHKv2.0-a108] Disable SHIFT+DELETE

There no known method to disable Shift+Delete shortcut in windows file explorer. So my First try: #NoTrayIcon #SingleInstance Force ;Copyright (c) D.Donchev #!Q::ExitApp ;extra exit #IF (hand:= WinActive("ahk_exe explorer.exe")) ~+Del:: ~+LButton:: ;user bring content menu and click at Delete with S...
by _3D_
31 Dec 2019, 04:52
Forum: Bug Reports
Topic: [BUG] AHKv2.0-a108 (Probably an old BUG)
Replies: 2
Views: 2574

[BUG] AHKv2.0-a108 (Probably an old BUG)

AHKv2.0-a108 Probably this is an old BUG. Let see next example: Gui:= GuiCreate() Gui.MenuBar:= MenuBarCreate() Gui.MenuBar.Add("&File", FileMenu:= MenuCreate()) FileMenu.Add("&Open`tCtrl+O", (*) => FileSelect()) FileMenu.Add("E&xit", (*) => ExitApp()) Gui.MenuBar.Add("&Help", HelpMenu:= MenuCreate...
by _3D_
22 Dec 2019, 07:04
Forum: Gaming
Topic: InGame v2.0
Replies: 101
Views: 102129

[AHKv2.0-a108] Object, Array and Map

How I think Object, Array and Map must work in AHKv2.0 (current version a108) Object ;Override Object -------------------------------------------------------------- ;Override Object.__Get -------------------------------------------------------- Object.Prototype.DefineMethod('__Get' , func("Object__G...
by _3D_
20 Dec 2019, 08:44
Forum: AutoHotkey Development
Topic: [disappointed] Global language changes.
Replies: 17
Views: 5192

Re: [disappointed] Global language changes.

Array's prototype already has a __New method defined, it delegates to .Push() . Map does not, so define ur own constructor, either on Map or ur derived type. why this is and whether its subject to change, ask lexikos to find out still dont get this set/add nonsense. sure, an ahkcode if-check would ...
by _3D_
19 Dec 2019, 08:05
Forum: AutoHotkey Development
Topic: [disappointed] Global language changes.
Replies: 17
Views: 5192

Re: [disappointed] Global language changes.

nnnik wrote:
19 Dec 2019, 07:43
Could you show an example where a combined add/set instruction is useful for arrays in a real context?

Code: Select all

1
12
112
1112
13
132
1312
13112
131112
133
...
by _3D_
19 Dec 2019, 07:23
Forum: AutoHotkey Development
Topic: [disappointed] Global language changes.
Replies: 17
Views: 5192

Re: [disappointed] Global language changes.

Map is initted as follows: myMap := Map( 'key1', 'val1', 'key2', 'val2', ) TY for this. i have no clue what u meant to express with "set/add" and this postincrement hodgepodge arr:= [2] loop 2 arr[A_Index]:= A_Index ;Invalid index (2) ;set value at index 1 ;add value at index 2 To work this must be...
by _3D_
18 Dec 2019, 18:43
Forum: AutoHotkey Development
Topic: [disappointed] Global language changes.
Replies: 17
Views: 5192

Re: [disappointed] Global language changes.

I read and next class Array extends Object . arr[i] i can be any positive index, or a zero or negative value to indicate an index relative to Length, with -1 being the last element and 0 being Length+1. It mean: ;if index start from 1 and 0 being length+1 => adding new element arr:= ["A", "B", "C"] ...
by _3D_
18 Dec 2019, 14:58
Forum: AutoHotkey Development
Topic: [disappointed] Global language changes.
Replies: 17
Views: 5192

Re: [disappointed] Global language changes.

@_3D_ you may want to see this thread for discussion: https://www.autohotkey.com/boards/viewtopic.php?f=37&t=67213 TY for this thread. My comment: shorthand init must be myMap:= { expressionForKey1:expressionForVal1 ,expressionForKey2: ,:expressionForVal3 } ;any omitted keys or vals must be replace...
by _3D_
18 Dec 2019, 11:12
Forum: AutoHotkey Development
Topic: [disappointed] Global language changes.
Replies: 17
Views: 5192

Re: [disappointed] Global language changes.

1. If I need performance I will use C++ or C#. 2. (old AHK state) mean like a103 where array == map. 3. I make some tests about Capacity and TRUE Length not equal to Capacity. This is understandable if I need 4 items let start with 4 items and don`t need to reallocate memory. 4. I think HAS must ret...
by _3D_
18 Dec 2019, 09:07
Forum: AutoHotkey Development
Topic: [disappointed] Global language changes.
Replies: 17
Views: 5192

[disappointed] Global language changes.

Complete madness in arrays and maps: array:= [] loop 10 array[A_Index]:= A_Index ;Invalid Index ??? This simple code no more works. It must be something like: array:= [] loop 10 array.Push(A_Index) ;Is that a stack or ??? Question 1 : If we have control by the index what is difference between Array....
by _3D_
16 Dec 2019, 09:35
Forum: AutoHotkey Development
Topic: Objects - preview of upcoming changes
Replies: 35
Views: 22676

Re: Objects - preview of upcoming changes

Is there some ideas Classes to be able to inherit GuiObjects / FileObjects / COMObjects ?

Code: Select all

;Something like:
class Window extends Gui {
}
by _3D_
16 Dec 2019, 08:04
Forum: AutoHotkey Development
Topic: ARRAY[INDEX] throw exception instead to return "" Topic is solved
Replies: 9
Views: 3702

Re: ARRAY[INDEX] throw exception instead to return "" Topic is solved

swagfag wrote:
16 Dec 2019, 07:58
associative array => Map
no, it means no longer conflating data structures with things they are not
TY dear that spend so much time with my fallacy.
by _3D_
16 Dec 2019, 07:52
Forum: AutoHotkey Development
Topic: ARRAY[INDEX] throw exception instead to return "" Topic is solved
Replies: 9
Views: 3702

Re: ARRAY[INDEX] throw exception instead to return "" Topic is solved

Holy Jesus!!! It was too early to be glad. badarray := [] badarray["Key"]:= "Value" ; Invalid Index Is that mean NO MORE associative arrays in AHKv2.0 ? badarray := [] badarray.%"Key"%:= "Value" MsgBox(badarray.%"Key"%) Complete madness! badarray := map() ; SOLUTION !!! badarray["Key"]:= "Value" Msg...
by _3D_
16 Dec 2019, 06:58
Forum: AutoHotkey Development
Topic: ARRAY[INDEX] throw exception instead to return "" Topic is solved
Replies: 9
Views: 3702

Re: ARRAY[INDEX] throw exception instead to return "" Topic is solved

swagfag wrote:
16 Dec 2019, 06:14

Code: Select all

origPropDesc := Array.Prototype.GetOwnPropDesc('__Item')
Array.Prototype.DefineProp('__Item', {
	get: (this, index) => this.Has(index) ? %origPropDesc.Get%(this, index) : 'default', 
	set: origPropDesc.Set
})

badrray := []
MsgBox badrray[1]
:bravo: THE REAL ANSWER :bravo:
by _3D_
16 Dec 2019, 05:32
Forum: AutoHotkey Development
Topic: ARRAY[INDEX] throw exception instead to return "" Topic is solved
Replies: 9
Views: 3702

Re: ARRAY[INDEX] throw exception instead to return "" Topic is solved

TY Helgef again https://www.autohotkey.com/boards/viewtopic.php?p=289400#p289400.

Code: Select all

class myArray extends Array {
	__item[key] => this.has(key) ? base[key]: ""
}

array:= myArray.new()
MsgBox(array[1])
And it back to "bad" code.

Go to advanced search