youtuber Posted August 22, 2017 Share Posted August 22, 2017 What can I do for the error message if the two entries are empty? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 178, 195) $Button1 = GUICtrlCreateButton("Button1", 48, 128, 75, 25) $Input1 = GUICtrlCreateInput("", 32, 16, 121, 21) $Input2 = GUICtrlCreateInput("", 32, 64, 121, 21) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 If (GUICtrlRead($Input1,$Input2) == "") Then MsgBox(48, "Error", "Do not leave it empty!") Else MsgBox(0, "Successful", "Both inputs full") EndIf EndSwitch WEnd Link to comment Share on other sites More sharing options...
iamtheky Posted August 22, 2017 Share Posted August 22, 2017 If guictrlread($input1) = "" AND guictrlread($input2) = "" something like that youtuber 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
youtuber Posted August 22, 2017 Author Share Posted August 22, 2017 One does not give an error if one is full If guictrlread($input1) = "" AND guictrlread($input2) = "" Then MsgBox(48, "Error", "Do not leave it empty!") Else MsgBox(0, "Successful", "Both inputs full") EndIf Link to comment Share on other sites More sharing options...
iamtheky Posted August 22, 2017 Share Posted August 22, 2017 True, because they both have to be blank with AND. If you want to error if either is blank the operator should be OR. youtuber 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
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