;** Exp_RTF ********************************************************************
;*  PROGRAMA P/ Converter Arquivo TXT para RTF                                 *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 11/11/2004 por Anivel Augusto Rodrigues
;Ultima Alteracao: 13/04/2006 por Anivel Augusto Rodrigues
;Motivo Alteracao: Ajustes
;Ultima Alteracao: 15/08/2007 por Anivel Augusto Rodrigues
;Motivo Alteracao: Ajustes Run

;** Rotina Principal ***********************************************************
ARQIMPRTF=DIREPORT+ARQUIVO+".RTF"
Copia_Arquivo("\\Sistemas\\Cadastro\\comando.rtf "+ARQIMPRTF)
NR = NRecords(DIRTEMP+ARQUIVO)
View DIRTEMP+ARQUIVO
Scan
  Barra(NR, RecNo())
  Aguarde("Aguarde, Gravando "+BARRA_STRING)

  VString=[Text]

  QuebraPagina=False
  IgnoraLinha =False
  If SubStr(VString,1,1)=Chr(27)
     Then If Search(Chr(12),VString)>0
             Then QuebraPagina=True
          EndIf
          IgnoraLinha=True
  EndIf

  If Not IgnoraLinha
     Then Print File ARQIMPRTF VString +"\\par"+"\n"
  EndIf

  If QuebraPagina And RecNo()<NR
     Then Print File ARQIMPRTF "\\page"+"\n"
  EndIf

EndScan
;;;;;Print File ARQIMPRTF " }}"+"\n"
FileWrite Append ARQIMPRTF From " }}"+"\n"
ClearImage

Release Vars QuebraPagina, IgnoraLina, ARQIMPRTF, Comando, VString
