Board index » kylix » access envoirment variables

access envoirment variables


2005-03-02 06:35:38 PM
kylix1
Hi,
has somebody a idea, how i can access the envoirment variables in linux
with kylix. I found a function of libc.envz_get, but i'm not sure how i
have to use it.
 
 

Re:access envoirment variables

"Daniel Wunderlin" < XXXX@XXXXX.COM >wrote in message
Quote
Hi,

has somebody a idea, how i can access the envoirment variables in linux
with kylix. I found a function of libc.envz_get, but i'm not sure how i
have to use it.
I you know the name of the enviromement variable you can use
GetEnvironmentVariable(VarName). If you want all of the environment I
variables, you could do this:
procedure GetEnvironmentVariables(EnviroList: TStrings);
var
envarray: PPChar;
s: string;
begin
envarray:= System.envp;
if envarray <>nil then begin
s:= envarray^;
while s <>'' do begin
EnviroList.Add(s);
inc(envarray);
s:= envarray^;
end;
end;
end;
 

Re:access envoirment variables

Daniel Wunderlin wrote:
Quote
has somebody a idea, how i can access the envoirment variables in linux
with kylix. I found a function of libc.envz_get, but i'm not sure how i
have to use it.
What about GetEnvironmentVariable() or Libc.getenv()
--
Regards,
Andreas Hausladen
(www.kylix-patch.de.vu - unofficial Kylix 3 patches)
(andy.jgknet.de/blog)
 

{smallsort}

Re:access envoirment variables

GetEnvironmentVariable() was the function i looked for.
Thank you both! (is this really english!?)
Have a nice day... ;)
Am Wed, 02 Mar 2005 04:24:12 -0800 schrieb Andreas Hausladen:
Quote
Daniel Wunderlin wrote:

>has somebody a idea, how i can access the envoirment variables in linux
>with kylix. I found a function of libc.envz_get, but i'm not sure how i
>have to use it.

What about GetEnvironmentVariable() or Libc.getenv()