lists
lists
i am trying to put 200 things in a list but it is giving me a error can you help?
- Attachments
-
- test 3.ahk
- (7.51 KiB) Downloaded 17 times
Re: lists
split the 200 things into several batches and insert those with separate insert statements.
make sure a line doesnt exceed 16k characters or ???(i forget how many) number of items(which would trigger an "Expression too complex." error)
make sure a line doesnt exceed 16k characters or ???(i forget how many) number of items(which would trigger an "Expression too complex." error)
Re: lists
i am trying to make it go up the list a certan amount
Re: lists
ure using some kind of slanted quote marks, use regular quotes "
u could have also just used an array instead of an object list := ["one", "two", "three", ..., "two hundred"]
u could have also just used an array instead of an object list := ["one", "two", "three", ..., "two hundred"]
Re: lists
A bit convoluted but with this you can have up to 999 values:
Code: Select all
strU := "1,one,2,two,3,three,4,four,5,five,6,six,7,seven,8,eight,9,nine"
strU .= ",11,eleven,12,twelve,13,thirteen,14,fourteen,15,fifteen,16,sixteen,17,seventeen,18,eighteen,19,nineteen"
strU .= ",10,ten,20,twenty,30,thirty,40,forty,50,fifty,60,sixty,70,seventy,80,eighty,90,ninety"
u := Object(StrSplit(strU,",")*)
o := Object()
Loop, 999 {
i := a_index
if (i < 21) {
o[i] := u[i]
continue
}
if ( i < 100 ) {
o[i] := u[i//10*10] ( Mod(i,10) ? "-" u[Mod(i,10)] : "")
continue
}
if (i/100=i//100 ) {
o[i] := u[i//100 ] " hundred"
continue
}
if ( u.HasKey(i-100*(i//100)) )
o[i] := u[i//100 ] " hundred and " u[i-(100*(i//100))]
else
o[i] := u[i//100 ] " hundred and " u[(i-100*(i//100))//10*10] "-" u[Mod(i,10)]
}
MsgBox % "942 is`t" o[942]
for k,v in o
str .= k "`t" v "`n"
MsgBox % Clipboard := str
ExitApp
*Esc::
ExitApp
return
____________________________________________________________________________
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