Páginas filhas
  • LOG_file_readln

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Nota
titleAtenção

Atente para o tamanho definido para a variável 4GL do tipo CHAR ou VARCHAR que receber o retorno da função LOG_file_readln(), para que tenha um tamanho que comporte todo o conteúdo da linha do arquivo.

Exemplo

Bloco de código
languageruby
themeConfluence
linenumberstrue
#---------------------------------------#
 FUNCTION LOG_fileReadLn_test()
#---------------------------------------#
  DEFINE l_file   CHAR(250)
  DEFINE l_handle SMALLINT
  DEFINE l_text   VARCHAR(1000)

  LET l_file = "c:\\temp\\arquivo1.txt"

  LET l_handle = LOG_file_open(l_file,0)
  IF l_handle >= 0 THEN
     LET l_text = LOG_file_readln(l_handle)
     WHILE l_text IS NOT NULL 
         CALL conout("Conteúdo da linha do arquivo: ["||l_text||"]")
         LET l_text = LOG_file_readln(l_handle)
     END WHILE
     LET l_handle = LOG_file_close(l_handle)
  END IF
END FUNCTION

...