Guest rathore Posted April 5, 2004 Share Posted April 5, 2004 i'd used this in last version that i used (3.0.100)If $TOREAD = "" AND If FileExists(@TempDir&"\readme.txt") Then $TOREAD = @TempDir&"\readme.txt"now with the Au3withGUI version this has changed to:If $TOREAD = "" AND FileExists(@TempDir&"\readme.txt") Then $TOREAD = @TempDir&"\readme.txt"Which is the one I should stick to for future compatability?(and i'm damn sure there was one more changed that i'd to do, which skips me right now) Link to comment Share on other sites More sharing options...
CyberSlug Posted April 5, 2004 Share Posted April 5, 2004 The first way is not suppposed to work, so use the second way. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Valik Posted April 5, 2004 Share Posted April 5, 2004 If the first way worked at all and didn't cause a crash or error, then it may of been part of the bug Jon fixed in the latest unstable (If it was part of that bug, it should of crashed AutoIt, though, unless that was never executed...), which is what the latest AutoIt-GUI version is based on. Link to comment Share on other sites More sharing options...
ezzetabi Posted April 5, 2004 Share Posted April 5, 2004 AFIAK the second way is the "official" one... Link to comment Share on other sites More sharing options...
scriptkitty Posted April 5, 2004 Share Posted April 5, 2004 If $TOREAD = "" THEN If FileExists(@TempDir&"\readme.txt") Then $TOREAD = @TempDir&"\readme.txt" or If $TOREAD = "" AND FileExists(@TempDir&"\readme.txt") Then $TOREAD = @TempDir&"\readme.txt" I like second version, but revised first version should work as well. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Guest rathore Posted April 5, 2004 Share Posted April 5, 2004 thanx all for clarifying.... scriptkitty: i've just a hunch that the usage that skipped my mind at the time of posting the message (read main thread) is somehow related to "If $TOREAD = "" THEN If" but its okay now... i'll use the 2nd format for future!! Link to comment Share on other sites More sharing options...
scriptkitty Posted April 5, 2004 Share Posted April 5, 2004 aye, an AND statement can be done with if, an OR can be done with else, but it is a lot cleaner to use AND and OR. It is good to know diferent approaches though, like more tools on the job. ; consider $x is an integer if $x>1 then if $x<3 then msgbox(1,"$x is","2"); AND statement if $x>2 then msgbox(1,"$x is not","2"); OR statement else if $x<2 then msgbox(1,"$x is not","2") endif Select Case $x>2 msgbox(1,"$x is not","2") Case $x<2 msgbox(1,"$x is not","2") Case Else msgbox(1,"$x is","2") endselect sleep(2000) ;Better way to express the same thing if $x>1 AND $x<3 then msgbox(1,"$x is","2") if $x>2 OR $x<2 then msgbox(1,"$x is not","2") AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
Guest rathore Posted April 5, 2004 Share Posted April 5, 2004 thanx for the choices...but as u said;Better way to express the same thingif $x>1 AND $x<3 then msgbox(1,"$x is","2") if $x>2 ORĀ $x<2 then msgbox(1,"$x is not","2")i'm going to stick with these, unless something requires spl handling. 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