
prog
bt1 =1
func fimp(l)
Dialog 10,6,40,5 chars
style WS_POPUP DS_MODALFRAME WS_CAPTION WS_SYSMENU
caption "Escolha a Opção de Saída"
defpushbutton "Impressora" bt1 2,2,12,2;
valid fimp (bt1);
font("Arial Negrito",-08)
PushButton "Video" NULL 17,2,10,2;
valid fimp (bt1);
font("Arial Negrito",-08)
PushButton "Sair" NULL 29,2,10,2 IDOK ;
font("Arial Negrito",-08)
EndDialog
if bt1= 3
return
endif
return
**********************************************************************
func fimp
parameters bt1(n)
mess=MessageBox("Confirma impressao?","Tabela de Contratados:","YN","Q")
if mess = "N"
return .t.
endif
if bt1 = 1 && Foi Feita a Opção na Dialog de se direcionar a saída para Impressora
set print on PORTRAIT
else && Foi Feita a opção na Dialog de se direcionar a saída para Arquivo
set printer to "file:abc.txt"
endif
set print on
if bt1 = 1
xlin = -6631 && Medida em pixels( 1 char = -65 pixels) que ultrapassa a linha 66
else
xlin = 51
endif
xpag= 0
database Exemplo 1 a 2
select a
use Arq01
locate
do while .not. eof()
if bt1 = 1 && Foi Feita a Opcao na Dialog de se Direcionar a Saida Para Impressora
if xlin < -6630 && Medida em pixels( 1 char = -65 pixels) que equivale a linha 66
if xpag > 0
eject && Necessário Para se Mudar de Pagina(Quebra de Pagina)
endif
************
do CABECALHO with bt1,xpag
************
xlin = -715 **Equivale a linha 11(-65 X 11) onde será iniciada a impressão após o cabeçalho
endif
else && Impressão em tele
if xlin > 50
************
do CABECALHO with bt1,xpag
************
xlin = 06
endif
endif
wmat= ConMatric
wnome= ConNome
if bt1 = 1 && Saida na Impressora
Showtext(00,xlin,wmat,"Arial",-60,"B/R")
Showtext(08,xlin,wnome,"Arial",-60,"B/R")
else && Saida em Arquivo
@xlin,01 say wmat
@xlin,13 say wnome
endif
if bt1 = 1 && Saida na Impressora
xlin = xlin - 65 && equivale a acan‡o de linha ( xlin = xlin + 1)
else && Saida em Arquivo
++ xlin
endif
select a
continue
enddo
set print off
if bt1 = 2
run "c:\arquiv~1\acessó~1\wordpad.exe c:\OpusWin\ibge\abc.txt"
endif
return .t.
*********************
static proc CABECALHO
*********************
parameters bt1(n),xpag(n)
vardata = date()
varhora = time()
++ xpag
wpag= str(xpag,3)
if bt1 = 1
Showtext(01,01,"EMPRESA XPTO","Arial",-60,"B/R")
Showtext(25,01,"SISTEMA DE ADMINISTRAÇÃO DE PESSOAL","Arial",-60,"B/R")
Showtext(63,01,vardata,"Arial",-60,"B/R")
Showtext(70,01,varhora,"Arial",-60,"B/R")
Showtext(01,02,"EXEMPLO","Arial",-60,"B/R")
Showtext(20,02,"RELATóRIO DE FUNCIONARIOS","Courier",-70,"B/R")
Showtext(63,02,"PAG:","Arial",-60,"B/R")
Showtext(68,02,wpag,"Arial",-60,"B/R")
Showtext(00,05,"Matríula","Arial",-60,"B/R")
Showtext(08,05,"Nome","Arial",-60,"B/R")
else
@01,01 say "EMPRESA XPTO"
@01,20 say "SISTEMA DE ADMINISTRAÇÃO DE PESSOAL"
@01,63 say vardata
@01,74 say varhora + chr(13) + chr(10)
@02,01 say "EXEMPLO"
@02,20 say "RELATÓRIO DE FUNCIONARIOS"
@02,63 say "PAG:"
@02,74 say wpag + chr(13) + chr(10)
@05,01 say "Matrícula"
@05,13 say "Nome"
endif
return
