Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carriage Return, Line Feed with STRTOFILE

Status
Not open for further replies.

ggrewe

IS-IT--Management
Jul 10, 2001
169
US
I am using STRTOFILE to write text from a CURSOR to a text file. I am appending CHR(13) to each new string. After doing so, the file appears fine when using MODIFY COMMAND. But when using Notepad or importing on a mainframe, the file appears as one long string, with an embedded CRLF. Any ideas woudl be greatly appreciated. Here is the code;

lc_StringToWrite = "D" + Parcel + '01' + Status + ;
STUFF(ALLTRIM(STRTRAN(TRANSFORM(Twshp_Due,'9999999.99'),'.')),1,0,REPLICATE('0',(8-LEN(ALLTRIM(STRTRAN(TRANSFORM(Twshp_Due,'9999999.99'),'.')))))) + ;
STUFF(ALLTRIM(STRTRAN(TRANSFORM(School_Due,'9999999.99'),'.')),1,0,REPLICATE('0',(8-LEN(ALLTRIM(STRTRAN(TRANSFORM(School_Due,'9999999.99'),'.')))))) + ;
CHR(13)

IF STRTOFILE(lc_StringToWrite, "&lc_DiskFile", 1) # 0
...
ELSE
...
ENDIF
 
Probably what is need is the new line character which is chr(10).
 
And you were right! Thanks for the quick response, cannot believe I forgot that. Enjoy the weekend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top