KANlFUSA

please help me exit inputbox only (solved)

4 posts in this topic

#1 ·  Posted (edited)

Hello to all . i am newbie nice to meet you all.

how to write , when click cancel button , will exit inputbox return to gui (form1) and no continue run next inputbox.

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#include <MsgBoxConstants.au3>

#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Form1", 472, 164, 192, 124)
Global $Button1 = GUICtrlCreateButton("Enter Data", 40, 40, 153, 65)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

         Case $Button1
            EnterData()

    EndSwitch
 WEnd

 

Func EnterData()
Data1()
Data2()
EndFunc

 

Func Data1()


$Data1 = InputBox("Enter Data1","Please Enter Data","")
If @Error = 1 then
   Exit
EndIf

MsgBox (0,"Data1","OK")
EndFunc


Func Data2()


$Data2 = InputBox("Enter Data2","Please Enter Data","")
If @Error = 1 then
   Exit
EndIf
MsgBox (0,"Data2","OK")

EndFunc

Edited by KANlFUSA

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

:blink:
Edited by KANIFUSAGM

Share this post


Link to post
Share on other sites

Change exit in your two data routines to "return".

Kylomas

1 person likes this

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

 :D Thank You Very Much  to kylomas  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now