Sort by Custom Property

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Brittgriscom
Posts: 95
Joined: Wed Mar 30, 2011 10:15 am

Sort by Custom Property

Post by Brittgriscom » Mon May 09, 2011 7:16 pm

I am trying to sort buttons numerically according to the value of a custom property. How do I do that?

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Sort by Custom Property

Post by jmburnod » Mon May 09, 2011 8:55 pm

Hi,
1. Building a list with 2 items in each lines : NumberOfBtn,CustomProp
2. Sort the list by item 2
And you have a list sorted by the CustomProp of the btns
Correct ?
Best

Jean-Marc
https://alternatic.ch

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Sort by Custom Property

Post by dunbarx » Tue May 10, 2011 4:17 am

Sort buttons? I do not understand what you mean. Sort the layers? Please write back.

Craig Newman

Brittgriscom
Posts: 95
Joined: Wed Mar 30, 2011 10:15 am

Re: Sort by Custom Property

Post by Brittgriscom » Sun May 15, 2011 3:04 am

I am experimenting with the A Star algorithm in the 8-puzzle game explained in the lessons.
What I called buttons are really nodes that the algorithm travels on.

I was trying to sort them according to their F-cost, and I ended up with a solution just like the one above.

Post Reply