Constant

# XojoVersion

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

Reports the major and minor version number of Xojo.

## Usage

``` xojo
result = XojoVersion
```

| Part   | Type                             | Description                                             |
|--------|----------------------------------|---------------------------------------------------------|
| result | `Double</api/data_types/double>` | Constant indicating the major and minor version number. |

## Notes

The format is the four digit year of the release followed by a period followed by the release number.

You can use <span class="title-ref">XojoVersion</span> in an `#if</api/compiler_directives/if...endif>` statement to determine whether a use is running a particular version of Xojo. Based on the result, you conditionally compile code that is available only for that version.

## Sample code

The following line displays the version of Xojo being used:

``` xojo
MessageBox("You're using version " + XojoVersion.ToString)
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

The following includes code only for applications built using Xojo version 2017 Release 1 or above.

``` xojo
#If XojoVersion > 2017 Then
  ' include code here
#EndIf
```

## Compatibility

|                       |     |
|-----------------------|-----|
| **Project Types**     | All |
| **Operating Systems** | All |

<div class="seealso">

`DebugBuild</api/compiler_directives/debugbuild>`, `XojoVersionString</api/language/xojoversionstring>`, `TargetBigEndian</api/compiler_directives/targetbigendian>`, `TargetDesktop</api/compiler_directives/targetdesktop>`, `TargetLinux</api/compiler_directives/targetlinux>`, `TargetLittleEndian</api/compiler_directives/targetlittleendian>`, `TargetMachO</api/compiler_directives/targetmacho>`, `TargetMacOS</api/compiler_directives/targetmacos>`, `TargetWindows</api/compiler_directives/targetwindows>`, `TargetX86</api/compiler_directives/targetx86>` constants; `＃If...＃EndIf</api/compiler_directives/if...endif>` statement.

</div>
