Sometimes, it may be useful to know which operating system is running your script, because there are some differences in operating systems.
The PARSE SOURCE keywords parse information about the operating system. The first word is the name of the operating system. Different interpreters may display different names for operating systems. Here is a chart of typical names:
Name |
Operating System |
WIN32 | All versions of Microsoft Windows. |
UNIX | All versions of UNIX (including LINUX). |
DOS | All versions of Microsoft MS-DOS. |
MACOS | All versions of Apple's Macintosh. |
OS2 | All versions of IBM OS/2. |
WIN32 | All versions of Windows. |
VMS | All versions of VMS. |
AMIGA | All versions of Commodore's Amiga system. |
/* Get the first word (operating system name) into the
* variable "OS". Note the trailing dot on this
* instruction. This is very important, as it throws
* away any subsequent information that PARSE SOURCE
* may return.
*/
PARSE SOURCE OS .
/* Display the operating system name */
SAY "Operating system:" OS
Reginald's OPTIONS "OS" statement allows a more specific name to be returned for the operating system. For example, instead of returning the name "WIN32" for all versions of Windows, PARSE SOURCE will return one of the following names:
Name |
Operating System |
WIN95 | Windows 95. |
WIN98 | Windows 98 (or 98 SE). |
WINME | Windows Millenium Edition. |
WINNT | Windows NT. |
WIN2K | Windows 2000. |
WINXP | Windows XP (or later versions). |
WIN32S | Windows 3.1 or WfW. |
WIN32 | Unknown version of Windows. |
/* Enable Reginald's OPTION to return a more specific name */
OPTIONS "OS"
PARSE SOURCE OS .
SAY "Operating system:" OS
Note: To get other information about the operating system, see System Information.