# Sorting a list of coordinate pairs by y-coordinate

ag47
Member

Hi!

I am attempting to combine two sets of results (coordinate pairs) of the everyImageLocation() function.

I get to the point where I have a single list with these contents:

((787,365),(787,463),(787,512),(787,560),(787,609),(787,658),(787,295),(787,414))

I've combed through the documentation on sorting and using "each", but I have still not been able to get the correct syntax for sorting each of the coordinate pairs, ascending, by their y-coordinate. The item (787,295) should be first in the list, etc.

Any ideas?

I am attempting to combine two sets of results (coordinate pairs) of the everyImageLocation() function.

I get to the point where I have a single list with these contents:

((787,365),(787,463),(787,512),(787,560),(787,609),(787,658),(787,295),(787,414))

I've combed through the documentation on sorting and using "each", but I have still not been able to get the correct syntax for sorting each of the coordinate pairs, ascending, by their y-coordinate. The item (787,295) should be first in the list, etc.

Any ideas?

0

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

## Quick Links

#### Categories

- 2.8K All Categories
- 52 Products
- 2 Eggplant AI
- 2K Eggplant Functional
- 17 Eggplant Performance
- Eggplant Automation Cloud
- 2 Eggplant Manager
- Eggplant Network
- 1 Eggplant Integrations
- 1 Ecosystem
- 13 Industries
- Automotive
- 1 Defense & Aerospace
- Enterprise
- Financial Services
- 10 Healthcare & Life Sciences
- 1 Retail
- 1 Telecom & Media
- 2.7K TestPlant
- 21 Other TestPlant Products
- 2 QA and Testing
- 40 eggPlant Examples
- 745 Vine
- 11 Targeted Topics
- 11 Testing Epic Implementations

## Comments

SenseTalk recognizes (x,y) pairs as coordinates, so you automatically have an x and y value in items of this type.

log boxList

sort boxList by y of each

log boxList

4/25/17, 3:35:31 PM Log ((540,297),(540,346),(540,395),(540,492),(540,541),(540,590),(541,227),(541,444))

4/25/17, 3:35:31 PM Log ((540,297),(540,346),(540,395),(540,492),(540,541),(540,590),(541,227),(541,444))