About the usage of DropDownList

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

About the usage of DropDownList

Post by Kevin_yeh2020 » 22 Nov 2021, 09:08

Hello,
When I select 0 ~ 6 in the DropDownList and press the button Output, I can get 0 ~ 6. I would like to modify the OnClick_No0 code.
How can I get 1 ~ 7, when I select 0 ~ 6 then press the button OnClick_No0?

Code: Select all

Gui, Add, DropDownList, cBlack -Theme x60 y167 w50 h200 vT1, R||0|1|2|3|4|5|6

OnClick_No1:
Gui, Submit, NoHide
WinActivate, ahk_id %k_ID%
Clipboard=%f1_row1%%T1%{ENTER}
SendInput %f1_row1%%T1%{ENTER}
return

Code: Select all

I tried to modify the code as below, but this is not working.
if %T1% <> R
{
Clipboard=%T1%+1
SendInput %T1%+1
}

braunbaer
Posts: 478
Joined: 22 Feb 2016, 10:49

Re: About the usage of DropDownList

Post by braunbaer » 22 Nov 2021, 09:47

There may be other problems too, but you can't use legacy syntax if you want to calculate something. And legacy syntax is considered obsolete, so better stick to command syntax generally:

Code: Select all

if (T1 <> R) {
   Clipboard:=T1+1, 
   SendInput % T1+1
   }

Kevin_yeh2020
Posts: 106
Joined: 11 Apr 2020, 00:54

Re: About the usage of DropDownList

Post by Kevin_yeh2020 » 22 Nov 2021, 09:59

braunbaer wrote:
22 Nov 2021, 09:47
There may be other problems too, but you can't use legacy syntax if you want to calculate something. And legacy syntax is considered obsolete, so better stick to command syntax generally:

Code: Select all

if (T1 <> R) {
   Clipboard:=T1+1, 
   SendInput % T1+1
   }
Hi braunbaer,

Thanks for your reply. Can I add the {ENTER} ?

Code: Select all

if (T1 <> R) {
   Clipboard:=T1+1{ENTER}
   SendInput % T1+1{ENTER}
   }

braunbaer
Posts: 478
Joined: 22 Feb 2016, 10:49

Re: About the usage of DropDownList

Post by braunbaer » 29 Nov 2021, 17:19

Sorry, I was away and very busy for a while.
You can add the enter key, but not this way

Code: Select all

if (T1 <> R) {
   Clipboard:=(T1+1) . "{ENTER}"
   SendInput % (T1+1) . "{ENTER}"
   }
You can omit the concatenation operator ".", but in that case there must be at least one space between ) and "

Post Reply

Return to “Ask for Help (v1)”