JWoodruff Posted September 5, 2007 Share Posted September 5, 2007 Hello Everyone, What may be a simple If Statement question... Can we use 'and' in an if statement in AutoIt? For example if $A =1 and $B = 1 and $C = 1 then ;do what ya want else ;do something else endif I'd rather not do nested if statements if i can avoid it. Thanks in advance! - Woody Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 5, 2007 Share Posted September 5, 2007 Hello Everyone, What may be a simple If Statement question... Can we use 'and' in an if statement in AutoIt? For example if $A =1 and $B = 1 and $C = 1 then ;do what ya want else ;do something else endif I'd rather not do nested if statements if i can avoid it. Thanks in advance! Are you working in SciTE? That makes it easy to just try something like that to see if it works... but yes, you can use both "AND" and "OR" in your conditional statements. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ssubirias3 Posted September 5, 2007 Share Posted September 5, 2007 (edited) Yes and you can mix it up using AND and OR in your statements. If $a == 1 And $b == 3 Or $a == 2 Or $c == 15 Then ;; do something Else ;; do something else EndIfEdit: Opps, PsaltyDS posted just before I submitted this. And the yeas have it. Edited September 5, 2007 by ssubirias3 Link to comment Share on other sites More sharing options...
JWoodruff Posted September 5, 2007 Author Share Posted September 5, 2007 Yes, I am working in SciTE... Looks to be a syntax issue. I think I have it worked out. In short I am validating the value of an input field. The value is being returned as "4104" verses NULL when a value has not been entered. Any idea why? - Woody Link to comment Share on other sites More sharing options...
martin Posted September 5, 2007 Share Posted September 5, 2007 Yes, I am working in SciTE... Looks to be a syntax issue. I think I have it worked out. In short I am validating the value of an input field. The value is being returned as "4104" verses NULL when a value has not been entered. Any idea why?I think you need to show us some of the code. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
JWoodruff Posted September 5, 2007 Author Share Posted September 5, 2007 (edited) Ok sorry about the confusion. I've got it worked out. I was attempting to validate the value of the input control variable and not the GUICtrlRead(of that input control) if GUICtrlRead($DBInput) <> "" and GUICtrlRead($UserInput) <> "" and GUICtrlRead($PassInput) <> "" Then IniWrite("c:\databases.ini",$c,"database",GUICtrlRead($DBInput)) IniWrite("c:\databases.ini",$c,"User",GUICtrlRead($UserInput)) IniWrite("c:\databases.ini",$c,"Pass",GUICtrlRead($PassInput)) RefreshDB() Else msgbox(48,"Error","You must enter all fields to continue!") EndIf Originally I was attempting to validate the value of $DBInput and not GUICtrlRead($DBInput) Thanks again for your assistance! Edited September 5, 2007 by JWoodruff - Woody 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