Board index » delphi » Getting Environment Variables

Getting Environment Variables

How do I determine the value of Environment Variables?  I want to copy a
file from a location specified by the user to the location specified as the
windows temporary directory.

Thanks,
Jesse

 

Re:Getting Environment Variables


Jesse Castleberry schrieb:

Quote

> How do I determine the value of Environment Variables?  I want to copy a
> file from a location specified by the user to the location specified as the
> windows temporary directory.

> Thanks,
> Jesse

Just 6 hours ago I found the code on the famous "Delphi Tip of the Day"
URL.

http://www.geocities.com/~franzglaser/tp.html
TP-links ... chapter: Delphi

Regards,
Franz Glaser
http://members.eunet.at/meg-glaser

Re:Getting Environment Variables


In article <6g14gv$ci...@news10.ispnews.com>, "Jesse Castleberry"

Quote
<D...@iThink.net> writes:
>How do I determine the value of Environment Variables?  I want to copy a
>file from a location specified by the user to the location specified as the
>windows temporary directory.

function GetEnvironMentValue(EnvName : string) : string;
var
  EName : string;
  EnvValue : array[0..100] of char;
begin
  EName := '%' + UpperCase(EnvName) + '%';
  ExpandEnvironmentStrings(PChar(EName), EnvValue, 100);
  Result := EnvValue;
end;

Alaan Lloyd
alangll...@aol.com

Other Threads