# Set Integer

Sets the control contained in a cell to the specified integer value. The control must be of the types EditInt, Checkbox, or ListBox.

## Set Integer Inputs

Syntax: SI<TagName|Cell> <Value>

## Set Integer Outputs

Returns a status code. The status codes are:

Status Codes | Description
--- | ---
1 | The command was executed successfully.
0 | Unrecognized command.
-1 | Invalid tag name.
-2 | The command could not be executed, or the specified integer value is outside of the control's valid range. For example, the specified cell may not contain a control of the valid type.
-3 | Unable to set a read only tag.
-4 | Wrong argument type.
-6 | User does not have Full Access to execute the command.

## Example: Change the Value of an EditInt Control

1. Assume cell A2 is populated as follows:

   A2 = EditInt(0,10)

   The cell A2 is published with the name IntInA2.

   A2 currently contains the value 3. The spreadsheet looks like this:

2. To change the value to 8, issue the SIIntInA2 8 command, as shown in the following telnet client window:

   The In-Sight sensor responds with 1, indicating that the command was successfully executed. The EditInt control has been successfully changed from 3 to 8 within the spreadsheet:

## Example: Toggle the State of a CheckBox Control

You can enable or disable a CheckBox control using the Set Integer command by sending a value of 1 (enable) or 0 (disable) to the cell that contains the check box.

1. Assume cells B2, D2 and E2 are populated as follows:

   - B2 = CheckBox("Draw circle")
   - D2 = 'Check box integer value =
   - E2 = $B$2

   The check box is currently cleared, as shown:

   Note: Cell E2 is simply reporting the integer value of the CheckBox control.

2. To select this check box using the Set Integer Native Mode command, issue the command SIDrawCircle 1, as shown in the following telnet client window:

   The In-Sight sensor responds with 1, indicating that the command was successfully executed. The check box is now selected:

   Cell E2 changed from 0 to 1 to reflect the new integer value of the CheckBox control.

## Example: Change the Selection within a ListBox Control

Each item within a ListBox control has an integer value (zero-based) assigned to it. You can "choose" a different value from the list by using the Set Integer Native Mode command to assign a different value to the cell that contains the ListBox control.

1. Assume cells B2, C2 and D2 are populated as follows:

   - B2 = ListBox("Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet")
   - C2 = ' Integer List Value =
   - D2 = $B$2

   The ListBox control is currently set to Yellow; this corresponds with an integer value of 2, as shown in the following spreadsheet:

   Note: Cell D2 is simply reporting the integer value of cell B2.

2. To change the current list selection to Blue using the Set Integer Native Mode command, issue the command SIColor 4, as shown in the following telnet client window:

   The In-Sight sensor responds with 1, indicating that the command was successfully executed. The list selection has been changed from Yellow to Blue within the spreadsheet:

   Cell D2 changed from 2 to 4 to reflect the new integer value of the ListBox control.