Please enable JavaScript to view this site.

A-Shell Reference

Navigation: Development Topics > Miscellaneous Topics

Determining Your Platform

Scroll Prev Top Next More

Despite all efforts at cross-platform compatibility, it is often desirable to determine which platform you are running on in order to take advantage of its peculiar features (or, less positively, to avoid performing a program operation that will blow up in your face.) Fortunately, this is relative easy, and there are several ways to do it. In the simplest (and most typical) case, you probably just want to know whether you are on a Windows platform or not. An easy way to do that is just to check the directory separator character. If it is "\", then you can assume Windows. Otherwise you can assume some form of Unix or Linux. The call to get the directory separator is:

xcall MIAMEX, MX_DIRSEP, dirsep$   ! returns dirsep$ = "\" or "/"

Alternatively, you can get more details and specific information about both the currently running operating system version and the platform that the running copy of A-Shell was compiled for, by using:

xcall MIAMEX, MX_OSVER, osname {,osver, osrel, asplatform}

See Also

ZTERM Escape Sequences for instructions on detemining if the terminal emulator is ZTERM, ATE or something else,
AUI_ENVIRONMENT for another way of detemining the characteristics of the environment or platform (particularly as they relate to its GUI capabilities).