Jump to content

Recommended Posts

Posted

Func __checkOSVersion()
    Local $os = @OSVersion
    If $os <> "WIN_2003" or $os <> "WIN_2000" or $os <> "WIN_XP" Then
        MsgBox(0, "Operating System Incompatability (" & $os & ")", "Only Windows 2000, XP, and 2003 are supported right now.")
        Exit
    EndIf
EndFunc

@OSVersion reports as "WIN_XP" on my system but since I wrote this function and started using it, its' stopping me from accessing my program again. While I know I can comment it out until I figure out what's wrong, is there something glaringly obvious that's wrong with my logic as to why it IS in fact evaluating to true when it shouldn't be?? TIA.

My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume

Posted

i guess i can see how that would work (and it does in the code (ty Jos)) but why wouldn't "or" work??

My screwed up mind??

If $os is not equal to "WIN_2003"

or

$os is not equal to "WIN_2000"

or

$os is not equal to "WIN_XP"

True, True, False

nm... thnx again Jos.

My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume

  • Developers
Posted

It is simple when you see it: Whatever OS you have a minimum of 2 out of the 3 conditions is always TRUE thus the If is always true since you use an OR.

It helps when you read the statement out loud.

:D

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.
  :)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...