Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.20

Description

Description:Returns the current version number.

Syntax

Syntax:versionNumber
Parameters:
Return Value:Array of Number - [major,minor,build]
Since V3.6 it returns [major,minor,hotfix,build]

Examples

Examples:
_currVersion = versionNumber
might return [1,20,3456]

Additional Information

See also: productVersion, requiredVersion
Multiplayer:
Problems:

Notes







Posted on Aug 29, 2014
Kronzky
To convert the returned array into a number that can be used in comparisons (considering major & minor version info), you can use the following code, which converts the two version elements into a 100-based decimal, e.g. 1.69->169, 2.2->202, 3.5->305:


(VersionNumber select 0)*100+(VersionNumber select 1)

You can then do a check like this:

_version = (VersionNumber select 0)*100+(VersionNumber select 1);
if (_version<170) then {
  [] execVM "oldScript.sqf"
} else {
  [] execVM "newScript.sqf"
};