Find Row number in which string is Available - Screen

Hi All,

We have a string “ABC TEST”, we need to find in which row in the mainframe screen the string is available ?

This is for Step in Applinx Path

Vamsi Krishna.V

Hi Vamsi

I suggest you use the following logic:
New object screenline(array)
New object foundline
Map Get Screen Buffer(Only Window) to screenline(+)
For each foreach_item in screenline where is (StrIn(foreach_item, StrLn(foreach_item),case sensitive)=”ABC TEST”

  • Map foreach_index to foundline

Note that if the text “ABC TEST” exists in more lines on the screen you will only get the last occurrence line number in foundline.

Best regards

Bjarne Sørensen

Hi Vamsi,

Although Bjarne’s solution is correct and should work for you, we recommend working with identified fields, in this case - multiple fields.
We don’t have all the information, but if you expect the string to be in one (or more?) instances of a multiple field and you just need to find out in which - there are easier ways.
We have an expression in the path procedure “Find Field Index”, please see attached screenshots (FindFieldIndex.png & FindFieldIndex_2.png). So, if you have a multiple field you can use this expression instead of looping over the whole screenbuffer to find it.
Of course, if the string can be anywhere on screen, and there’s no way of mapping it into a field, then Bjarne’s solution is the only way to go.

Hope this helps. Let us know :slight_smile: