zxtela := SaveScreen(0,0,24,79)
znappend := 0
znupdate := 0
Janela(06,30,20,76,"Atualizacao de Cadastro")
DevPos(08,32);DevOut("Capturando Cadastro vb_ass.dbf")
zcmdline := lower("/siga/exe/sshass")
__run( zcmdline )
RestScreen(0,0,24,79,zxtela)
janela(06,30,20,76,"Atualizacao de Cadastro")
DevPos(08,32);DevOut("Processando Cadastro vb_ass   ")
DevPos(10,32);DevOut("Inclusoes no Cadastro...:"+Str(znappend,6))
DevPos(12,32);DevOut("Atualizacoes no Cadastro:"+Str(znupdate,6))
dbUseArea( .t.,,"/siga/tmp/ass", "ass", .f., .f. )
Abra ('0',r_siga,"vb_ass",'VB_ASS', 'VB_ASSM', 'Str(cr_cod_cli,6)+str(matricula,7)', 'VB_ASSN', 'nome')
init_vars(1,"zz")
zmfcli := 580
DbSelectArea("ass")
while .not. eof()
   zmatric  := matricula
   zfgfound := vb_ass->( DbSeek( Str(zmfcli,6)+str(zmatric,7) ))
   if .not. zfgfound
      znappend := znappend + 1
      DevPos(10,57);DevOut(Str(znappend,6))
      init_vars(2,"zz")
      zzcr_limite := 0
      zzcr_cod_cli := 580
      DbSelectArea("vb_ass")
      appendblank()
      troca("zz")
      DbSelectArea("ass")
   else
      znupdate := znupdate + 1
      DevPos(12,57);DevOut(Str(znupdate,6))
   endif
   DbSkip()
Enddo
DbCloseAll()
DevPos(16,32);DevOut("Processamento Concluido...")
DevPos(17,32);DevOut("Tecle Algo...")
inkey(0)
RestScreen(0,0,24,79,zxtela)