DropDownList

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: tmplinshi, arcticir

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

DropDownList

26 Apr 2016, 07:34

以下的簡陋的程式碼我已修改,請問L1選A, P1選14CCA, C2選1, 輸出的結果為什麼是54 而不是288 ????
這個問題困擾我許久,我希望能改成288,懇請各位先進不吝賜教,感謝您。

Code: Select all

Gui +AlwaysOnTop
Gui, Color, 2f4f4f
Gui +LastFound
WinSet, Transparent, 250
A1 := "AA1"
A2 := "AA2"
A3 := "AA3"
B1 := "BB1"
B2 := "BB2"
B3 := "BB3"
C1 := "CC1"
C2 := "CC2"
C3 := "CC3"
listA := "14AB|14CCA"
listB := "B1|B2|B3"
listC := "C1|C2|C3"
listA1 := "A1_"
listA2 := "A2_"
listA3 := "A3_"
listB1 := "B1_"
listB2 := "B2_"
listB3 := "B3_"
listC1 := "C1_"
listC2 := "C2_"
listC3 := "C3_"
14AB:= "38"
14CCA:= "84"
1 := "1"
2 := "2"
3 := "3"
4 := "4"
5 := "5"
6 := "6"
7 := "7"
8 := "8"
9 := "9"
10 := "10"
 
Gui, Font, S10 C000000 , Tahoma
Gui, Show, x131 y91 h153 w200,Sample Size
;Gui, Add, Tab, x-2 y0 w375 h153 , Page1
Gui, Add, DropDownList, x4 y25 w120 h200 vcard1 gChoise1, A|B|C
Gui, Add, DropDownList, x4 y75 w80 h200 vcard2, %listA%
Gui, Font, S10 Bold C000000 , Arial
Gui, Add, Text, x4 y4 c00FFFF, L1
Gui, Add, Text, x4 y54 c00FFFF, P1
Gui, Add, DropDownList, x4 y125 w50 h200 vcard3, 0||1|2|3|4|5|6|7|8
Gui, Add, DropDownList, x100 y125 w50 h200 vcard4, 0||1|2|3|4|5|6|7|8
Gui, Add, Button, x130 y25 w55 h24 ,Output
Gui, Add, Text, x4 y104 c00FFFF, C1
Gui, Add, Text, x100 y104 c00FFFF, C2

#Persistent
WinGet, a_ID, ID, A
SetTimer, aa, 500
 
return
 
aa:
WinGet, a1_ID, ID, A
If ( a_ID != a1_ID )
k_ID = %a1_ID%
return
 
ButtonOutput:
WinActivate, ahk_id %k_ID%
Gui, Submit, NoHide
if card4 = 0 and card2 = "14AB"
send % %card2% * %card3% + 38 * %card4%
else send % %card2% * %card3% + 54 * %card4%
GuiControl,1:,card2,|
GuiControl,1:,card2,% list%Choise1%
GuiControl,1:,card3,|0||1|2|3|4|5|6|7|8
GuiControl,1:,card4,|0||1|2|3|4|5|6|7|8
return

if card4 = 0 and card2 = "14CCA"
send % %card2% * %card3% + 84 * %card4%
else send % %card2% * %card3% + %288% * %card4%
GuiControl,1:,card2,|
GuiControl,1:,card2,% list%Choise1%
GuiControl,1:,card3,|0||1|2|3|4|5|6|7|8
GuiControl,1:,card4,|0||1|2|3|4|5|6|7|8
return

Choise1:
GuiControlGet, Choise1 , 1:, card1
GuiControl,1:,card2,|
GuiControl,1:,card2,% list%Choise1%
return

GuiClose:
ExitApp
Last edited by Marcosa1020 on 26 Apr 2016, 17:35, edited 1 time in total.
aamii
Posts: 47
Joined: 23 May 2014, 03:50

Re: DropDownList

28 Apr 2016, 01:19

其他的不说,,,,

Code: Select all

ButtonOutput:
if 
else
return

if 
else
return
代码的结构有问题,
在这个标签下,第一个 if else 结构已经非此即彼,并且return掉了。
第二个if else写等于没写。

这个不属于代码问题,而是一个逻辑顺序的问题了。再琢磨下就ok。
Marcosa1020
Posts: 144
Joined: 23 Sep 2015, 19:15

Re: DropDownList

28 Apr 2016, 10:10

aamii wrote:其他的不说,,,,

Code: Select all

ButtonOutput:
if 
else
return

if 
else
return
代码的结构有问题,
在这个标签下,第一个 if else 结构已经非此即彼,并且return掉了。
第二个if else写等于没写。

这个不属于代码问题,而是一个逻辑顺序的问题了。再琢磨下就ok。
aamii,

感謝你。

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 23 guests