From: pclaude@iccu6.ipswichcity.qld.gov.au (Claude Pellerin) 
Subject: [delphi] Accessing DOS Environment data from Delphi - getenv.dpr [01/01] 
Date: Wed, 14 Jun 1995 14:58:03 +1000 
 
I saw someone asking how to get DOS environment variables from Delphi.  
The little Project attached shows how to list all the Environment  
variables quite simply. 
Hope this helps... 
Claude. 
 
BEGIN -- Cut Here -- cut here 
program Getenv; 
 
uses WinCrt, 
  WinProcs; 
var 
 ptr: PChar; 
 Done: BOOLEAN; 
begin 
 ptr := GetDOSEnvironment; 
 Done := FALSE; 
 WHILE NOT Done DO 
 BEGIN 
  IF ptr^ = #0 THEN 
  BEGIN 
   Writeln; 
   INC(ptr); 
   IF ptr^ = #0 THEN Done := TRUE 
   ELSE Write(ptr^); 
  END 
  ELSE Write(ptr^); 
  INC(ptr); 
 END; 
end. 
  
END -- Cut Here -- cut here 
 
------------------------------------------------------------------------------- 
 
From: cfynn@sahaja.demon.co.uk (Christopher Fynn) 
Subject: Re: [delphi] Environment Variables 
Date: Wed, 14 Jun 1995 21:01:01 GMT 
 
The function in Borland Pascal and Turbo Pascal for 
Windows is: 
  
 GetEnvVar(VarName: PChar)    - returns a pointer to the value of a 
                                specified environment variable 
 
This function is in the WinDos unit  
-should be the same in Delphi. 
--  
Christopher J Fynn <cfynn@sahaja.demon.co.uk> 
 
