Class Version

Introduction

This class provides methods for dealing with version numbers, as well as static members for what versions of Synthesis, Synergy/DE, and the Synergy/DE UI Toolkit are in use.

Contents

  1. Introduction
  2. Contents
  3. Explanation of symbols used
  4. Member reference
    1. comparison operators - compare versions
    2. constructors, explicit cast - create a version number
    3. Letter - the version letter
    4. Major - the major revision number
    5. make_what - construct a Unix what string
    6. Minor - the minor revision number
    7. Primary - the primary version number
    8. SynergyDE - version of Synergy/DE in use
    9. Synthesis - version of Synthesis library in use
    10. Toolkit - version of the Synergy/DE UI Toolkit in use
    11. ToString, explicit cast - string representation of a version

Explanation of symbols used

Words in italics indicate an instance of a class. The word corresponds to the class name, except where more than one instance is represented in the same statement. In that case a number (2, 3, etc.) is appended to the class name.

Words in normal typeface are to be taken literally (required punctuation, class name in a static reference, method name, etc.)

The symbol => is used to separate an expression (on the left) from its return value (on the right).

An ellipsis (...) indicates that the previous argument may be repeated any number of times. The description will indicate whether one instance is required.

Member reference

comparison operators

version operator version => boolean
version operator a => boolean
a operator version => boolean
Version includes the comparable mixin to provide comparison operators both between Version objects and between Versions and alphanumeric values. Supported operators therefore include .eq., ==, .ne., !=, .gt., >, .lt., <, .ge., >=, .le., <=. When one operand is alphanumeric, it is first converted to a Version before comparing. When comparing versions, the Primary version is most significant, and the Letter version is least significant.

constructors, explicit cast

new Version(int, int, int, a) => version
new Version(a) => version
(Version)a => version

Creates a new Version. In the first form, the integer arguments map to Primary, Major, Minor, and Letter, in that order. To omit one of these, pass 0 for the integers and "" for the alphanumeric argument.

In the second and third forms, a must contain a version number in the form d+[.d+[.d+]][a+], where each d+ maps to an integer component (Primary, Major, Minor), and a+ maps to Letter. Extra text outside this pattern is ignored. Note that a+ can contain any characters other than whitespace or a digit.

Letter

version.Letter => a
version.Letter = a
This public field represents the final component of a version number. Normally used for a patch letter revision, it can contain any characters. When parsed from a version string, however, only non-numeric and non-space characters immediately following the last numeric component will be used.

Major

version.Major => int
version.Major = int
This public field represents the second number (major revision) in a version number.

Macro make_what

make_what(a, a2) => a3

This macro expands into a Unix-style what string. The Unix utility 'what' reports this string when run against an ELB or DBR that contains it. The first argument should be the product or component name, and the second argument should be an alphanumeric form of the version number. The resulting string has the format "a Version a2", with appropriate punctuation for the what utility.

Example:


	const myversion, a*, "2.1.1"
        const whatstr, a*, make_what("widgets R us", myversion)
      

Minor

version.Minor => int
version.Minor = int
This public field represents the third number (minor revision) in a version number.

Primary

version.Primary => int
version.Primary = int
This public field represents the first number in a version number.

static property SynergyDE

Version.SynergyDE => version
This read-only property provides the Version of the Synergy/DE runtime in use.

static property Synthesis

Version.Synthesis => version
This read-only property provides the Version of the Synthesis library itself.

static property Toolkit

Version.Toolkit => version
This read-only property provides the Version of the Synergy/DE UI Toolkit library in use. If the UI Toolkit has not been started, ^null is returned. See GotToolkit.

override method ToString, explicit cast

version.ToString() => string
(a)version => a
Converts a version to its alphamumeric form, which is Primary followed by '.', then Major, '.', Minor, and finally Letter.