# Find Row number in which string is Available - Screen

**URL:** <https://techcommunity.softwareag.com/t/find-row-number-in-which-string-is-available-screen/102478>\
**Category:** Forum\
**Tags:** Mainframe-Integration, ApplinX\
**Created:** [March 3, 2013, 6:18pm UTC](https://techcommunity.softwareag.com/t/find-row-number-in-which-string-is-available-screen/102478 "2013-03-03T18:18:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vamsi\_Krishna](https://avatars.discourse-cdn.com/v4/letter/v/a8b319/32.png) [@Vamsi\_Krishna](https://techcommunity.softwareag.com/u/Vamsi_Krishna)\
**Post date:** [March 3, 2013, 6:18pm UTC](https://techcommunity.softwareag.com/t/find-row-number-in-which-string-is-available-screen/102478/1 "2013-03-03T18:18:51Z")

</div>

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

Regards,  
Vamsi Krishna.V

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [March 4, 2013, 9:03am UTC](https://techcommunity.softwareag.com/t/find-row-number-in-which-string-is-available-screen/102478/2 "2013-03-04T09:03:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gadi](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/gadi/32/16051_2.png) [@Gadi](https://techcommunity.softwareag.com/u/Gadi)\
**Post date:** [March 4, 2013, 2:56pm UTC](https://techcommunity.softwareag.com/t/find-row-number-in-which-string-is-available-screen/102478/3 "2013-03-04T14:56:22Z")

</div>

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 🙂

Regards,  
Gadi

![FindFieldIndex_2.png](https://global.discourse-cdn.com/techcommunity/original/2X/3/3272d3b4ca5046a713e05727dc29e813341fd0ee.png)

 ![FindFieldIndex.png](https://global.discourse-cdn.com/techcommunity/original/2X/4/4dc3acdcbe3e4bdb1dec57bd760bc4ca2edb55fc.png)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:02pm UTC](https://techcommunity.softwareag.com/t/find-row-number-in-which-string-is-available-screen/102478/4 "2021-04-02T15:02:57Z")

</div>

Closed on April 2, 2021, 3:02pm UTC


