custapp.inc 935 B

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