Hi there,
I created an array := [123123@someemail.com , 1231241@someemail.com , ... ] that has about 187 items. I started running into issues. So, I msgboxed the array.length and was not getting any response. I cut the items down to 6, and got array.length is 6 in msgbox. So, I figured there is an array limit. I tried 149 items, and that worked. So, somewhere between 150 and 187 items there is a break down. Is this supposed to be the case? Does the array have a byte size limit? Or is there an item limit? I suppose I can test this out on my own, but also wondering if this is a bug.
Thanks
It seems arrays have a limit Topic is solved
Re: It seems arrays have a limit
Hi, and welcome to Bug Reports.
Did you want the array elements in a string instead?
Else they are properties returning null from a null class, so expect weirdness.
Did you want the array elements in a string instead?
Code: Select all
["123123@someemail.com", "1231241@someemail.com", ... ]
itros "ylbbub eht tuO kaerB" a ni kcuts m'I pleH
Re: It seems arrays have a limit Topic is solved
Afaik, this is not a bug, but AHK v1 has a fixed parser limit of 512 tokens for this kind of hardcoded expressions (AHK v2 now allows a lot more, I think, by allowing dynamic allocations):
Or to insert an array at some position of another array:
Edit: and yes, lmstearn is of course right. Strings like email addresses should be quoted in expressions. Only pure numbers can be unquoted.
I think you can work around this programmatically by doing something like this to concatenate arrays (also with more tokens than here):
Code: Select all
arr1 := [5, 6, 7, 8, 9]
arr2 := [1, 2, 3, 4, arr1*]
for index, value in arr2
msgbox % index " : " value
Code: Select all
x1 := ["1", "4", "5"]
x2 := ["2", "3"]
x1.InsertAt(2, x2*) ; insert at position 2
for index, value in x1
msgbox % index " : " value
Edit: and yes, lmstearn is of course right. Strings like email addresses should be quoted in expressions. Only pure numbers can be unquoted.
- Delta Pythagorean
- Posts: 628
- Joined: 13 Feb 2017, 13:44
- Location: Somewhere in the US
- Contact:
Re: It seems arrays have a limit
Arrays don't have a .Length property but a .Length() method. There's also a .Count() and .MaxIndex().
[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat
Who is online
Users browsing this forum: No registered users and 21 guests