<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<script type="text/javascript" language="JavaScript">
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload();
}
if ((parseInt(navigator.appVersion) == 4) && (navigator.appName == "Netscape")) {
origWidth = innerWidth;
origHeight = innerHeight;
onresize = reDo;
}
onerror = null;
</script>
<style type="text/css">
< !-- div.WebHelpPopupMenu {
position: absolute;
left: 0px;
top: 0px;
z-index: 4;
visibility: hidden;
}
p.WebHelpNavBar {
text-align: right;
}
-->
</style>
<script type="text/javascript">
gRootRelPath = "../../..";
gCommonRootRelPath = "../../..";
gTopicId = "9.2.19.0_4";
<script type="text/javascript" src="../../../template/scripts/rh.min.js"></script>
<script type="text/javascript" src="../../../template/scripts/common.min.js"></script>
<script type="text/javascript" src="../../../template/scripts/topic.min.js"></script>
<script type="text/javascript" src="../../../template/scripts/topicwidgets.min.js"></script>
<script type="text/javascript" src="../../../whxdata/projectsettings.js"></script>
<link rel="stylesheet" type="text/css" href="../../../template/styles/topic.min.css"/>
<link rel="stylesheet" type="text/css" href="../../../template/Charcoal_Grey/topicheader.css"/>
<meta name="topic-status" content="Draft"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>os_version</title>
<meta name="generator" content="Adobe RoboHelp 2019"/>
<link rel="stylesheet" href="../../../assets/css/default.css" type="text/css"/>
<meta name="rh-authors" content="Mark Alexander"/>
<meta name="topic-comment" content="Reference page for os_version"/>
<meta name="rh-index-keywords" content="os_version"/>
<meta name="search-keywords" content="os_version"/>
</head>
<body>
<div class="topic-header rh-hide" id="rh-topic-header" onclick="rh._.goToFullLayout()">
<div class="logo">
</div>
<div class="nav">
<div class="title" title="os_version">
<span>os_version</span>
</div>
<div class="gotohome" title="Click here to see this page in full context">
<span>Click here to see this page in full context</span>
</div>
</div>
</div>
<div class="topic-header-shadow rh-hide" id="rh-topic-header-shadow"></div>
<h1>os_version</h1>
<p>This variable will tell you the version number for the OS that is running your game. For example, if you are running it on Windows 10, <tt>os_version</tt> will be equal to 655360.</p>
<p>The following table outlines the values that are returned for the most recent versions of the different OS:</p>
<p> </p>
<table>
<tbody>
<tr>
<th>Operating System</th>
<th>Version Name<br/> (version Number)</th>
<th>Return Value (examples)</th>
</tr>
<tr>
<td>Android</td>
<td>Nougat (7.0 - 7.11)<br/> Oreo (8.0 - 8.11)<br/> Pie (9.0)<br/> Android X (10.0)</td>
<td>24 - 25<br/> 26 - 27<br/> 28
<br/> 29
</td>
</tr>
<tr>
<td>iOS<br/> The return value is calculated as:<br/> (major_version * 16777216) + (minor_version * 4096) + build_number</td>
<td>iOS 10 (10.3)<br/> iOS 11 (11.4)<br/> iOS 12 (12.0)<br/> iOS 13 (13.0) iPhone<br/> iOS 13 (13.5) iPhone/Ipad</td>
<td>167784448<br/> 184565760
<br/> 201326592
<br/> 218103808
<br/>
<br/> 218124288
</td>
</tr>
<tr>
<td>macOS X<br/> The return value is calculated as:<br/> (major_version * 16777216) + (minor_version * 4096) + build_number</td>
<td>El Capitan (10.11)<br/> Sierra (10.12)<br/> High Sierra (10.13)<br/> Mojave (10.14)<br/> Catalina (10.15)</td>
<td>167817216<br/> 167821312
<br/> 167825408
<br/> 167829504
<br/> 167833600
</td>
</tr>
<tr>
<td>Windows<br/> (the return value is calculated as:<br/> majorVersion * 65536 + minorVersion)</td>
<td>Windows 7 (6.1)<br/> Windows 8 (6.2)<br/> Windows 8.1 (6.3)<br/> Windows 10 (10.0)</td>
<td>393217<br/> 393218
<br/> 393219
<br/> 655360
</td>
</tr>
</tbody>
</table>
<p> </p>
<p class="note"><b>NOTE</b>: Should you require further information about the Windows OS you can use the <span style="font-size:1px;"><a href="environment_get_variable.htm"><tt style="font-size: 14px">environment_get_variable()</tt></a></span>.</p>
<p> </p>
<h4>Syntax:</h4>
<p class="code">os_version</p>
<p> </p>
<h4>Returns:</h4>
<p class="code">Real</p>
<p> </p>
<h4>Example:</h4>
<p class="code">if (os_type == os_android) && (os_version > 10)<br/> {
<br/> global.GFX = 1;<br/> }
</p>
<p>The above code checks the os type and version number and they are both correct then the global variable is set to 1.</p>
<p> </p>
<p> </p>
<p> </p>
<div class="footer">
<div class="buttons">
<div class="clear">
<div style="float:left">Back: <a href="OS_And_Compiler.htm">OS And Compiler</a></div>
<div style="float:right">Next: <a href="os_is_paused.htm">os_is_paused</a></div>
</div>
</div>
<h5>© Copyright YoYo Games Ltd. 2020 All Rights Reserved</h5>
</div>
</body></html>