Hi, I want to sort an Array of Arrays as Variant[][] that may contain different datatypes in each member of an array but the arrays are all homogenous (think of a Database, it's not the actual subject but the same idea). That's what I thought of:
- Write a class that Inherits Variant[] (that will act as the Array containing Variant[], so I could also Inherits Object[]?) - Create a Sort() method for that class that takes an integer N for the member to sort by (Variant[][N]) (When Inherits Object[], I get error messages on incorrectly overriding Object[].Sort(). The parameter?) - Call qsort(Super.Data, Super.Count, SizeOf(gb.Pointer), MyCompare) -- _Right?_ - MyCompare consequently takes two Pointers. How may I treat them as being references to Variant[]? Any casts possible? After that, it would be easy to use TypeOf(Variant[][N]) and call a datatype-specific routine to compare the two values. I tried to Private Sub MyCompare(V1 As Variant[], V2 As Variant[]) and got a Segfault after one line of wrong results when, in MyCompare, Print V1[0], V1[1] which are valid. Regards, Tobi ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user