custapp.inc 951 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2003 by the Free Pascal development team
  5. Linux version of custom app object routines.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. Procedure SysGetEnvironmentList(List : TStrings;NamesOnly : Boolean);
  13. Var
  14. P : PPChar;
  15. S : String;
  16. I : Integer;
  17. begin
  18. List.Clear;
  19. P:=EnvP;
  20. if (P<>Nil) then
  21. While (P^<>Nil) do
  22. begin
  23. S:=StrPas(P^);
  24. If NamesOnly then
  25. begin
  26. I:=Pos('=',S);
  27. If (I>0) then
  28. S:=Copy(S,1,I-1);
  29. end;
  30. List.Add(S);
  31. Inc(P);
  32. end;
  33. end;