Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8878137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:38:29+00:00 2026-06-14T19:38:29+00:00

It looks like there is a builtin function, VerCompare , but it requires strings

  • 0

It looks like there is a builtin function, VerCompare, but it requires strings that have all four components, e.g. 1.2.3.4. I haven’t tried to do string manipulation in InstallScript and was hoping someone already had the code to take a version string and add .0’s as necessary.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:38:31+00:00Added an answer on June 14, 2026 at 7:38 pm

    Needs some error checking, but here’s the general idea:

    prototype NUMBER CompareVersions(STRING, STRING);
    prototype STRING FormatVersion(STRING);
    
    function NUMBER CompareVersions(leftVersion, rightVersion)
        STRING formattedLeftVersion, formattedRightVersion;
    begin
        formattedLeftVersion = FormatVersion(leftVersion);
        formattedRightVersion = FormatVersion(rightVersion);
    
        return VerCompare(formattedLeftVersion, formattedRightVersion, VERSION);
    end;
    
    function STRING FormatVersion(version)
        STRING formattedVersion;
        LIST tokens;
        NUMBER count;
    begin
        tokens = ListCreate(STRINGLIST);
        StrGetTokens(tokens, version, ".");
        count = ListCount(tokens);
        ListSetIndex(tokens, LISTLAST);
        while (count < 4)
            ListAddString(tokens, "0", AFTER);
            count = count + 1;
        endwhile;
        StrPutTokens(tokens, formattedVersion, ".", FALSE);
        ListDestroy(tokens);
        return formattedVersion;
     end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi there I have an SQL table that looks like this: CREATE TABLE IF
I have a text file that looks like this: value1 value2 value3 There are
I have a string that looks like this: Name1=Value1;Name2=Value2;Name3=Value3 Is there a built-in class/function
It looks like there are reports released on occasion that detail downloads for some
In Visual Studio 2008 there is a folder browser dialog that looks like this
I have a string that looks like this /root/test/test2/tesstset-werew-1 And I want to parse
I have a table that looks like this: Col1 Col2 Col3 Col4 a b
I have a class that looks like this: class Record { public string host
for SQL Server 2008 R2 I have a resultset that looks like this (note
I have an std::vector -like class that is compiled with Visual C++ 2008. There's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.