;
; Test-Tool
;
sy$="$VER: Bezugsdatum 1.0 (21.11.1997)" : cr$=Chr$(13)+Chr$(10)

Function$ gdate{} ; aktuelles Datum
  b$=Replace$(Date$(SystemDate),"/",".") : Format "00" : b$+" "+Str$(Hours)+":"+Str$(Mins)+":"+Str$(Secs) : Format""
  Function Return b$
End Function

Function.l setDate{datum$} ; ---- Zeit ins Martin-Brckner-Format wandeln--
  jahr.l=(Val(Mid$(datum$,7,4))-1980) : monat.l=Val(Mid$(datum$,4,2))
  tag.l=Val(Left$(datum$,2)) : stunde.l=Val(Mid$(datum$,12,2))
  minute.l=Val(Mid$(datum$,15,2)) : sekunde.l=Val(Mid$(datum$,18,2))
  da.l=(jahr.l LSL 26)+(monat.l LSL 22)+(tag.l LSL 17)+(stunde.l LSL 12)+(minute.l LSL 6)+sekunde.l
  Function Return da.l
End Function

Function$ hdate{} ; aktuelles Datum
  b$=Replace$(Date$(SystemDate),"/","-") : Format "00" : b$+" "+Str$(Hours)+":"+Str$(Mins)+":"+Str$(Secs) : Format""
  Function Return b$
End Function

Statement front{l.l,ty$}
  DefaultOutput : NPrint "HTTP/1.0 200 OK"
  NPrint "Server: EBLwebServer/1.0" : d$=gdate{}
  NPrint "Date: "+d$
  NPrint "Last-modified: "+d$
  NPrint "Accept-ranges: bytes"
  ;NPrint "Content-length: "+Str$(l.l)
  NPrint "Content-type: "+ty$
  NPrint ""
End Function



CaseSense Off
If NumPars<1
  a$="<PRE>Error: Fehlerhafter Aufruf!"
Else
  If NumPars=1 Then d$=hdate{} : Else d$=Par$(2)
  d$=Mid$(d$,Instr(d$,"=")+1)
  d$=Replace$(d$,"%3A",":") :d$=Replace$(d$,"%2D","-") : d$=Replace$(d$,"%2E",".") : d$=Replace$(d$,"+"," ")
  d.l=setDate{d$} : a$="prometheus:user/"+Par$(1)+"/"+Chr$(176)+"dat"
  If ReadFile(1,a$)
    If WriteFile(2,a$+"2")
      FileInput 1 : FileOutput 2
      For i.w=1 To 13 : NPrint Edit$(100) : Next i
      b$=Inkey$(Cvi(Inkey$(2))) : b$=Left$(b$,86)+Mkl$(setDate{d$})+Mid$(b$,91) : NPrint Mki$(Len(b$))+b$+Edit$(500)
      CloseFile 2
    EndIf
    CloseFile 1 : KillFile a$ : NameFile a$+"2",a$
  EndIf
EndIf

a$=""
If ReadFile(1,"env:EBLbezug")
  FileInput 1 : le$=Edit$(500) : CloseFile 1
EndIf
If ReadFile(1,le$)
  FileInput 1 : a$=Inkey$(Lof(1))
EndIf

a$=Replace$(a$,"{$bezug}",d$)
CaseSense On

front{Len(a$),"text/html"} : Print a$

End
