Main Content

clearFlags

Clear flags in Safety Analysis Manager spreadsheet

Since R2023b

Description

example

clearFlags(spreadsheet) clears the flags in the Safety Analysis Manager spreadsheet, spreadsheet.

example

clearFlags(cell) clears the flags in the Safety Analysis Manager spreadsheet cell, cell.

Examples

collapse all

Suppose you have a spreadsheet open in the Safety Analysis Manager that has two columns. The first is a check box column and the second is a text column. You want to write a script where, if the check box for a cell is not selected, the script marks the adjacent cell in the text column with a warning flag.

Retrieve the spreadsheet object.

mySpreadsheet = safetyAnalysisMgr.getOpenDocuments;

Add warning flags to the cells in the second column if the adjacent cells in the check box column are not selected.

clearFlags(mySpreadsheet)
for n = 1:mySpreadsheet.Rows
  checkCell = getCell(mySpreadsheet,n,1);
  textCell = getCell(mySpreadsheet,n,2);
  if checkCell.Value = 0
    addFlag(textCell,"warning")
  end
end

Suppose you have a spreadsheet open in the Safety Analysis Manager that has two columns. The first is a check box column and the second is a text column. You want to write a script where, if the check box for a cell is not selected, you mark the adjacent cell in the text column with a warning flag, and clear the flag if the check box is selected.

Retrieve the spreadsheet object.

mySpreadsheet = safetyAnalysisMgr.getOpenDocuments;

If the adjacent check box cell is selected, clear the cell in the text column of flags.

for n = 1:mySpreadsheet.Rows
  checkCell = getCell(mySpreadsheet,n,1);
  textCell = getCell(mySpreadsheet,n,2);
  if checkCell.Value = 1
    clearFlags(textCell)
  end
end

Input Arguments

collapse all

Spreadsheet in the Safety Analysis Manager, specified as a Spreadsheet object.

Cell in the Safety Analysis Manager spreadsheet, specified as a SpreadsheetCell object.

Version History

Introduced in R2023b