InsertRow

<< Click to Display Table of Contents >>

 

InsertRow

InsertRow([InsertAtRow])

Inserts a new Row on the table. The InsertAtRow parameter is optional and specifies at which table position the Row must be inserted. When omitted, it assumes the standard behavior of inserting a Row at the end of the table, which is the same as using InsertAtRow equal to -1 (minus one). When it is informed and different from -1 (minus one), it must be a value between 1 (one) and Count, and the new Row moves the other Rows with an index greater or equal to it towards ascending indexes. A new Row always assumes the following standard values for its properties:

Min: 0.0

Max: 1.0

Blink: False

BlinkValue: 0.0

Value: 0.0

 

The next script contains an example of using this method.

Sub Rectangle1_Click()
  On Error Resume Next
  Dim Bind
  Set Bind = Screen.Item("Rectangle1").Links.Item("ForegroundColor")
  If Bind Is Nothing Then
    MsgBox "Rectangle1 has no links."
  Else
    Dim row
    row = Screen.Item("SetPointRow").Value
    MsgBox Bind.RowCount
    If (row < 1 Or row > Bind.RowCount) Then
      MsgBox "Invalid row number: " & row
    Else
      MsgBox "Adding a row at: " & row
      Bind.InsertRow(row)
      If row = -1 Then
        row = Bind.RowCount
        Bind.Value(line) = Screen.Item("RectangleValue").ForegroundColor
        Bind.BlinkValue(line) = Screen.Item("RectangleBlinkValue").ForegroundColor
        Bind.Max(line) = Screen.Item("SetPointMax").Value
        Bind.Min(line) = Screen.Item("SetPointMin").Value
        Bind.Blink(line) = Screen.Item("CheckBoxBlink").Value
      End If
    End If
  End If
End Sub

Was this page useful?