zoukankan      html  css  js  c++  java
  • delphi:function ParamStr(i:LongInt):string

    转载地址:https://www.freepascal.org/docs-html/rtl/system/paramstr.html

    ParamStr

    Return value of a command-line argument.

    Declaration

    Source position: systemh.inc line 1397

    function ParamStr(

      l: LongInt

    ):string;

    Description

    Paramstr returns the L-th command-line argument. L must be between 0 and Paramcount, these values included. The zeroth argument is the path and file name with which the program was started.

    The command-line parameters will be truncated to a length of 255, even though the operating system may support bigger command-lines. The Objpas unit (used in objfpc or delphi mode) defines versions of Paramstr which return the full-length command-line arguments, using ansistrings.

    In the interest of portability, the ParamStr function tries to behave the same on all operating systems: like the original ParamStr function in Turbo Pascal. This means even on Unix, paramstr(0) returns the full path to the program executable. A notable exception is Mac OS X, where the return value depends on how the application was started. It may be that just the name of the application is returned (in case of a command-line launch)

    In general, it's a bad idea to rely on the location of the binary. Often, this goes against best OS practices. Configuration data should (or can) not be stored next to the binary, but on designated locations. What locations these are, is very much operating system dependent. Therefore, ParamStr(0) should be used with care.

    For an example, see Paramcount.

  • 相关阅读:
    mac 监控文件变化并重启php
    关闭某个命令的进程
    debian 添加永久环境变量方法
    debian swoole环境
    swoole 编程环境安装
    计算机网络知识笔记
    Mac 配置 php-fpm
    存储过程 利用游标 解决复制业务
    ubuntu 宝塔安装一条龙服务
    项目重零开始搭建
  • 原文地址:https://www.cnblogs.com/huiy/p/12892174.html
Copyright © 2011-2022 走看看