Jump to content
Fivewin Brasil

arquivo txt 1


Vitor Reis

Recommended Posts

pessoal

preciso criar um arquivo txt sem caracter de fim de pagina.

usando o fcreate() fwrite() fopen dá certo, porem nao consegui passar pra linha de baixo.... tudo que mando para arq.txt fica na mesma linha... olhe o que fiz...

#include "Fileio.ch"

IF (nHandle := FCREATE("teste.txt", FC_NORMAL)) = -1

FERROR()

BREAK

ELSE

FWRITE(nHandle, "Linha 1")

FWRITE(nHandle, "Linha 2")

FCLOSE(nHandle)

ENDIF

onde eu estou errando???

Link to comment
Share on other sites

Olá,

Faltou incluir o controle de fim de linha: chr(13)+chr(10).

Ficaria assim:

#include "Fileio.ch"

#define CR_LF Chr(13) + Chr(10)

IF (nHandle := FCREATE("teste.txt", FC_NORMAL)) = -1

FERROR()

BREAK

ELSE

FWRITE(nHandle, "Linha 1"+CR_LF)

FWRITE(nHandle, "Linha 2"+CR_LF)

FCLOSE(nHandle)

ENDIF

[]s,

Evandro G. de Paula

Curvelo - MG

evandro@skillnet.com.br (Escr. - na Cidade)

imortal@skillnet.com.br (Res. - na Roça)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...