VFPX / HelpFile

Community maintained VFP 9 SP2 Help file (corrected and enhanced)
21 stars 6 forks source link

TEXT .. TO problems with line feed #31

Open lscheffler opened 2 years ago

lscheffler commented 2 years ago

TEXT .. TO will remove line feed LF - 0h0A if not combined with CR 0h0D, independent of any setting of PRETEXT.
At least a Remark should be introduced to help. Try

lcInput = 'line 1'+0h0a+'line 2'

TEXT To lcText Noshow Textmerge Pretext 3
    <<lcInput>>
ENDTEXT

?lcText

Update:

It keeps CR, CRLF, but not LF

DougHennig commented 2 years ago

Interesting. I usually do this to ensure the last line has a CR and LF:

text to lcText noshow
some text

endtext
lscheffler commented 1 year ago

I see the problem on TEXT TO .. TEXTMERGE merging a variable read from a textfile with only LF.
A prg with only LF and the code you show will do no harm. The frx seems to A) to be considered as binary file by git, and B) not be harmed by the problem. Either the frx adds there own line ends while compiling, or it is a problem of TEXTMERGE.