Coding paragraph returns


#1

I have a procedure that produces a .csv file to be imported by XL. Been using it for a few years in Pan 6, having trouble now

this line of code:
htmlencode(replace(«Description»,¶,"
")) is producing a different result than before.
[the quoted area above after ¶ should be br with angle brackets on either side, the html code for line break. It’s creating a break rather than showing literally in the posted forum]
«Description» is a text field that may have several paragraphs. It will be encoded into html and uploaded, but since I have to go through XL before I can upload, I don’t want any paragraph returns.

Now, instead of the
[same thing with the break code here] I get,when looking at it in BBedit with Show Invisibles on, an upside down red Question Mark. Tried changing Bbedit preferences to UTF-8. Still have the red question mark.

I’ve tried substituting for ¶ cr() and char(10). Nothing
I’ve tried substitution “X” for “
” [and here] and no “X” shows up.
Tried just htmlencode(«Description») and the paragraphs do not get encoded, though special characters do.

Is there a new way PanX is encoding text, or paragraphs, that I’ve missed?


#2

OS X (and now macOS) uses linefeeds instead of carriage returns like MacOS 9. So now you may see either. There are two functions that will help with this by forcing either to all carriage returns or all linefeeds

So I would suggest that you change your code to:

htmlencode(replace(lftocr(Description),cr(),"<br>")

As you can see above, it is possible to include angle brackets in this forum. If you indent text by 4 spaces, and put a blank line above and below, it will be displayed as code, and angle brackets are shown as is. This also makes it easier to differentiate code from regular text.


#3

That did it, thanks

Martin McCaffery
Montgomery, AL