The maximum number of elements the array should be able to contain before it must be automatically expanded. If setting a value less than Length, elements are removed.
Code: Select all
Arr := Array()
Arr.Capacity := 10
MsgBox(Arr.Length . " - " Arr.Capacity, "1")
Arr.Length := 10
MsgBox(Arr.Length . " - " Arr.Capacity, "2")
Arr.Capacity := 0
MsgBox(Arr.Length . " - " Arr.Capacity, "3")
Code: Select all
---------------------------
M37427717.ahk
---------------------------
Error: Out of memory.
Line#
001: Arr := Array()
002: Arr.Capacity := 10
003: MsgBox(Arr.Length . " - " Arr.Capacity, "1")
004: Arr.Length := 10
005: MsgBox(Arr.Length . " - " Arr.Capacity, "2")
---> 006: Arr.Capacity := 0
007: MsgBox(Arr.Length . " - " Arr.Capacity, "3")
008: Exit
Try to continue anyway?
---------------------------
Ja Nein
---------------------------