input without Submit Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
aliztori
Posts: 119
Joined: 19 Jul 2022, 12:44

input without Submit

Post by aliztori » 16 Aug 2022, 18:12

Hi i want to when i press hotkey a input box or somthing pop up and wait until i enter a Just Number Value and when i press a number without that i press enter or submit or ...
it run my if (statement)
for example

Code: Select all

if (Var = 1)
do somthing
if (var = 5)
... 
 
can somone help me put please ? thanks

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: input without Submit

Post by mikeyww » 16 Aug 2022, 18:30

Code: Select all

Gui, Font, s10
Gui, Add, Edit, w230 vnum Number gGo
Gui, Show,, Number
Return
Go:
Gui, Submit
Switch num {
 Case 0: MsgBox, 0
 Case 1: MsgBox, 1
 Case 2: MsgBox, 2
 Case 3: MsgBox, 3
 Case 4: MsgBox, 4
 Case 5: MsgBox, 5
 Case 6: MsgBox, 6
 Case 7: MsgBox, 7
 Case 8: MsgBox, 8
 Case 9: MsgBox, 9
}
Return

aliztori
Posts: 119
Joined: 19 Jul 2022, 12:44

Re: input without Submit

Post by aliztori » 17 Aug 2022, 07:03

mikeyww wrote:
16 Aug 2022, 18:30

Code: Select all

Gui, Font, s10
Gui, Add, Edit, w230 vnum Number gGo
Gui, Show,, Number
Return
Go:
Gui, Submit
Switch num {
 Case 0: MsgBox, 0
 Case 1: MsgBox, 1
 Case 2: MsgBox, 2
 Case 3: MsgBox, 3
 Case 4: MsgBox, 4
 Case 5: MsgBox, 5
 Case 6: MsgBox, 6
 Case 7: MsgBox, 7
 Case 8: MsgBox, 8
 Case 9: MsgBox, 9
}
Return
oh thanks a lot but when i want to run again that i got this error

Code: Select all

--------------------------
Keyboard Assignments.ahk
---------------------------

The same variable cannot be used for more than one control.

Specifically: vnum Number gGo

	Line#

	364: Gui,Font,s10
--->	365: Gui,Add,Edit,w230 vnum Number gGo
	366: Gui,Show,,Number
	367: Return
	369: Gui,Submit
	370: Switch num
	370: {
	371: Case 0:
	371: MsgBox,0

The current thread will exit.
---------------------------
OK   
---------------------------

User avatar
mikeyww
Posts: 26939
Joined: 09 Sep 2014, 18:38

Re: input without Submit

Post by mikeyww » 17 Aug 2022, 07:17

That is the whole script? What AHK version?

Rohwedder
Posts: 7645
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: input without Submit  Topic is solved

Post by Rohwedder » 17 Aug 2022, 07:25

Hallo,
try:

Code: Select all

Gui, Font, s10
Gui, Add, Edit, w230 vnum Number gGo
Gui, Show,, Number
Return
Go:
Gui, Submit
Gui, Destroy
Switch num {
 Case 0: MsgBox, 0
 Case 1: MsgBox, 1
 Case 2: MsgBox, 2
 Case 3: MsgBox, 3
 Case 4: MsgBox, 4
 Case 5: MsgBox, 5
 Case 6: MsgBox, 6
 Case 7: MsgBox, 7
 Case 8: MsgBox, 8
 Case 9: MsgBox, 9
}
Return

aliztori
Posts: 119
Joined: 19 Jul 2022, 12:44

Re: input without Submit

Post by aliztori » 17 Aug 2022, 07:38

mikeyww wrote:
17 Aug 2022, 07:17
That is the whole script? What AHK version?
NO THATS my function scripts its a lots of line

aliztori
Posts: 119
Joined: 19 Jul 2022, 12:44

Re: input without Submit

Post by aliztori » 17 Aug 2022, 07:40

Rohwedder wrote:
17 Aug 2022, 07:25
Hallo,
try:

Code: Select all

Gui, Font, s10
Gui, Add, Edit, w230 vnum Number gGo
Gui, Show,, Number
Return
Go:
Gui, Submit
Gui, Destroy
Switch num {
 Case 0: MsgBox, 0
 Case 1: MsgBox, 1
 Case 2: MsgBox, 2
 Case 3: MsgBox, 3
 Case 4: MsgBox, 4
 Case 5: MsgBox, 5
 Case 6: MsgBox, 6
 Case 7: MsgBox, 7
 Case 8: MsgBox, 8
 Case 9: MsgBox, 9
}
Return
Thnks a lot bro It worked

aliztori
Posts: 119
Joined: 19 Jul 2022, 12:44

Re: input without Submit

Post by aliztori » 17 Aug 2022, 07:54

Rohwedder wrote:
17 Aug 2022, 07:25
Hallo,
try:

Code: Select all

Gui, Font, s10
Gui, Add, Edit, w230 vnum Number gGo
Gui, Show,, Number
Return
Go:
Gui, Submit
Gui, Destroy
Switch num {
 Case 0: MsgBox, 0
 Case 1: MsgBox, 1
 Case 2: MsgBox, 2
 Case 3: MsgBox, 3
 Case 4: MsgBox, 4
 Case 5: MsgBox, 5
 Case 6: MsgBox, 6
 Case 7: MsgBox, 7
 Case 8: MsgBox, 8
 Case 9: MsgBox, 9
}
Return
but bro when i put in my function code and my scripts i got this error

Code: Select all

---------------------------
Keyboard Assignments.ahk
---------------------------
Error in #include file "T:\AHK\Premier Functions.Ahk":
     A "return" must be encountered prior to this "}".

	Line#
	418: Case 6:
	418: Send,^6
	419: Case 7:
	419: Send,^7
	420: }
	467: Send,{Mbutton}
	468: Send,^/
--->	469: }
	471: if InStr(putType,"insertt")  
	472: {
	473: Send,!{NumpadEnter}
	474: Send,^+/
	475: }
	477: }
	482: MouseMove,xPosCursor,yPosCursor,0

The current thread will exit.
---------------------------
OK   
---------------------------
icant put retrun at there

Rohwedder
Posts: 7645
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: input without Submit

Post by Rohwedder » 17 Aug 2022, 09:53

You inserted the snipped incorrectly!
Autohotkey criticizes in line 469 a supernumerary closing bracket }

Post Reply

Return to “Ask for Help (v1)”