forever0donotknowme Posted February 9, 2013 Posted February 9, 2013 hi my friends, I do script but I can not get code that return me to main form #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("main form", 442, 169, 192, 124) $Input1 = GUICtrlCreateInput("", 112, 56, 201, 21) $Label1 = GUICtrlCreateLabel("type any thing in following box for display in message", 24, 24, 387, 28) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Button1 = GUICtrlCreateButton("display", 272, 96, 131, 33) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("Exit", 80, 96, 107, 33) GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit case $Button1 if $Input1 <>"" Then MsgBox(0,"", GUICtrlRead($input1)) Else MsgBox(0,""," you do not enter any thing in box therefor you will return to main form") ;what is script that return to main form EndIf case $Button2 Exit EndSwitch WEnd What is script that return to main form if $input =0
Kyan Posted February 9, 2013 Posted February 9, 2013 first you read the input, then you can check if is something in it case $Button1 $readInput = GUICtrlRead($input1) if $readInput <> "" Then MsgBox(0,"", $readInput) Else MsgBox(0,"","you do not enter any thing in box therefor you will return to main form") ;what is script that return to main form EndIf .... Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better
forever0donotknowme Posted February 9, 2013 Author Posted February 9, 2013 case $Button1 $readInput = GUICtrlRead($input1) if $readInput ="" Then Exit ; do not work any thing ;what is script that return to main form Else MsgBox(0,""," you do not enter any thing in box therefor you will return to main form") MsgBox(0,"", $readInput) EndIf i want to return to main form if input =" "
Kyan Posted February 9, 2013 Posted February 9, 2013 (edited) return? like without showing up a msgbox? if so just remove this part Else MsgBox(0,""," you do not enter any thing in box therefor you will return to main form") ;what is script that return to main form btw, you can check help file for any command/function by pressing F1 (the command/func. needs to be clicked before hit F1) Edited February 9, 2013 by DiOgO Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better
EndFunc Posted February 9, 2013 Posted February 9, 2013 (edited) case $Button1 $readInput = GUICtrlRead($input1) if $readInput ="" Then Exit ; do not work any thing ;what is script that return to main form Else MsgBox(0,""," you do not enter any thing in box therefor you will return to main form") MsgBox(0,"", $readInput) EndIf i want to return to main form if input =" " Try this instead. Do not use EXIT. that will terminate the script instead of returning you to the form and continuing the loop. case $Button1 $readInput = GUICtrlRead($input1) if $readInput ="" Then MsgBox(0,""," you do not enter any thing in box therefor you will return to main form") ContinueLoop ; return to main form Else MsgBox(0,"", $readInput) EndIf Edited February 9, 2013 by EndFunc EndFuncAutoIt is the shiznit. I love it.
somdcomputerguy Posted February 9, 2013 Posted February 9, 2013 If $readInput is blank (= "") Then just do nothing. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
forever0donotknowme Posted February 10, 2013 Author Posted February 10, 2013 Try this instead. Do not use EXIT. that will terminate the script instead of returning you to the form and continuing the loop. case $Button1 $readInput = GUICtrlRead($input1) if $readInput ="" Then MsgBox(0,""," you do not enter any thing in box therefor you will return to main form") ContinueLoop ; return to main form Else MsgBox(0,"", $readInput) EndIf thanks my sir really you help me.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now