devxlogo

Searching for a Specific Row in a Data Store

Searching for a Specific Row in a Data Store

Question:
What function do I use if I want to search a particular data store for the first letter of certain items?

For instance, I have this list:

    olule
    kamtibo
    okwi

If I search for a row beginning with the letter o, I get olule. When I use the Findnext function to go to the next row beginning with o, I end up with kamtibo! (I guess because there’s an o in it.) Why don’t I get okwi?

Answer:
Use the following Find command:

 ll_Row = dw_1.Find( 'Left( colname, 1 ) = ~'o~'', 1, dw_1.RowCount() )

To find the next occurrence, repeat the command but make the start row greater than the last row found by one:

 ll_Row ++ll_Row = dw_1.Find( 'Left( colname, 1 ) = ~'o~'', ll_Row, dw_1.RowCount() )

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist