syspara.inc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2017 by Karoly Balogh
  4. members of the Free Pascal development team.
  5. Command line parameter handling
  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. { Generates correct argument array on startup }
  13. procedure GenerateArgs;
  14. begin
  15. end;
  16. {*****************************************************************************
  17. ParamStr
  18. *****************************************************************************}
  19. { number of args }
  20. function ParamCount: LongInt;
  21. begin
  22. ParamCount := argc - 1;
  23. end;
  24. { argument number l }
  25. function ParamStr(l: LongInt): string;
  26. var
  27. s1: string;
  28. begin
  29. ParamStr := '';
  30. if (l > 0) and (l + 1 <= argc) then
  31. ParamStr := StrPas(argv[l]);
  32. end;