CGridView:FindRow CGridView:FromTable

CGridView:FindRow2


The FindRow2 method returns the row number containing the specified string. The row names are matched to the target name by ignoring differences in case, so that matching to the target string "mag", "Mag", or "MAG" will give the same result. By default, the search is performed in the first left heading column at index 0. You can also search another left heading at column index -1, -2, etc., or the grid body starting at column 1.

This method compares the target title to the exact grid title without stripping leading and trailing whitespace from the row title. To match the titles afer stripping whitespace from the grid title, use FindRow. For example, suppose you wish to find the grid row with the title "Mag". If the grid title is "Mag " or " Mag", then the present function will not find the row match and will return -10. However, the FindRow method will find a match because it ignores the leading whitespace in " Mag" and the trailing whitespace in "Mag ".

Syntax

nRow = CGridView:FindRow2( strName )

nRow = CGridView:FindRow2( strName, nCol )

bullet.gif    Where strName is the string to locate.

bullet.gif    Optionally, nCol specifies a different column to search. If this is omitted, only column 0 (the first side-heading column) is searched.

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

Example

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

G = attach_gridview()

-- attaches the top-most grid window from Mira

nRow = G:FindRow2("my row title")

-- returns the row with side heading "my row title".

Related Topics

CGridView class

GetRow

GetStr

FindRow

FindCol

 

 


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