Skip to main content

[Migrated content. Thread originally posted on 19 October 2005]

I need some insight as to why my grid search routine is finding the first occurrence of the desired string, and failing to find subsequent occurrences.

I have attached the source to my search routine, which is initiated by the user entering a value into an ENTRY-FIELD (value = SEARCH-VALUE) and pressing a push button.

What I would like to have happen, is that for each press of the push-button, the routine would find the next occurrence of the desired string. Instead it keeps coming to the first one. Boo....

I suspect that the solution is quite simple, but alas, so am I.

Thanks in advance for any insight.

[Migrated content. Thread originally posted on 19 October 2005]

I need some insight as to why my grid search routine is finding the first occurrence of the desired string, and failing to find subsequent occurrences.

I have attached the source to my search routine, which is initiated by the user entering a value into an ENTRY-FIELD (value = SEARCH-VALUE) and pressing a push button.

What I would like to have happen, is that for each press of the push-button, the routine would find the next occurrence of the desired string. Instead it keeps coming to the first one. Boo....

I suspect that the solution is quite simple, but alas, so am I.

Thanks in advance for any insight.
After checking the serach result (RESULT-1) change the inquire statement to read

inquire Screen1-Gd-1, X in cur-row, Y in cur-col.

Help for Grid special properties reads:

SEARCH-TEXT (alphanumeric)
When you assign this property, the grid initiates a search using the current search options. The program looks for the value assigned to this property. The search starts in the cell identified by the X and Y properties unless overridden by the GRID-SEARCH-SKIP-CURRENT described under SEARCH-OPTIONS above. If the search is successful, then X and Y are updated to reflect the cell found.


This will update cur-row and cur-col to the successful search cell and the next search will start from the new position.

Hope this works.
Shaylesh

[Migrated content. Thread originally posted on 19 October 2005]

I need some insight as to why my grid search routine is finding the first occurrence of the desired string, and failing to find subsequent occurrences.

I have attached the source to my search routine, which is initiated by the user entering a value into an ENTRY-FIELD (value = SEARCH-VALUE) and pressing a push button.

What I would like to have happen, is that for each press of the push-button, the routine would find the next occurrence of the desired string. Instead it keeps coming to the first one. Boo....

I suspect that the solution is quite simple, but alas, so am I.

Thanks in advance for any insight.
Thanks very much for your assistance.

Regards,

Matt