how to make the combobox limitless

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
smorgasbord
Posts: 493
Joined: 30 Sep 2013, 09:34

how to make the combobox limitless

08 Nov 2014, 03:46

i hv this 1000+ list
possible?
thanks
John ... you working ?
Coco-guest

Re: how to make the combobox limitless

08 Nov 2014, 03:50

You can use the r(row option), e.g.: Gui Add, ComboBox, r%SomeHighValue%
User avatar
smorgasbord
Posts: 493
Joined: 30 Sep 2013, 09:34

Re: how to make the combobox limitless

08 Nov 2014, 03:55

please elaborate
PS:
Gui, Add, ComboBox, r101010 vTo, A|B|C|D..............................
did not work
John ... you working ?
garry
Posts: 3763
Joined: 22 Dec 2013, 12:50

Re: how to make the combobox limitless

08 Nov 2014, 06:18

not sure what you want
an example combobox with 2100 lines to select

Code: Select all

/*
e4x =
(LTrim Join|
         Janvier
         Fevrier
         Mars
         Avril
         Mai
         June
         Juli
         August
         September
         October
         Novembre
         Decembre
         )
*/

loop,2100
{
i++
e4x .= i "|"
}
Gui, Add, ComboBox, x10 y10 w150 h20 r12 vCCx, %e4x%
Gui,add,button, gGO,GO
Gui,show
GuiControl, Choose,ccx,2098
return

GO:
GuiControlGet,ccx
msgbox, 262144, Test,You selected=`n%ccx%
return

guiclose:
exitapp
User avatar
smorgasbord
Posts: 493
Joined: 30 Sep 2013, 09:34

Re: how to make the combobox limitless

08 Nov 2014, 06:59

Still says continuation section too long.
:(
John ... you working ?
Leefme
Posts: 90
Joined: 30 Sep 2013, 22:13

Re: how to make the combobox limitless

08 Nov 2014, 07:21

e4x =
(LTrim Join|
Janvier
Fevrier
Mars
)

the above is called a continuation section

Within this section
http://ahkscript.org/docs/Scripts.htm#continuation

And specfically read the example after this line of text

--> A continuation section cannot produce a line whose total length is greater than 16,383 characters
User avatar
smorgasbord
Posts: 493
Joined: 30 Sep 2013, 09:34

Re: how to make the combobox limitless

08 Nov 2014, 07:24

@leefme
it seems that is what is intended, to break the limit 16,383.
possible?
thanks
John ... you working ?
Bkid
Posts: 31
Joined: 13 Jun 2014, 12:19

Re: how to make the combobox limitless

08 Nov 2014, 09:29

Leefme I posted a fix for him in IRC which I think will work. He had a huge list, so I broke it up into 3 variables, and GuiControl appended the 2nd and 3rd vars to the list after its initial creation.
User avatar
smorgasbord
Posts: 493
Joined: 30 Sep 2013, 09:34

Re: how to make the combobox limitless

08 Nov 2014, 09:31

@Bkid
Yep it works like a Charm.
million Thanks. :)
All hail ahkscript
John ... you working ?
garry
Posts: 3763
Joined: 22 Dec 2013, 12:50

Re: how to make the combobox limitless

08 Nov 2014, 09:35

( can you show the script ? )
EDIT ; I think I'll understand
@Leefme :
A continuation section cannot produce a line whose total length is greater than 16,383 characters
@Bkid :
Leefme, I posted a fix for him in IRC which I think will work.
He had a huge list, so I broke it up into 3 variables, and GuiControl appended the 2nd and 3rd vars to the list after its initial creation.
Last edited by garry on 08 Nov 2014, 09:40, edited 1 time in total.
User avatar
smorgasbord
Posts: 493
Joined: 30 Sep 2013, 09:34

Re: how to make the combobox limitless

08 Nov 2014, 09:40

@garry

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

e4x =
(LTrim Join|
bla bla bla bla more bla bla bla
bla bla bla bla more bla bla bla
)

e4xtemp =
(LTrim Join|
bla bla bla bla more bla bla bla
bla bla bla bla more bla bla bla
)

e4xtemp2 =
(LTrim Join|
bla bla bla bla more bla bla bla
bla bla bla bla more bla bla bla
)
		
;~ loop,2100
;~ {
;~ i++
;~ e4x .= i "|"
;~ }
Gui, Add, ComboBox, x10 y10 w1050 h20 r12 vCCx, %e4x%
Gui,add,button, gGO,GO
Gui,show
GuiControl,, CCx, %e4xtemp%
GuiControl,, CCx, %e4xtemp2%
GuiControl, Choose,ccx,2098
return

GO:
GuiControlGet,ccx
msgbox, 262144, Test,You selected=`n%ccx%
return

guiclose:
exitapp
John ... you working ?
garry
Posts: 3763
Joined: 22 Dec 2013, 12:50

Re: how to make the combobox limitless

08 Nov 2014, 09:42

thank you users
smorgasbord , Bkid , Leefme
Last edited by garry on 08 Nov 2014, 09:45, edited 1 time in total.
Bkid
Posts: 31
Joined: 13 Jun 2014, 12:19

Re: how to make the combobox limitless

08 Nov 2014, 09:43

A more basic example, if needed:

Code: Select all

hugelist =
(LTrim Join|
item1
item2
item3
)

hugelist2 =
(LTrim Join|
item4
item5
item6
)

hugelist3 =
(LTrim Join|
item7
item8
item9
)

Gui, Add, ComboBox, x10 y10 w100 h20 r12 vComboBox, %hugelist%
Gui,show
GuiControl,, ComboBox, %hugelist2%
GuiControl,, ComboBox, %hugelist3%
Return

GuiClose:
ExitApp
Leefme
Posts: 90
Joined: 30 Sep 2013, 22:13

Re: how to make the combobox limitless

10 Nov 2014, 00:30

@Bkid

I have one nit to pick.

>>Gui, Add, ComboBox, x10 y10 w100 h20 r12 vComboBox, %hugelist%

Don't use a keyword >by itself< as the name of an associated variable
While it is "legal" to do, imo this does not clarify the distinction between keywords and variables.
User avatar
smorgasbord
Posts: 493
Joined: 30 Sep 2013, 09:34

Re: how to make the combobox limitless

12 Nov 2014, 13:11

hmm..
what to do if the whole list is to be assigned to a particular array field, let say file_lines[10]
possible still?
thanks
John ... you working ?
Leefme
Posts: 90
Joined: 30 Sep 2013, 22:13

Re: how to make the combobox limitless

18 Nov 2014, 03:03

The problem with "continuation section" only applies to the limits on its length.

You should be able to assign a value (or in this case string of characters) to a variable by whatever mean needed.
ex: store the string in a file and use Fileread,
or use multiple continuation sections to >append data<
User avatar
smorgasbord
Posts: 493
Joined: 30 Sep 2013, 09:34

Re: how to make the combobox limitless

18 Nov 2014, 03:07

@leefme
Thanks.
:)
John ... you working ?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750, songdg and 261 guests