Die erste Liste muß aber bereits als Text bestehen.
Code: Alles auswählen
Structure Born
Name.s
Day.s
Month.s
Year.s
MonthDay.l
EndStructure
NewList Born.Born()
Define.l File = ReadFile(#PB_Any, "geburtstag.txt")
Define.s temp, leer
If File
While Not Eof(File)
AddElement(Born())
temp = ReadString(File)
Born()\Name = Trim(StringField(temp, 1, ":"))
temp = Trim(StringField(temp, 2, ":"))
Born()\Day = StringField(temp, 1, ".")
Born()\Month = StringField(temp, 2, ".")
Born()\Year = StringField(temp, 3, ".")
Born()\MonthDay = ParseDate("%mm%dd", Born()\Month + Born()\Day)
Wend
CloseFile(File)
SortStructuredList(Born(), 2, OffsetOf(Born\Year), #PB_Sort_String)
ForEach Born()
With Born()
leer = Space(20 - Len(\Name))
Debug \Name + leer + " : " + \Day + "." + \Month + "." + \Year
EndWith
Next
Debug "" : Debug ""
SortStructuredList(Born(), 0, OffsetOf(Born\MonthDay), #PB_Sort_Long)
ForEach Born()
With Born()
Debug \Day + "." + \Month + " : " + \Name
EndWith
Next
EndIf
Ich hoffe, ich hab nicht zu viel geschreddert, macht Spaß