---
name: "clig_Int"
section: "7"
platform: "linux"
package: "clig"
version: "1.9.11.1-3"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/clig_Int"
---

# clig\_Int(7)

declare an option with parameters of type int

## NAME

::clig::Int - declare an option with parameters of type int

## SYNOPSIS

```
package require clig
namespace import ::clig::*
setSpec db
```

**Int -***opt varname usage* \[**-c** *min max*\] {\[**-d** *default ...*\] \| \[**-m**\]} \[**-r** *rmin rmax*\]

## DESCRIPTION

The **Int** command declares *-opt* to have zero or more integer arguments. The parameters *variable* and *usage* as well as the options **-c**, **-d** and **-m** are described in **clig::String**(n).

- \-r

  instructs the parser to check that arguments given to *-opt* are within the inclusive range between *rmin* and *rmax*. Special values for  *rmin* and *rmax* are  **-oo** and **oo"** denoting negative and positive infinity thereby not constraining the parameters of **-opt***.*

**WARNING:** The implementation of option  **-d** is currently incomplete insofar, as the specified default values are not checked by  **clig**, i.e. the following would go unnoticed:

**-d 1.0 -r 500 600**

In this case, if *option* is not on the command line, the clig parser will set variable *varname* for its caller to the out-of-range value 1.0. (Maybe this is a feature?)

Example use of **Int**:

```
Int -ind indices {list of indices to use} \
    -r 0 99  \
    -d 0 10 20 30 40 50 60 70 80 90 \
    -c 1 oo
```

## PARSER RESULT

### tcl

Within a Tcl-script, the parser will set the variable with name *varname* in the stack-frame of its caller if and only if option *-opt* is found on the command line or has a default value.

### C

The structure returned by the parser contains the slots *varname***P**, *varname* and *varname***C**.  The slot *varname***P** will be set to a non-zero value, if and only if the option *-opt* is found on the command line or has a default value. Otherwise it will  be 0. The slot *varname***C** will be set to the number of arguments found for *-opt*. If the number of arguments for *-opt* is allowed to be greater than 1, slot *varname* has type **int\***, otherwise it has type **int**.

## SEE ALSO

[clig\_Name(7)](/clig_Name/7.md), [clig\_Double(7)](/clig_Double/7.md), [clig(1)](/clig/1.md), [clig\_Usage(7)](/clig_Usage/7.md), [clig\_Long(7)](/clig_Long/7.md), [clig\_Version(7)](/clig_Version/7.md), [clig\_Float(7)](/clig_Float/7.md), [clig\_Rest(7)](/clig_Rest/7.md), [clig\_Description(7)](/clig_Description/7.md), [clig\_String(7)](/clig_String/7.md), [clig\_Flag(7)](/clig_Flag/7.md), [clig\_Commandline(7)](/clig_Commandline/7.md), [clig\_parseCmdline(7)](/clig_parseCmdline/7.md)
