我創建了一個複選框,然後創建了一個GUI。但是,我想在同一個GUI中創建另一個複選框,但它告訴我需要在下面的BOLD部分輸入「return」。在GUI中創建複選框
如果我這樣做,我的腳本的其餘部分將停止。基本上,如果用戶選中「是」,那麼我需要該GUI中的第二個GUI。但是如果用戶檢查NO,那麼我想讓熱鍵跳到腳本的其餘部分(這不包括在下面)。
我該怎麼做?
Send, {ENTER}
gui, font, s14
gui, add, checkbox, w200 y15 vyesy, YES
gui, add, checkbox, w200 vnon, NO
gui, add, button, gfem, continue
gui, show, w200 h175, GYN EXAM?
Return
fem:
Gui, submit
Send, {space}
Sleep, 500
if non = 1
{
send, {space}
}
gui, destroy
If yesy = 1
{
Send,GYN:{SPACE}
Progress, m2 b fs14 zh0, Date of LMP, , , Arial
Inputbox, LMP, LMP
Progress, Off
Sleep, 500
Send,LMP{SPACE}%LMP%,{SPACE}
Progress, m2 b fs14 zh0, Duration`ndays wks mo , , , Arial
Inputbox, duration, Duration
Progress, Off
Sleep, 500
Send, Duration{SPACE}%duration%,{SPACE}
Progress, m2 b fs14 zh0, G_/P_ `nPlease include letters G&P, , , Arial
Inputbox, gp, G_/P_
Progress, Off
Sleep, 500
Send,%gp%{SPACE}
gui, font, s14
gui, add, checkbox, w115 y15 virreg, Irregular
gui, add, checkbox, w115 vhflow, Heavy flow
gui, add, checkbox, w115 vndys, Dysmenorrhia
gui, add, checkbox, w115 y15 x+8 vreg, Regular
gui, add, checkbox, w150 y+9 vflow, Normal flow
gui, add, checkbox, w200 y+9 vdysmenorrhia, No Dysmenorrhia
gui, Add, button, x120 y130 gGyYN, continue
gui, Show, w400 h200, GYN
return
GYyN:
gui, Submit
SEND,{space}
Sleep, 500
if irreg = 1
{
send, -{space}Irregular{space}
Progress, m2 b fs14 zh0, Further details of `nirregular flow, , , Arial
Inputbox, irf, Irregular flow details
Progress, Off
Sleep, 500
Send,%irf%
}
if hflow = 1
{
send, -{SPACE}Heavy flow{space}
Progress, m2 b fs14 zh0, Further details of `nheavy flow, , , Arial
Inputbox, hfl, Heavy flow details
Progress, Off
Sleep, 500
Send,%hfl%
}
if ndys = 1
{
send, -{space}Dysmenorrhia{space}
Progress, m2 b fs14 zh0, Further details of `ndysmenorrhia, , , Arial
Inputbox, dysmni, Dysmenorrhia details
Progress, Off
Sleep, 500
Send,%dysmni%
- Normal flow- No Dysmenorrhia
}
if reg = 1
{
send, -{space}Regular
}
if flow = 1
{
send, -{space}Normal flow
}
if dysmenorrhia = 1
{
send, -{SPACE}No Dysmenorrhia
**return**
}}
gui, destroy
(如果我的語言標記出錯,請編輯您的問題) – Mat
誰告訴你在哪裏插入回報?如果是AHK解釋器,那麼如果您提供錯誤消息將會很有幫助。不管怎樣,你通常應該用'return'來完成子例程,也就是說,最後一個命令應該是一個**無條件的**'return'。將'return'放在當前位置下兩行,就在'gui,destroy'的正上方。目前,只有'痛經'(我認爲你有拼寫錯誤)等於* 1 *才能達到'返回'。而且,在相同的條件之後,還有一個'}'太多了。 – MCL
也許你應該給你的腳本一些簡短的描述,第一印象可能會相當令人不安,特別是如果你不準備... – MCL