Jump to content

Code Refuses to Work


Recommended Posts

Okay, something is fishy. My code just refuses to work.

if Not $version = "1.1" Then
        MsgBox(4096, "Update", "Update Available, Must Download Update Version. Program Shutting Down")
        ShellExecute("http://halconknights.webs.com/")
        Exit
EndIf

When it gets the version number it is 1.2, yet the if Not statement just refuses to work. Since $version = 1.1 is not true, the not statement should work, or am I just mistaken?

Link to comment
Share on other sites

You are using Not the wrong way. To do what you want you need:

$iVersion = "1.2"

If Not ($iVersion = "1.1") Then
    ConsoleWrite(Random() & @CRLF)
EndIf

Or even better, the "not equal" sign:

$iVersion = "1.2"

If $iVersion <> "1.1" Then
    ConsoleWrite(Random() & @CRLF)
EndIf

So why didn't your code work? Run this and you should get it:

ConsoleWrite((Not $iVersion) & @CRLF)
ConsoleWrite((False = "1.1") & @CRLF)
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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