Jump to content

No input problem


Recommended Posts

The problem I have is that I have a number of fields (say 5) and I want to display an error box when ALL fields are empty, meaning at LEAST 1 field must be filled. The msgbox part I get, but I dont know how to check ALL the fields to see if they are empty or not.

Some of the code so far is:

Func Start()

If $CoordsField[$I] = "" then ; number of fields (5) $I already exists as 0 to 5

MsgBox(16, "Error" , "Please enter Coordinates")

Am I on the right track?

Thanx for any help.

Link to comment
Share on other sites

Func Start()
    Local $AllFieldEmpty = True
    
    For $I = 0 To UBound($CoordsField) - 1
        If GUICtrlRead($CoordsField[$I]) <> "" then $AllFieldEmpty = False ; number of fields (5) $I already exists as 0 to 5
    Next
    If $AllFieldEmpty Then 
        MsgBox(16, "Error" , "Please enter Coordinates")
        Return
    EndIf
    
    ; ....the rest of your code
    
EndFunc

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...