Queener 1 Posted May 9, 2013 (edited) Elseif GuiCtrlRead($input2) > 4 Then ;Check if Lines are correct; MsgBox(0, "Error", "Line must be 1 to 4 only.") Elseif GuiCtrlRead($input2) = 0 Then ;Check if Lines are correct; MsgBox(0, "Error", "Line must be 1 to 4 only.") How do you shorten these down to one line. I tried Or and And with no luck. I would assuming this would work, but not. Elseif GuiCtrlRead($input2) = 0 or > 4 Then ;Check if Lines are correct; MsgBox(0, "Error", "Line must be 1 to 4 only.") Edited May 10, 2013 by asianqueen Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Share this post Link to post Share on other sites
water 2,387 Posted May 9, 2013 (edited) ElseIf Number(GuiCtrlRead($input2)) = 0 or Number(GuiCtrlRead($input2)) > 4 Then MsgBox(0, "Error", "Line must be 1 to 4 only.")Number is needed because GUICtrlRead returns a string. Edited May 9, 2013 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
Queener 1 Posted May 9, 2013 I see... I'll keep that in mind. Works great; thanks Water!!! Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Share this post Link to post Share on other sites
water 2,387 Posted May 9, 2013 My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites