Código: Selecionar todos
*--------------------------------------------*
* PROGRAMA : cli01.prg *
* AUTOR : Everaldo Bernardo Cunha *
* DATA : 16/02/2016 *
* FINALIDADE : Cadastrar clientes *
*--------------------------------------------*
use clientes
OrdSetFocus("indcli01")
public mem_cod, mem_nome, mem_nasc, mem_sexo, mem_cid, mem_end
public mem_cep, mem_fone, mem_cpf, mem_prof, mem_ec, mem_obs
public confirma
do while .t.
setcolor("w/b")
clear screen
quadro(1,1,40,140)
@ 03,30 say " INCLUSAO DE NOVOS CLIENTES"
@ 04,30 say " ======== == ===== ========"
@ 06,30 say "Codigo..........:"
@ 08,30 say "Nome............:"
@ 10,30 say "Dt. Nasc. ......:"
@ 12,30 say "Sexo............:"
@ 14,30 say "Estado Civil....:"
@ 16,30 say "Endereco........:"
@ 18,30 say "CEP.............:"
@ 20,30 say "Cidade..........:"
@ 22,30 say "Estado..........:"
@ 24,30 say "Telefone........:"
@ 26,30 say "CPF.............:"
@ 28,30 say "Profissao.......:"
@ 30,30 say "Observacao......:"
@ 32,30 say "CONFIRMA? (S/N) :"
mem_cod = 0000
mem_nome = space(30)
mem_nasc = ctod(" / / ")
mem_sexo = space(01)
mem_end = space(35)
mem_cid = space(35)
mem_cep = space(10)
mem_uf = space(02)
mem_fone = space(14)
mem_cpf = space(14)
mem_prof = space(20)
mem_ec = space(01)
mem_obs = space(50)
confirma = space(01)
@ 06,49 say mem_cod pict "9999"
@ 08,49 say mem_nome pict "@!30"
@ 10,49 say mem_nasc pict " / / "
@ 12,49 say mem_sexo pict "!"
@ 14,49 say mem_ec pict "!"
@ 16,49 say mem_end pict "@!35"
@ 18,49 say mem_cep pict "99.999-999"
@ 20,49 say mem_cid pict "@!20"
@ 22,49 say mem_uf pict "!!"
@ 24,49 say mem_fone pict "(99) 9999-9999"
@ 26,49 say mem_cpf pict "999.999.999-99"
@ 28,49 say mem_prof pict "@!20"
@ 30,49 say mem_obs pict "@!50"
@ 32,49 say confirma pict "!"
@ 06,49 get mem_cod pict "9999"
read
if mem_cod = 9999
exit
endif
locate for cod = mem_cod
if found()
enter = space(01)
@ 35,49 say "Mensagem: Cliente ja cadastrado. Pressione <ENTER> " get enter
read
@ 35,49 say " "
loop
endif
@ 06,49 get mem_cod pict "9999"
@ 08,49 get mem_nome pict "@!30"
@ 10,49 get mem_nasc pict " / / "
@ 12,49 get mem_sexo pict "!"
@ 14,49 get mem_ec pict "!"
@ 16,49 get mem_end pict "@!35"
@ 18,49 get mem_cep pict "99.999-999"
@ 20,49 get mem_cid pict "@!20"
@ 22,49 get mem_uf pict "!!"
@ 24,49 get mem_fone pict "(99) 9999-9999"
@ 26,49 get mem_cpf pict "999.999.999-99"
@ 28,49 get mem_prof pict "@!20"
@ 30,49 get mem_obs pict "@!50"
@ 32,49 get confirma pict "!"
read
if confirma = "S"
append blank
replace cod with mem_cod
replace nome with mem_nome
replace nasc with mem_nasc
replace sexo with mem_sexo
replace ec with mem_ec
replace end with mem_end
replace cep with mem_cep
replace cid with mem_cid
replace uf with mem_uf
replace fone with mem_fone
replace cpf with mem_cpf
replace prof with mem_prof
replace obs with mem_obs
endif
enddo
close all
return nil
Everaldo
P.S.: pergunta ao moderador: como eu coloco a palavra [RESOLVIDO] para que saibam que o mesmo o fora?


