zoukankan      html  css  js  c++  java
  • ParamStr function<参考Delphi帮助>

    Sample code

    ShowMessage(ExtractFilePath(ParamStr(0)));          //获取程序所在目录
    ShowMessage(ExtractFilePath(Application.ExeName));  //获取程序所在目录
    ShowMessage(GetCurrentDir + '\');                   //获取当前目录

    returns the same results

    ParamStr:

    Returns a specified parameter from the command-line.

    Unit

    System

    Category

    command line utilities

    Delphi syntax:

    function ParamStr(Index: Integer): string;

    C++ syntax:

    extern PACKAGE AnsiString __fastcall ParamStr(int Index);

    Description

    ParamStr returns the parameter from the command line that corresponds to Index, or an empty string if Index is greater than ParamCount. For example, an Index value of 2 returns the second command-line parameter.

    On Windows, ParamStr(0) returns the path and file name of the executing program (for example, C:\TEST\MYPROG.EXE).
     On Linux, ParamStr(0) returns the command used to execute the program, without parameters (for example, ./myprogram). This behavior is dependent on information returned by the shell program and may not be consistent among all shells.
    Note: Use double quotes to wrap multiple words as one parameter (such as long file names containing spaces).

  • 相关阅读:
    2016年中国大学生程序设计竞赛(杭州)解题报告
    HNOI2017滚粗记
    BZOJ4515 SDOI2016 游戏
    BZOJ2157 旅行 模拟
    codevs2019 Uva10029 递变阶梯
    POJ 2585 Window Pains 题解
    linux 下 打包 和解压缩
    php 分页
    js 四舍五入
    angularjs 过滤多组数据
  • 原文地址:https://www.cnblogs.com/feng801/p/1298093.html
Copyright © 2011-2022 走看看