Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

argc

argc(
) 
=> n / 0 / -1 / -2

Description

Returns the number of arguments passed to a SKILL script. Used to enhance the SKILL script environment. This function works only for scripting with SKILL standalone executable (skill).

Arguments

None

Value Returned

n

n arguments were passed (n is an integer).

0

No arguments were passed, but argv(0) has a value.

-1

Argument list is nil (no arguments passed, and argv(0) is nil). This can occur when using SKILL interactively.

-2

Error caused by a problem with the argument list property.

Examples

Assume that arguments passed to a SKILL script file are ("my.il" "1st" "2nd" "3rd"):

argc() => 3

An example using a SKILL executable:

$ skill -V
@(#)$CDS: skill version 07.02 09/19/2007 09:08 (cat61lnx) $
$ cat /tmp/foo.il
(printf "argc is %d, argv[0] is %s, argv is %L\n" (argc) (argv 0) (argv))
$ skill /tmp/foo.il -someArg -someArg2
argc is 2, argv[0] is /tmp/foo.il, argv is ("-someArg" "-someArg2")

Related Topics

Function and Program Structure

argv


Return to top
 ⠀
X