Lempke Posted May 1, 2006 Posted May 1, 2006 (edited) I have these lines in my script, but I wonder if there is an other way that I can put it. :"> If GuiCtrlRead($CheckXls) <> 1 and GuiCtrlRead($CheckSAP) <> 1 and GuiCtrlRead($CheckSurf) <> 1 and GuiCtrlRead($CheckMcAfee) <> 1 and GuiCtrlRead($CheckExch) <> 1 then MsgBox(16, "Vroege Dienst", "None of the options are selected. Klik OK to stop the program.") Exit Endif Edited May 1, 2006 by Lempke
MHz Posted May 1, 2006 Posted May 1, 2006 Using continuation characters would make it easier to read. Your code with "_" used If GUICtrlRead($CheckXls) <> 1 And _ GUICtrlRead($CheckSAP) <> 1 And _ GUICtrlRead($CheckSurf) <> 1 And _ GUICtrlRead($CheckMcAfee) <> 1 And _ GUICtrlRead($CheckExch) <> 1 Then MsgBox(16, "Vroege Dienst", "None of the options are selected. Klik OK to stop the program.") Exit EndIf or a small function to help out If _NotChecked($CheckXls) And _ _NotChecked($CheckSAP) And _ _NotChecked($CheckSurf) And _ _NotChecked($CheckMcAfee) And _ _NotChecked($CheckExch) Then MsgBox(16, "Vroege Dienst", "None of the options are selected. Klik OK to stop the program.") Exit EndIf Func _NotChecked($handle) Return GUICtrlRead($handle) <> 1 EndFunc Either way, the continuation characters transform the code into a clearer structure of code. Using arrays instead would help to loop through each to determine it's state. If you have alot of checkboxes the arrays are the best choice.
Lempke Posted May 1, 2006 Author Posted May 1, 2006 Using continuation characters would make it easier to read.Your code with "_" usedThat's exactly what I was looking for. I am still a newby when using AutoIt, but lovin' the program. THX MHz
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