博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
IDL command line arguments
阅读量:2442 次
发布时间:2019-05-10

本文共 2839 字,大约阅读时间需要 9 分钟。

-arg

Syntax: -arg value

Specifies a single command line option to be saved for later access via the  function. The value string is saved. Multiple -arg switches are allowed; the values are saved in the order specified. The -arg option can be used to pass program-specific information from the command line to IDL programs.

-args

Syntax: -args value1 value2 ... valueN

Specifies one or more command line options to be saved for later access via the  function. When IDL sees the -args option, it takes any command-line arguments that follow it and saves them all. There can only be one -args option on an IDL command line, and it is always the final option. The -args switch can be used with the -arg switch; if both switches are specified, occurrences of -arg must come first, and the values specified by -args are saved following any values specified by -arg.

The COMMAND_LINE_ARGS function returns strings supplied by the user when IDL was started with the -arg or -args command line options. If either of these options is specified at the command line when IDL is started, IDL saves them without examining their values or attaching any special meaning to them.


Note
The shell performs its normal interpretation of wildcards and shell metacharacters before the values of the -arg or -args command line options are passed to IDL.

Strings specified at the command line can be retrieved at any time within the IDL session via the COMMAND_LINE_ARGS function. This mechanism can be used to pass special application-defined values to a program written in the IDL language.

Syntax

Result = COMMAND_LINE_ARGS( [, =variable] )

Return Value

If any -arg or -args options were specified at the command line when IDL was started, COMMAND_LINE_ARGS returns a string array containing the specified values, one value per element. The values are returned in the order specified by the user on the command line. If no such options were specified, a NULL scalar string is returned.

Keywords

COUNT

Set this keyword equal to a named variable that will contain the number of retrieved arguments. If no arguments were specified, the variable will contain 0.

The COMMAND_LINE_ARGS routine was introduced in IDL 6.2, allowing IDL programs to access command line args passed to IDL when starting it. For example, to pass command line arguments into the MYPROGRAM routine, call IDL like below:

$ idl -e "myprogram" -args a b c

Then, in MYPROGRAM, the command line arguments could be retrieved with:

args = command_line_args()

The args string array would contain “a”, “b”, and “c”. To make it more convenient to launch IDL this way, you can create a script that calls IDL in the proper way, passing arguments of the script to arguments listed after the -args in the IDL call. If you name the wrapper script myprogram also, your calls would look like:

$ myprogram a b c

转载地址:http://opiqb.baihongyu.com/

你可能感兴趣的文章
Windows Vista IIS 7.0开启方法(转)
查看>>
Windows Vista六大版本详细介绍(转)
查看>>
单一产品不会成功 开源软件开始商业应用(转)
查看>>
RedHat上SSH2的安装和使用(转)
查看>>
安全使用RedHat Linux系统(转)
查看>>
RedHat Enterprise AS4硬盘安装步骤(转)
查看>>
全国第一个高校Linux培训考试中心建立(转)
查看>>
Solaris硬盘分区简介(转)
查看>>
gcc编译器小知识FAQ(转)
查看>>
Linux下多线程编程与信号处理易疏忽的一个例子(转)
查看>>
流氓和木马结合 强行关闭你的防火墙(转)
查看>>
SUSE一纸诉状控告SCO 捍卫知识产权(转)
查看>>
预装正版的市场意义(转)
查看>>
创建小于16M XFree86迷你Linux系统(转)
查看>>
shell中常用的工具(转)
查看>>
使用MySQL内建复制功能来最佳化可用性(转)
查看>>
一个比较vista的vista主题for rf5.0fb(转)
查看>>
Fedora Core 5.0 安装教程{下载}(转)
查看>>
把ACCESS的数据导入到Mysql中(转)
查看>>
shell里边子函数与主函数的实例(转)
查看>>