I have made and used some random output to text arrays with help from the forum. What I have found is that sometimes the array out puts nothing randomly the carries on and outputs the next array value fine.
I'm using this :
AtArray4 := ["1 ","2 ","3 ","4 "]
Random, Rand, % AtArray4.MiniIndex(), % AtArray4.MaxIndex()
It work fine but like I said it sometimes does not output anything.
So I have 5 arrays randomly outputting 1 - 5 on a loop 6 times.
this will happen
13435
114
2345
2112
34
12452
etc
I think the random output must be 0-5 thus having 6 possibility's for the output ? How do I set it to 1-5 please ?
Random array sometimes parses nothing ? Topic is solved
Re: Random array sometimes parses nothing ? Topic is solved
You have a typo in your code, should be:
Code: Select all
AtArray4.MinIndex()
____________________________________________________________________________
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Windows 10 Pro 64 bit - Autohotkey v1.1.30.01 64-bit Unicode
Re: Random array sometimes parses nothing ?
That did it .. so many thanks OdlanirOdlanir wrote:You have a typo in your code, should be:Code: Select all
AtArray4.MinIndex()
Re: Random array sometimes parses nothing ?
That's crazy I just copied your code to test it and it works with the typo:
Returns:
54551
53230
33423
51554
25302
00115
/edit: Ah I got your question wrong, thought you have too short strings
Code: Select all
AtArray4 := ["1","2","3","4","5"]
Loop, 6 {
Loop, 5 {
Random, v%A_Index%, % AtArray4.MiniIndex(), % AtArray4.MaxIndex()
}
x%A_Index% = %v1%%v2%%v3%%v4%%v5%
}
msgbox %x1%`n%x2%`n%x3%`n%x4%`n%x5%`n%x6%
ExitApp
54551
53230
33423
51554
25302
00115
/edit: Ah I got your question wrong, thought you have too short strings
Re: Random array sometimes parses nothing ?
LOL typo's are the fecking bane of my programming life lol the type correction did the trick thoughMarrow wrote:That's crazy I just copied your code to test it and it works with the typo:Returns:Code: Select all
AtArray4 := ["1","2","3","4","5"] Loop, 6 { Loop, 5 { Random, v%A_Index%, % AtArray4.MiniIndex(), % AtArray4.MaxIndex() } x%A_Index% = %v1%%v2%%v3%%v4%%v5% } msgbox %x1%`n%x2%`n%x3%`n%x4%`n%x5%`n%x6% ExitApp
54551
53230
33423
51554
25302
00115
/edit: Ah I got your question wrong, thought you have too short strings
Who is online
Users browsing this forum: peter_ahk and 332 guests