kleine Spielerei mit StructureUnion und Datum zerlegen
Verfasst: 26.04.2008 18:00
Finde ich irgendwie eleganter als ein Datum mit MID zu zerlegen.
PS: Kann man natürlich auch für andere Strings umbauen
Code: Alles auswählen
Structure datum1
tag.s{2}
pk1.s{1}
mon.s{2}
pk2.s{1}
jahr.s{4}
EndStructure
Structure datum2
StructureUnion
s.s{10}
d.datum1
EndStructureUnion
EndStructure
Dim d1.datum2(5)
d1(0)\s="05.04.2008"
d1(1)\s="07.05.2009"
Debug d1(0)\d\tag
Debug d1(0)\d\mon
Debug d1(0)\d\jahr
Debug "---"
Debug d1(1)\d\tag
Debug d1(1)\d\mon
Debug d1(1)\d\jahr
Debug "---"
d2.datum2\s="15.11.2010"
Debug d2\d\tag
Debug d2\d\mon
Debug d2\d\jahr
Debug "---"