#INCLUDE "c:\qb\bib\inl.bi" #INCLUDE "c:\qb\kconst.bi" FUNCTION PBMAIN() DIM i AS INTEGER DIM k AS INTEGER DIM j AS SINGLE DIM m AS INTEGER DIM be AS INTEGER OPEN ENVIRON$("CGI_STDOUT") FOR OUTPUT AS #3 ' OPEN "c:\debug.txt" FOR OUTPUT AS #1 ' PRINT #1, ENVIRON$("CGI_STDOUT") ' CLOSE #1 a$ = ENVIRON$("QUERY_STRING") fil$ = RIGHT$(a$, 1) m = VAL(fil$) k = LEN(a$) = 1 i = VAL(LEFT$(a$, 1)) * 5 be = i IF fil$ = TRIM$(getini($ini, "dagg")) THEN fil$ = "f:\log.log" ELSE a$ = DIR$("c:\qb\log\" + RIGHT$(a$, 1) + "*.log") IF LEN(a$) = 0 THEN GOTO einde END IF fil$ = "c:\qb\log\" + a$ END IF OPEN fil$ FOR INPUT ACCESS READ LOCK SHARED AS #1 IF ERR THEN GOTO einde END IF WHILE NOT EOF(1) LINE INPUT #1, a$ IF be THEN be = 0 PRINT #3, "document.write(" $DQ "" MID$(a$, 14) "" $DQ ");" ELSE b$ = MID$(a$, 14, 1) IF b$ = "0" OR VAL(b$) > 0 THEN IF k THEN ' argument 1 byte PRINT #3, "f(" FORMAT$(VAL(LEFT$(a$, 2)) * 60 + VAL(MID$(a$, 4, 2)) + 20) ","; IF m THEN ' stand kleppen/circ/brander PRINT #3, FORMAT$(VAL(MID$(a$, 7, 1))*3) ","; PRINT #3, FORMAT$(VAL(MID$(a$, 8, 1))*3) ","; PRINT #3, FORMAT$(VAL(MID$(a$,12, 1))*6) ","; PRINT #3, FORMAT$(VAL(MID$(a$, 9, 1))*2) ","; PRINT #3, FORMAT$(VAL(MID$(a$,10, 1))*3) ","; PRINT #3, MID$(a$,14, 1) ");"; ELSE ' week: aantal metingen PRINT #3, MID$(a$,14, 1) ");"; END IF ELSE j = VAL(MID$(a$, i + 16, 5)) j = 601 - IIF(i = 15, j * 7.5, (j - 5) * 30) PRINT #3, "b(" FORMAT$(VAL(LEFT$(a$, 2)) * 60 + VAL(MID$(a$, 4, 2)) + 20) "," FORMAT$(j, "0") ");" END IF END IF END IF WEND EXIT FUNCTION einde: PRINT #3, "Fout " ERR END FUNCTION