REM f:\freebasic\fbc e:\in.bas
#include "vbcompat.bi"
print "Auxiliar de consulta para os arquivos PDF da Imprensa Nacional - V1.00.20080224"
print "Autoria: Luis Olavo Dantas - luis@dantas.com"
print "http://www.dantas.com/imprensanacional"
print
p$=""
40 input "Caminho de gravacao (entre pelo menos com a letra da unidade de disco)";p$
if len(p$)=1 then if p$>="a" then if p$<="z" then p$=chr$(asc(p$)+asc("A")-asc("a"))
if len(p$)=1 then p$=p$+":\"
if p$<"A:\" goto 40
if p$>"Z:\" goto 40
if p$="" then p$="d:\"
if mid$(p$,2,2)<>":\" then print "O caminho tem de ser válido (p.ex., d:\teste)":goto 40
if right$(p$,1)<>"\" then p$=p$+"\"
print
print "Caminho -> ";p$
print
10 input "Dia (99)";d$
d$=right$("00"+d$,2)
if d$>"32" goto 10
if d$<"01" goto 10
20 input "Mes (99)";c$
c$=right$("00"+c$,2)
if c$>"12" goto 20
if c$<"01" goto 20
30 input "Ano (9999)";b$
b$=right$("2000"+b$,4)
if b$<="2005" goto 30
if b$>"2010" goto 30
print "Data -> ";d$;"/";c$;"/";b$
print
input "Pagina (deixe em branco para a primeira)";pg$
if pg$="" then pg$="1"
k1$="Diários da Imprensa Nacional para ";d$;"-";c$;"-";b$;"
"
for d1=1 to 2
if d1=1 then f$="j"
if d1=2 then f$="o"
for s=1 to 3
if d1=1 then if s>1 then if b$>"2007" goto 50
print #1,k1$;d$;"/";c$;"/";b$;"&jornal=d";f$;"&segedicao=&secao=";chr$(48+s);"&pagina=";pg$;">"
if d1=1 then print #1,"Diário da Justiça, ";
if d1=2 then print #1,"Diário Oficial da União, ";
print #1,"Seção ";chr$(48+s);", Página ";pg$;
print #1,"
"
50 next s
next d1
print #1, "
DJ Seção 1 de ";c$;"/";b$;" | ";
if i=2 then print #1,"|
|---|---|
DJ Seção 2 de ";c$;"/";b$;" | ";
if i=3 then print #1,"|
DJ Seção 3 de ";c$;"/";b$;" | ";
if i=4 then print #1,"|
DOU Seção 1 de ";c$;"/";b$;" | ";
if i=5 then print #1,"|
DOU Seção 2 de ";c$;"/";b$;" | ";
if i=6 then print #1,"|
DOU Seção 3 de ";c$;"/";b$;" | ";
for j=1001 to 1031
k=dateserial(val(b$),val(c$),j-1000)
k=weekday(k)
if j>1028 then if c$="02" then if b$<>"2008" then goto 110
if j>1029 then if c$="02" then goto 110
if j>1030 then if (c$="04") or (c$="06") or (c$="09") or (c$="11") then goto 110
print #1,""; if k<2 goto 105 if k>6 goto 105 print #1,k1$;right$(str$(j),2);"/";c$;"/";b$;"&jornal=d"; if i<4 then print #1,"j"; if i>3 then print #1,"o"; print #1, "&segedicao=&secao="; if i=1 then print #1, "1"; if i=2 then print #1, "2"; if i=3 then print #1, "3"; if i=4 then print #1, "1"; if i=5 then print #1, "2"; if i=6 then print #1, "3"; print #1,"&pagina=1>"; 105 print #1,str$(j-1000); if k>=2 then if k<=6 then print #1,""; print #1," | " 110 next print #1, "