[fpc-pascal] Which OS?

Michael Van Canneyt michael at freepascal.org
Mon Jul 11 11:20:28 CEST 2005



On Mon, 11 Jul 2005, Thomas Zastrow wrote:

> Hello,
>
> how can I test - at runtime - under which OS (Linux, Windows and so on) a 
> FPC-program is running?

Try

Var
   ThisOS : String;

begin
   ThisOS := {$I %FPCTARGET%};



results in a string of the form i386-linux or i386-win32.

Michael.




More information about the fpc-pascal mailing list