ParamStr、ParamCount、CmdLine-熊猫烧香代码学习之一

http://community.csdn.net/Expert/TopicView3.asp?id=5320418

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).

ParamStr(0) 在windows下返回应用程序路径和文件名称(含扩展名),参数则从1开始,
“function ParamCount: Integer; ”则返回存在的参数数量

另:
Delphi syntax:

var CmdLine: PChar platform;

下次再学。。。

转载于:https://www.cnblogs.com/ZhouXiHong/archive/2007/01/30/634176.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值