Forum Replies Created
- 
		AuthorPosts
 - 
		
			
				
Thanks Mark, at least I tried
Thanks, so back to my sort and making life easier, I got this:
Monkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091#Import "<std>"Using std..Struct PersonField name:StringField age:StringField height:StringField weight:StringEndFunction ComparePersons:int(x:Person,y:Person)Return x.name<=>y.nameEnd FunctionFunction Main()Local per_list:= New List<Person>Local per:Person = New PersonPrint "---"per.name = "Aab"per.age = "45"per.height = "9"per.weight = "160"per_list.AddLast(per)per.name = "Elin"per.age = "45"per.height = "6"per.weight = "145"per_list.AddLast(per)per.name = "Sam"per.age = "75"per.height = "7"per.weight = "163"per_list.AddLast(per)per.name = "Aab"per.age = "45"per.height = "9"per.weight = "132"per_list.AddLast(per)per.name = "Sam"per.age = "45"per.height = "4"per.weight = "200"per_list.AddLast(per)per.name = "Elin"per.age = "15"per.height = "6"per.weight = "120"per_list.AddLast(per)per.name = "Aab"per.age = "15"per.height = "6"per.weight = "167"per_list.AddLast(per)per.name = "Sam"per.age = "75"per.height = "4"per.weight = "116"per_list.AddLast(per)For Local p := Eachin per_listPrint p.name + "," + p.age + "," + p.height + "," + p.weightNextLocal x:PersonLocal y:Personper_list.Sort(ComparePersons(x, y) )per_list.Sort(true)Print "--"For Local t:=Eachin per_listPrint t.name + "," + t.age + "," + t.height + "," + t.weightNextEndWhich prints:
Monkey12345678910111213141516171819---Aab,45,9,132Elin,45,6,145Sam,75,7,163Aab,45,9,160Sam,45,4,200Elin,15,6,120Aab,15,6,167Sam,75,4,116--Aab,15,6,167Aab,45,9,132Aab,45,9,160Elin,15,6,120Elin,45,6,145Sam,45,4,200Sam,75,4,116Sam,75,7,163Next stage?
a csvReader which I should figure out without readLine()
Thanks for the help!
How about this:
Monkey1Method Sort:Void( compareFunc:Int( T,T ) )in the manual, rather than a kind of IComapre? Will play with that for a while, then I will go back to the link.
I went through all examples in this weekend, very helpful for those who know BlitzMax, very helpful for beginners also. Thanks!
 - 
		AuthorPosts