estou fazendo da seguinte maneira
ex:
Código: Selecionar todos
LINHA:=0
SET PRINTER TO TEXTO.TXT
SET DEVICE TO PRINT
DO WHILE ! EOF()
@LINHA,00 SAY "BLA BLA BLA"
LINHA++
SKIP
ENDDO
SET PRINTER TO
SET DEVICE TO SCREEN
Moderador: Moderadores

Código: Selecionar todos
LINHA:=0
SET PRINTER TO TEXTO.TXT
SET DEVICE TO PRINT
DO WHILE ! EOF()
@LINHA,00 SAY "BLA BLA BLA"
LINHA++
SKIP
ENDDO
SET PRINTER TO
SET DEVICE TO SCREEN

Código: Selecionar todos
nFhandle:= Fcreate( 'teste.txt', 0 )
If nFhandle < 4
Alert("Nao foi possivel gerar arquivo !")
Return
Endif
FWriteLine( nFhandle,"Primeira linha" )
FWriteLine( nFhandle,"Segunda linha" )
FWriteLine( nFhandle,"E assim por diante..." )
Fclose( nFhandle )
Static Function FWriteLine( nHandle, cString )
Fwrite( nHandle, cString )
Fwrite( nHandle, Chr(13) )
Fwrite( nHandle, Chr(10) )
Return Nil

Bem lembrado ! Essa é uma solução para o atual problema, com certeza ! Mas mesmo assim fica muito mais certo fazer com funções de baixo nível.coloque um SEPRC(0,0)


Não sabia que precisaria tanto. Mas se você ainda quiser testar com a função. Veja que existe o terceiro parâmetro que pode ser definido na função FWRITE. Veja o que diz o manual:criei uma string chamada
linha:=space(1500)
porem quando vou passar a mesma
ela so coube 437
Colocando o terceiro parâmetro na hora de gravar, deve resolver: Fwrite( nHandle, cString,1500)FWRITE( <nHandle>, <cBuffer>, [<nBytes>] ) --> nBytesWritten
Arguments
<nHandle> DOS file handle number.
<cBuffer> Character expression to be written.
<nBytes> The number of bytes to write.
Returns
<nBytesWritten> the number of bytes successfully written.
Description
This function writes the contents of <cBuffer> to the file designated by its file handle <nHandle>. If used, <nBytes> is the number of bytes in <cBuffer> to write.
The returned value is the number of bytes successfully written to the DOS file. If the returned value is 0, an error has occurred (unless this is intended). A successful write occurs when the number returned by FWRITE() is equal to either LEN( <cBuffer>) or <nBytes>.
The value of <cBuffer> is the string or variable to be written to the open DOS file <nHandle>.
The value of <nBytes> is the number of bytes to write out to the file. The disk write begins with the current file position in <nHandle>. If this variable is not used, the entire contents of <cBuffer> is written to the file. To truncate a file. a call of FWRITE( nHandle, "", 0 ) is needed.
Examples
nHandle:=FCREATE('x.txt')
FOR X:=1 to 10
FWRITE(nHandle,STR(x))
NEXT
FCLOSE(nHandle)
Status
Ready
Compliance
This function is not CA-Clipper compatile since it can writes strings greather the 64K
Files
Library is rtl
