Name: platform

Type: function

Syntax: the platform

Syntax: platform()

Summary: <return|Returns> the name of the operating system LiveCode is running on.

Introduced: 1.0

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Example:
the platform

Example:
if the platform is "MacOS" then set the activatePalettes to true

Returns (enum): The platform function returns one of the following strings:SGI IRIS               Silicon Graphics IRIXIBM RS/6000    AIXIntel SCO        SCO Open DeskTopIntel SVR4  Solaris for x86 architectureSPARC Solaris    SPARC SolarisWin32   Windows (any version post-3.1)iphoneiOS devicesandroidAndroid devices
-MacOS : any Mac OS, OS X, or Darwin system
-Linux : Linux for Intel or PowerPC architecture
-BSD : BSD UNIX (BSDI, FreeBSD)
-HP:9000/700 HP:UX
-SPARC : SPARC SunOS

Description:
Use the <platform> <function> to change a <stack|stack's> <behavior> or <appearance> depending on the operating system.

The <platform> <function> is compiled into each version of the LiveCode <engine>. This means that, for example, if you're developing on a <Mac OS|Mac OS system> and you build a <standalone application> for <Unix|Linux>, when you run the <standalone application> on a <Unix|Linux> system, the <platform> <function> <return|returns> "Linux".

>*Tip:*  To determine whether a Mac system is running <Mac OS> or <OS X>, use the <systemVersion> <function> along with the platform <function>, as in the following example:

  set the itemDelimiter to "." -- versions are of the form "x.y.z"
  if the platform is "MacOS" and item 1 of the systemVersion &gt;= 10 then
    answer "This is an OS X system."
  end if

Changes:
Support for Alpha Digital UNIX was removed and support for OS X was added in version 1.1.

References: function (control_st), stack (object), systemVersion (function), buildNumber (function), deleteRegistry (function), processor (function), MCISendString (function), return (glossary), OS X (glossary), engine (glossary), appearance (glossary), Unix (glossary), Mac OS (glossary), standalone application (glossary), behavior (glossary)
