CGrid:SH_FindRow


The SH_FindRow method returns the row number containing the specified string. By default, the search is performed in the first left heading column at index 0. You can also search another side heading at a column index below 0, namely, -1, -2, etc., or the grid body starting at column 1.

Note: The side heading column numbering differs with the CGridView class. Going leftward from the grid, the CGrid side headings are numbered 1, 2, 3, ..., whereas the CGridView side headings are numbered 0, -1, -2, ...

Syntax

nRow = CGrid:SH_FindRow( strName )

nRow = CGrid:SH_FindRow( strName, nColumn )

bullet.gif    Where strName is the string to locate.

bullet.gif    Optionally, nRow specifies a different column to search. If this is omitted, only column 0 is searched.

bullet.gif    nRow is returned as the index of the row found, starting with 1. On error, -10 is returned, as it is unlikely a grid has more than 10 top rows.

Example

The following creates a CGrid, fills it with data, then finds a named column:

G = new_grid()

-- create a new CGrid object

-- fill the grid

 

nRow = G:SH_FindRow("Image 5")

-- returns the row with contents "x center".

Related Topics

CGrid class, Get, TH_FindCol, FindCell


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.