latoonne Posted July 16, 2007 Share Posted July 16, 2007 Hello everybody,Why this expression does not workIf @UserName <> "RCITERNE" or @UserName <> "SDEROSA" Then MsgBox(64,"Attention", "Installation impossible vous ne disposez pas de la license Crystal Reports."& @CRLF & "Vous devez être loggué avec le profil RCITERNE ou SDEROSA," & @CRLF& " Ils sont les seuls à être en possession d'une license Crystal Reports Developper.") Exit(1)EndifI have always the message box even if i use the good account.Kind Regards Link to comment Share on other sites More sharing options...
Developers Jos Posted July 16, 2007 Developers Share Posted July 16, 2007 change the OR to AND to make the If correct SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
latoonne Posted July 17, 2007 Author Share Posted July 17, 2007 change the OR to AND to make the If correctHi, I cannot change or by and because it's a condition, the syntax is correct, this morning i tried this see below, but same issue. #include <Array.au3> Dim $avArray $avArray = _ArrayCreate("RCITERNE", "SDEROSA") If @UserName <> $avArray[0] or @UserName <> $avArray[1] Then MsgBox(64,"Attention", "Installation impossible vous ne disposez pas de la license Crystal Reports."& @CRLF & "Vous devez être loggué avec le profil RCITERNE ou SDEROSA," & @CRLF& " Ils sont les seuls à être en possession d'une license Crystal Reports Developper.") Exit(1) else . . EndIf Link to comment Share on other sites More sharing options...
Developers Jos Posted July 17, 2007 Developers Share Posted July 17, 2007 (edited) Hi, I cannot change or by and because it's a condition, the syntax is correct, this morning i tried this see below, but same issue.Yes you can and your syntax is wrong Read the statement you created out loud for yourself and you will see it is wrong and needs an AND. Your statement is ALWAYS true since the value will ALways be either NotEqual to "value1" OR "value2" If @UserName <> "RCITERNE" And @UserName <> "SDEROSA" Then ; this is when @UserName is something else that the 2 specified names Else ; this is when @UserName is one of the 2 specified names Endif Edited July 17, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
SadBunny Posted July 17, 2007 Share Posted July 17, 2007 (edited) @latoone: you can still keep using the OR if you can't be convinced that your current syntax is incorrect: If @UserName = "RCITERNE" Or @UserName = "SDEROSA" Then ; this is when @UserName is one of the 2 specified names Else ; this is when @UserName is something else that the 2 specified names Endif Note that I changed the '<>' to '=', and reversed the 'this is when' parts. In this way you can keep the Or (though JdeB is perfectly right too, ofcourse). I would actually recommend this syntax, since a relation between two positive statements are one step easier to wrap your mind around than a relation of two negative statements. Both your syntaxes remind me of factly correct but overly complicated English statements like "I am not not male" meaning that I am male. Edited July 17, 2007 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
latoonne Posted July 17, 2007 Author Share Posted July 17, 2007 Thanks a lot, and long life to internet community. Link to comment Share on other sites More sharing options...
SkiFreak Posted July 17, 2007 Share Posted July 17, 2007 (edited) change the OR to AND to make the If correctI would have written the condition the same way as latoonne but with your very logical second response I now see why I should NOT do this. Surfing the forums is always eye opening . . . Edited July 17, 2007 by SkiFreak Link to comment Share on other sites More sharing options...
SadBunny Posted July 17, 2007 Share Posted July 17, 2007 I would have written the condition the same way as SadBunny but with your very logical second response I now see why I should NOT do this. Surfing the forums is always eye opening . . .? Roses are FF0000, violets are 0000FF... All my base are belong to you. 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