Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

GroupSort - Sort (arrange) multiple inter-related lists together


  • Please log in to reply
4 replies to this topic
A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Helpful Links - The Sort Command

GroupSort is a class-based lib to sort (arrange, alphabetize) multiple inter-related lists together using one of them as the base and others as it's properties. It's facilities & params are same as Sort command. Since there was no other alternative available other than using a hidden Listview which will be very limited in features, I have created this.
 
GroupSort requires transferring lists separated by some common delimiter in an Object to the function.
So, you feed something like [ parentlist, proplist1, proplist2, proplist3....] to the class __New function and it returns you the Sorted lists based on the parent list ( which essentially should have an Index 1 in the Array ) in the below mentioned ways .
 
To return data in String form, you can use  Fetch method while to return data in Object form, you can use Sort method.

 

See comments in the code to know more......

 
Example

names =
(
avi
kshitij
prasun
doctor
)

subjects =
(
comp
phe
bio_bad
bio_good
)

places =
(
r nag
b sam
b rod
b nat
)

Obj := [names, subjects, places]		;make a object
Options := "U D`n"   ;Sort / GroupSort options

students := new GroupSort(Obj, Options)		;create a GroupSort object
msgbox % students.fetch("1,2") "`n`n" students.fetch(3)		;Using fetch() , strings
                                                        ;1,2 denote the columns

retobj := students.Sort() 		;Using Sort() , returns sorted thing in object (same like the way in which it was inserted)
for k,v in retobj
	x .= v "`n`n"            ;get each value stored in the object
msgbox % x

#Include GroupSort.ahk

The example is also included in GroupSort examples-based informative script (link below)

 

P.S.

  • A docu/manual will be released later.
  • Find bugs (likely as it is the first version), please report !

 

DOWNLOAD

Example file


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


gunner
  • Members
  • 79 posts
  • Last active: Aug 11 2013 11:18 AM
  • Joined: 05 Jun 2013

will be greatt if it is what you say,

i have lists with book names, their authors, their dates, their costs and some 10 more items....

will it help me to arrange them in order without loosing or missing data.

 

btw, i will try and report u ltr. thanks for this class



A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

will be greatt if it is what you say,
i have lists with book names, their authors, their dates, their costs and some 10 more items....
will it help me to arrange them in order without loosing or missing data.
 
btw, i will try and report u ltr. thanks for this class

You can do that, definitely.

One point, remember to use Stringreplace to convert all `r`n to `n before transferring lists into the Object, specially if you are not looking to add the delimiter option in the Options param.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


gunner
  • Members
  • 79 posts
  • Last active: Aug 11 2013 11:18 AM
  • Joined: 05 Jun 2013

yup, it works. WOW

amazing !

thanks !

 

i forgot `r`n but then i saw it in the help ifle.



A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

yup, it works. WOW
amazing !
thanks !
 
i forgot `r`n but then i saw it in the help ifle.

Glad you find it helpful grin.png

Always feel free to ask if you have problems.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan