AzKay Posted December 21, 2006 Posted December 21, 2006 $CurrentVersion = IniRead("Setting.ini", "Version", "Current", "") $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("GET", "http://h1.ripway.com/ROToolbox/CurrentVersion.txt") $oHTTP.Send() $NewestVersion = $oHTTP.Responsetext If $CurrentVersion = $NewestVersion Then MsgBox(0, "Info", "Your have the latest version.") Else If $CurrentVersion < $NewestVersion Then $Update = MsgBox(4, "Info", "Update Available. Update Now?") If $Update = 6 Then Update() EndIf EndIf Func Update() IniWrite("Setting.ini", "Version", "Current", $NewestVersion) EndFunc Here the ini [Version] Current=1 Heres my problem, It always says It needs to update, even if its the same "Version" as the newest. The ini says 1, then NewestVersion.txt says 1, I checked in a msgbox, they are both 1, yet, it still says its less. # MY LOVE FOR YOU... IS LIKE A TRUCK- #
MHz Posted December 21, 2006 Posted December 21, 2006 Try converting the strings stored in the variables with Int() before testing the condition.
AzKay Posted December 21, 2006 Author Posted December 21, 2006 (edited) Works now, Thanks ^^ Edited December 21, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Xenobiologist Posted December 21, 2006 Posted December 21, 2006 Hi, $CurrentVersion = IniRead("Setting.ini", "Version", "Current", "") $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open ("GET", "http://h1.ripway.com/ROToolbox/CurrentVersion.txt") $oHTTP.Send () $NewestVersion = $oHTTP.Responsetext Select Case Int($CurrentVersion) = Int($NewestVersion) MsgBox(0, "Info", "Your have the latest version.") Case Int($CurrentVersion) < Int($NewestVersion) If MsgBox(4, "Info", "Update Available. Update Now?") = 6 Then Update() EndSelect Func Update() IniWrite("Setting.ini", "Version", "Current", $NewestVersion) EndFunc ;==>Update So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
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