SETCELL

Syntax

Example

Description/Remarks

SETCELL "Column", Row_number, "Value"

SETCELL "D", 5, "Fred"

This sets the value of cell [D5] to "Fred".

This command allows you to set or change the value of another cell in the template.

The "Column" and Row_number parameters specify which cell's value to change.

The "Value" parameter specifies the new value for that cell. This parameter must be a string value. You can use the CSTR command to format a numeric value as a string.

One common use of this command is to set an initial value for a Keyboard cell, so that data entry users are presented with an initial value that can be accepted or modified instead of a blank data input box.  

If you are setting the value of a cell in the Event, Cause or Action Taken column, or if you need for the changed cell value to trigger some action in the template, your template must visit the cell after SETCELL has made the change. Some examples of actions that are triggered when you visit a cell include:

  • Filling a column (e.g., traceability, event, etc.) with the selected value

  • Forcing the operator to enter a value (e.g., traceability, event, etc.)

  • Requiring that the selected value come from a pre-defined list (e.g., standard, traceability, event, etc.)

  • Verifying that a data value is numeric or that a date/time value uses a valid date format

  • Updating the chart, displayed data values, statistics, etc. when changing the standard or a data value

  • Performing real-time checks when entering or changing a data value

  • Automatically saving a data record after the last data point has been entered

For example, If you use SETCELL to set or change the standard for one row of the template, the chart for that row will not be updated with the new standard until the template visits the Part Number cell for that row.

As another example, if your template is configured to fill all of the cells in the "Operator" traceability column with the selected value, and if you use SETCELL to set or change the operator code in only one cell in that column, the other cells in the "Operator" column will not be filled with the new operator code until the template visits the one cell that you set with this new operator code.

However, if no such automatic template action is needed for the changed value, then it is not necessary for the template to visit the changed cell.

SETCELL "Column", Row_number, "Inputmode"

SETCELL "D", 5, ".inputmode=keyboard"

This sets the input mode of cell [D5] to "keyboard"

The "Column" and Row_number parameters specify which cell's input mode to change.

The "inputmode" parameter specifies the new input mode for that cell without changing the value. Valid options for the input mode are "keyboard" and "formula".

This changes the input mode for the specified cell without changing the cell's value.

The input mode change is temporary. The original value will be restored the next time the template loads.

SETCELL "Column", Row_number, "formula"

SETCELL "D", 5, ".formula=message 'hello world'"

This sets the formula of cell [D5] to "message 'hello world'"

The "Column" and Row_number parameters specify which cell's formula to change.

The "formula" parameter specifies the new formula for that cell without changing the value. Valid options for the formula mode are any valid formula text. Ensure that the new formula text will not generate a syntax error.

This changes the formula for the specified cell without changing the cell's value.

The formula change is temporary. The original value will be restored the next time the template loads.

SETCELL "Cell", Row_number, ".USERMESSAGE=text"

SETCELL "D", 5, ".USERMESSAGE=hello world"

This sets the message that displays above the enter data/value field on the Data Entry tab of the SPC Data Entry module to "hello world'" when a value is to be entered at cell [D5].

The "Cell" and Row_number parameters specify at which point in the data entry session the message is to display. This changes the message that displays for the specified cell without changing the cell's value.

The user message is the text shown above the enter data/value field as indicated by the red arrow in this example: