Line breaks in Description Field through script

If you need help on how to use the program
Post Reply
bmm
Posts: 10
Joined: 2002-07-27 08:57:27
Location: Denmark

Line breaks in Description Field through script

Post by bmm »

Hi

Is it possible to create "line breaks" (like saying /n or something) in the Description and Comments Field through a script?

I want to convert <p> and <br> to line breaks, so that text in paragraphs on a webpage doesn't end up as one long paragraph in AMC.
antp
Site Admin
Posts: 9630
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

in the code the linebreak is the ASCII value of the character, so newline & carriage return :

Code: Select all

value := atext + #13#10 + anothertext
If you want to replace the <p> and <br> you can do this :

Code: Select all

value := StringReplace(value, '<br>', #13#10);
value := StringReplace(value, '<p>', #13#10#13#10);
(here you'll get an double line break for <p> tag)
bmm
Posts: 10
Joined: 2002-07-27 08:57:27
Location: Denmark

Post by bmm »

Thanks for the quick answer. It works exactly as it should. :grinking:
Post Reply