productVersion: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
(Fixed faulty example 3)
 
(35 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2oa |= Game name
|game1= arma2oa
|version1= 1.62


|1.62|= Game version
|game2= tkoh
____________________________________________________________________________________________
|version2= 1.00


| Returns the product's friendly name, identifier and version. In Arma 3 it also returns branch identifier, whether or not the game was launched using mods, and the platform.|DESCRIPTION=
|game3= arma3
____________________________________________________________________________________________
|version3= 0.50


| '''productVersion''' |SYNTAX=
|gr1= System


|p1= |PARAMETER1=
|descr= Returns the product's friendly name, identifier, version and build number.
{{Feature|arma3|The command has been upgraded to also returns branch identifier, whether or not the game was launched using mods, the platform and the architecture.}}


|p2=  |PARAMETER2=
|s1= [[productVersion]]


| [[Array]]
|r1= [[Array]] in format [name, nameShort, version, build, branch, isModded, platform, architecture]:
* [[String]] - Product Name
* name: [[String]] - product name
* [[String]] - Product Name Short
* nameShort: [[String]] - product short name
* [[Number]] - Product Version Number
* version: [[Number]] - product version number
* [[Number]] - Product Build Number
* build: [[Number]] - product build number
* [[String]] (Arma 3) - Product Branch
* {{GVI|arma3|1.00|size= 0.75}} branch: [[String]] - product branch, can be {{hl|"Stable"}}, {{hl|"Development"}}, {{hl|"Diag"}} or {{hl|"Profile"}}
* [[Boolean]] (Arma 3) - Product is launched using mods [[true]] or vanilla [[false]]
* {{GVI|arma3|1.00|size= 0.75}} isModded: [[Boolean]] - is the product running with mods ([[true]]) or vanilla ([[false]])
* [[String]] (Arma 3) - Platform (''"Windows"'', ''"Linux"'' or ''"OSX"'')
* {{GVI|arma3|1.00|size= 0.75}} platform: [[String]] - can be {{hl|"Windows"}}, {{hl|"Linux"}} or {{hl|"OSX"}}
* [[String]] (Arma 3) - Architecture - '''x64''' for 64bit or '''x86''' for 32bit '''Since version 1.67'''
* {{GVI|arma3|1.68|size= 0.75}} architecture: [[String]] - {{hl|"x64"}} for 64bit or {{hl|"x86"}} for 32bit
|RETURNVALUE=
____________________________________________________________________________________________
 
|x1= <code>[[hint]] [[str]] [[productVersion]]; //''would return ["Arma 2 OA", "arma2oa", 162, 95208] on Arma 2 OA 1.62.95208''</code> |EXAMPLE1=
|x2= <code>[[hint]] [[str]] [[productVersion]]; //''["Arma 3","Arma3",137,128764,"Development",false,"Windows"]''</code>|EXAMPLE2=
____________________________________________________________________________________________


| [[supportInfo]], [[requiredVersion]] |SEEALSO=
|x1= <sqf>hint str productVersion; // would return ["Arma 2 OA", "arma2oa", 162, 95208] on Arma 2 OA 1.62.95208</sqf>


|x2= <sqf>hint str productVersion; // ["Arma 3", "Arma3", 137, 128764, "Development", false, "Windows"]</sqf>
|x3= <sqf> format ["%1.%2", (productVersion select 2) * 0.01 toFixed 2, productVersion select 3]; // returns version e.g.: "2.00.146773"</sqf>
|seealso= [[supportInfo]] [[requiredVersion]]
}}
}}
[[Category:ArmA 2 OA: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 18:28, 17 October 2023

Hover & click on the images for description

Description

Description:
Returns the product's friendly name, identifier, version and build number.
Arma 3
The command has been upgraded to also returns branch identifier, whether or not the game was launched using mods, the platform and the architecture.
Groups:
System

Syntax

Syntax:
productVersion
Return Value:
Array in format [name, nameShort, version, build, branch, isModded, platform, architecture]:
  • name: String - product name
  • nameShort: String - product short name
  • version: Number - product version number
  • build: Number - product build number
  • Arma 3 logo black.png1.00 branch: String - product branch, can be "Stable", "Development", "Diag" or "Profile"
  • Arma 3 logo black.png1.00 isModded: Boolean - is the product running with mods (true) or vanilla (false)
  • Arma 3 logo black.png1.00 platform: String - can be "Windows", "Linux" or "OSX"
  • Arma 3 logo black.png1.68 architecture: String - "x64" for 64bit or "x86" for 32bit

Examples

Example 1:
hint str productVersion; // would return ["Arma 2 OA", "arma2oa", 162, 95208] on Arma 2 OA 1.62.95208
Example 2:
hint str productVersion; // ["Arma 3", "Arma3", 137, 128764, "Development", false, "Windows"]
Example 3:
format ["%1.%2", (productVersion select 2) * 0.01 toFixed 2, productVersion select 3]; // returns version e.g.: "2.00.146773"

Additional Information

See also:
supportInfo requiredVersion

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note