Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: PowerBuilder
Expertise: Beginner
Sep 27, 1999

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() )
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date