Sorting a list of coordinate pairs by y-coordinate

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?

Comments

  • EggplantMattEggplantMatt ForumAdmin admin
    sort mylist by y of each
    

    SenseTalk recognizes (x,y) pairs as coordinates, so you automatically have an x and y value in items of this type.
  • ag47ag47 Member
    This did not work for me. The log entries from the run window are from the log commands in the code below. Looking to have (541,227) at the beginning of the list.

    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))
  • EggplantMattEggplantMatt ForumAdmin admin
    I think you must be on an older release of eggPlant Functional on Windows. There was a release where the sort function wasn't working. That is fixed in the current release.
Sign In or Register to comment.