[Gambas-user] Sorting 2D arrays

Fabien Bodard gambas.fr at gmail.com
Mon Aug 24 15:30:10 CEST 2020


Also you have this thing interesting  :

Public MyValue as String Use $MyValue


That replace your stuff

Public MyValue as String
Private $MyValue

Public Sub MyValue_Read()
Return $MyValue
End

Public Sub MyValue_Write(Value as String)
  $MyValue = Value
End

the same in One only Line, But in the case of a bidimentionnal array
I'm not sur it is so mandatory.




Le lun. 24 août 2020 à 14:52, Gianluigi <bagonergi at gmail.com> a écrit :
>
>
>
> Il giorno lun 24 ago 2020 alle ore 14:34 Fabien Bodard <gambas.fr at gmail.com> ha scritto:
>>
>> Arf..
>>
>> make a class
>>
>> 'Class CEpisode
>> Static Public SortMode As Integer
>> Public Enum bySeriesName, byEpisodeName, byEpisodeNumber '... etc
>>
>> Public SeriesName As String
>> Public EpisodeName As String
>> Public EpisodeNumber As Integer
>> Public EpisodeDescription As String
>> Public EpisodeDatePublished As String
>> Public EpisodeIdentifier As String
>> Public SeriesDescription As String
>>
>> Public Sub _Compare(Other As CEpisode) As Integer
>>
>>   Select Case SortMode
>>     Case bySerieName
>>       Return Comp(Me.SeriesName, Other.SeriesName)
>>     Case ByEpisodeName
>>       Return Comp(Me.EpisodeName, Other.EpisodeName)
>>     Case ByEpisodNumber
>>       If Me.EpisodeNumber < Other.EpisodeNumber Then Return -1
>>       If Me.EpisodeNumber < Other.EpisodeNumber Then Return 1
>>       Return
>>
>>
>>       'etc...
>>
>>   End Select
>>
>> End
>
>
> Hi Fabien,
>
> it's true I should have used enumerators, but other than that my class is nicer :-P
>
> ;-D
>
> Ciao e viva il Cognac!
> Gianluigi
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----



-- 
Fabien Bodard


More information about the User mailing list