Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Location
    Tampon, Reunion island
    Posts
    191

    Lightbulb Need help about "version"

    Hello Indigorose Forum ! I need a help about "version". Are they a script for return if a "version" is "up or down" exemple :

    version="1.0"
    myversion="1.1"

    => myversion is "up"

    version="1.0.8"
    myversion="1.0.2.1"

    => myversion is "down"

    Do you understand ?
    Thank you in advance

  2. #2
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    I do something similar but I do this.

    Code:
    MyProgram.Version = "1.0"; -- Just for display
    MyProgram.Build = 1000; -- Nice number to compare with.
    Then compare it like this.

    Code:
    Data = UpdateServer.GrabUpdate();
    
    local Version = Data["Version"];
    local Build = Data["Build"];
    
    if (Build > MyProgram.Build) then
     -- update required. version is held in "..Version.."
    elseif (Build == MyProgram.Build) then
     -- no update required.
    else
     -- we're more up to date. lol wut
    end
    What you want:

    Code:
    local VersionAsNumber = tonumber(String.Replace(Version, ".", "", false));
    
    if (VersionAsNumber > 9000) then
      -- IT'S OVER 9000!
    end
    Last edited by ShadowUK; 08-08-2009 at 04:27 AM.

  3. #3
    Join Date
    May 2005
    Posts
    1,115
    APMS has this functionality built-in:

    Code:
    result = String.CompareFileVersions("1.0.20.3", "1.0.2.3");
    Never know what life is gonna throw at you.
    (Based on a true story.)

  4. #4
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by shadowuk View Post
    Code:
    local versionasnumber = tonumber(string.replace(version, ".", "", false));
    
    if (versionasnumber > 9000) then
      -- it's over 9000!
    End
    over 9000?!
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  5. #5
    Join Date
    Dec 2007
    Location
    Baton Rouge, LA
    Posts
    65
    Can I use this code below to do the follow tasks:
    1. check and compare my current **** version 1.0.0.0 with the network version 2.0.0.0?
    2. Prompt for new version is available
    3. Download and override existing version 1.0.0.0


    Quote Originally Posted by ShadowUK View Post
    I do something similar but I do this.

    Code:
    MyProgram.Version = "1.0"; -- Just for display
    MyProgram.Build = 1000; -- Nice number to compare with.
    Then compare it like this.

    Code:
    Data = UpdateServer.GrabUpdate();
    
    local Version = Data["Version"];
    local Build = Data["Build"];
    
    if (Build > MyProgram.Build) then
     -- update required. version is held in "..Version.."
    elseif (Build == MyProgram.Build) then
     -- no update required.
    else
     -- we're more up to date. lol wut
    end
    What you want:

    Code:
    local VersionAsNumber = tonumber(String.Replace(Version, ".", "", false));
    
    if (VersionAsNumber > 9000) then
      -- IT'S OVER 9000!
    end

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts