Variables Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Variables

Post by Marcosa1020 » 03 Sep 2017, 21:21

Hello,

Please see the flow B, I want to write

Code: Select all

GuiControl,1:,card2, (%card2% + 1)
but failed, could you tell me how to write GuiControl,1:,card2, (%card2% + 1) ?
Thanks.

Code: Select all

#NoTrayIcon
CoordMode, XD7500 X-ray System, Window
Gui, Color, C000000
Gui +AlwaysOnTop +LastFound +HWNDa_ID
WinSet, Transparent, 250
Gui, Font, S10 C000000 , Tahoma
Gui, Show, x131 y91 h150 w200,Mouse
Gui, Add, Text, x4 y20 c00FFFF, E:
Gui, Add, DropDownList, x27 y20 w30 h200 vD3, 0||1|2|3|4|5|6|7|8
Gui, Add, Text, x65 y20 c00FFFF, S:
Gui, Add, DropDownList, x87 y20 w30 h200 vD4, 0||1|2|3|4|5|6|7|8
Gui, Add, Edit, x27 y80 w30 h24 vcard1,0
Gui, Add, Edit, x87 y80 w30 h24 vcard2,0
Gui, Add, Edit, x147 y80 w30 h24 vcard3,0
Gui, Add, Text, x2 y82 c00FFFF, L1
Gui, Add, Text, x63 y82 c00FFFF, L2
Gui, Add, Text, x124 y82 c00FFFF, L3
SetTimer, aa, 500 
return

aa:
WinGet, a1_ID, ID, A
If ( a_ID != a1_ID )
k_ID = %a1_ID%
return

A:
{
Send {Click, 15, 516, 2}
Sleep 600
GuiControl,1:,card1,1
GuiControl,1:,card2,1  ;<---- card2 = 1
GuiControl,1:,card3,1
Send {Click, 15, 506, 2}
Sleep 700
GuiControl,1:,card1,1
GuiControl,1:,card2,1
GuiControl,1:,card3,2
Send {Click, 15, 496, 2}
GuiControl,1:,card1,1
GuiControl,1:,card2,1
GuiControl,1:,card3,3
}
return

B:
{
Send {Click, 80, 516, 2}
GuiControl,1:,card1,1
GuiControl,1:,card2,2  ;<---- How to write (%card2% + 1) = 2 ?
GuiControl,1:,card3,1
Send {Click, 80, 506, 2}
GuiControl,1:,card1,1
GuiControl,1:,card2,2   
GuiControl,1:,card3,2
Send {Click, 80, 496, 2}
GuiControl,1:,card1,1
GuiControl,1:,card2,2   
GuiControl,1:,card3,3
}
return

F4::
If (D4 = 1)
    Gosub, A
If (D4 = 2)
   {
	Gosub,A
	Gosub,B
   }
return

GuiClose:
ExitApp


User avatar
Exaskryz
Posts: 2876
Joined: 17 Oct 2015, 20:28

Re: Variables  Topic is solved

Post by Exaskryz » 03 Sep 2017, 21:51

Do you mean you want to update the text of the control card2 to be the sum of card2 + 1? Use expression syntax in that parameter. GuiControl,1:,card2, % card2 + 1

Marcosa1020
Posts: 160
Joined: 23 Sep 2015, 19:15

Re: Variables

Post by Marcosa1020 » 03 Sep 2017, 22:14

Hi Exaskryz,

Yes, Thank you.

Post Reply

Return to “Ask For Help”