_Dos, _Mac, _Unix, _Windows

These system variables tell you which platform FoxPro is running on. In Visual FoxPro for Windows, _WINDOWS is true and the rest are false. In VFP/Mac, _MAC is .T. If we ever see Visual FoxPro for the other platforms, we expect we'll see the matching system variables set true, but we're not holding our breath.

Usage

lIsDos = _DOS
lIsMac = _MAC
lIsUnix = _UNIX
lIsWindows = _WINDOWS
Back when cross-platform meant more than Windows 95 and Windows NT, these variables were useful for cross-platform development. They allowed you to bracket platform-specific code so it didn't cause errors on the other platforms.

Example

DO CASE
CASE _WINDOWS
   MODIFY WINDOW screen FONT "Arial",10
CASE _MAC
   HIDE WINDOW screen
ENDCASE

See Also

OS()


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .