CGridView:FindCol


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

Syntax

nColumn = CGridView:FindCol( strName )

nColumn = CGridView:FindCol( strName, nRow )

bullet.gif    Where strName is the string to locate.

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

bullet.gif    nColumn is returned as the index of the column found. On error, -10 is returned, as it is unlikely a grid has more than 10 side columns.

Example

The following script attaches a grid window and finds a named column:

G = attach_gridview()

-- attaches the top-most grid window from Mira

nCol = G:FindCol("x center")

-- returns the column with top heading "x center".

Related Topics

CGridView class, GetCol, GetStr, FindRow


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