mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 06:49:23 +02:00
* Env options now based on SysUtils.GetVariableString. custapp.inc unnecessary.
git-svn-id: trunk@864 -
This commit is contained in:
parent
31a0752a37
commit
96e7fa7d36
@ -82,7 +82,6 @@ Type
|
|||||||
|
|
||||||
Implementation
|
Implementation
|
||||||
|
|
||||||
{$i custapp.inc}
|
|
||||||
|
|
||||||
{ TCustomApplication }
|
{ TCustomApplication }
|
||||||
|
|
||||||
@ -91,6 +90,28 @@ begin
|
|||||||
Result:=Paramstr(0);
|
Result:=Paramstr(0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Procedure SysGetEnvironmentList(List : TStrings;NamesOnly : Boolean);
|
||||||
|
|
||||||
|
var
|
||||||
|
s : string;
|
||||||
|
i,l,j,count : longint;
|
||||||
|
|
||||||
|
begin
|
||||||
|
count:=GetEnvironmentVariableCount;
|
||||||
|
if count>0 then
|
||||||
|
for j:=1 to count do
|
||||||
|
begin
|
||||||
|
s:=GetEnvironmentString(j);
|
||||||
|
l:=Length(s);
|
||||||
|
If NamesOnly then
|
||||||
|
begin
|
||||||
|
I:=pos('=',s);
|
||||||
|
If (I>0) then
|
||||||
|
S:=Copy(S,1,I-1);
|
||||||
|
end;
|
||||||
|
List.Add(S);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomApplication.GetEnvironmentVar(VarName : String): String;
|
function TCustomApplication.GetEnvironmentVar(VarName : String): String;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user