// // (C) C.Z. 25.10.1995 // 13.06.1997 // 01.03.1999 // 14.10.2001 V+6 // // Eingabedatei: Zeile mit Datumstring "JJJJMMTT" // // Funktion: Datum um einen Tag hochz„hlen // // // Achtung: Schaltjahre sind evtl. noch nicht komplett bercksichtigt !!! // insbesondere nur 20.Jahrhundert! //13.05.1997 8:27:09 BeginOfFile #99=BN OR(103) Date(NOCR+NOMSG) OR(CLEAR) BS(XBUF1) BY(OK) RI(103) BOF R("-","",ALL) // 05-13-1997 -->> 05131997 RCB(103,4,8) // 1997 RCB(103,0,2,APPEND) // 05 RCB(103,2,4,APPEND) // 13 BS(#99) //RI(103) //? if (match("|@(103)") == 0){ qally exit(1) } Goto_Col(7) // Tag ermitteln #1=Num_Eval() Del_Char(2) Goto_Col(5) #2=Num_Eval() // Monat ermitteln Del_Char(2) Goto_Col(1) #3=Num_Eval() // Jahr ermitteln Del_Char(4) // => Eingabestring ist jetzt leer // Ermittlung, ob Schaltjahr: #4=0 if ( (#3 & 3) == 0) {#4=1} // Schaltjahr // Ermittlung der Monatsl„nge: if (#2==4 || #2==6 || #2==9 || #2==11) { #5=30 } else { if (#2==2) { #5=28 + #4 // evtl. Schalttag dazu } else { #5=31 } } // Datum hochz„hlen: if (#1 < #5) { #1+=1 } else { #1=1 // 1. Tag des Monats if (#2<12) { #2+=1 // und Monatswechsel } else { #2=1 // bzw. Januar #3+=1 // und Jahreswechsel } } // Datumsstring aufbereiten: BeginOfFile if (#3<10) { Ins_Text("0") } Num_Ins(#3,LEFT+NOCR) if (#2<10) { Ins_Text("0") } Num_Ins(#2,LEFT+NOCR) if (#1<10) { Ins_Text("0") } Num_Ins(#1,LEFT+NOCR) filesave(ALL) BOF if (match("|@(103)") == 0){ exit(1) } else { exit(0) }