Tags:
create new tag
view all tags

.CONVERT TEXT TO HTML

This subroutine converts a text field to HTML encoding.


Usage:

      PASS         <html>                     FIELD            SHARE? Y
      PASS         <text>                     FIELD            SHARE? N
      PASS         <html_header>              FIELD            SHARE? N
      PASS         <html_footer>              FIELD            SHARE? N
      GOSUB    --- .CONVERT TEXT TO HTML
      *        check for errors
      IF       --- .CONVERT TEXT TO HTML      NE

Description:

This subroutine converts a text field to HTML encoding. The first two parameters are required, if any are missing the subroutine will CANCEL. The <html_header> and <html_footer> parameters are optional.

<html> returns the converted <text> (Required). This must be PASSed with Share "Y" to return the value.

<text> is the text data you want converted to html (Required).

<html_header> is the html code you want inserted at the beginning of <html> (Optional). If not PASSed or blank, it will default to <HTML><BODY><FONT FACE=HELVETICA>

<html_footer> is any html code you want added to the end of <html> (Optional).

This routine will replace any end of line characters (Go-Return) with <br> and a pair of end of line characters with <p>. The symbols <, >, &, and hard spaces (underscores) will be converted to their HTML equivalents.

If <html> is too small to contain the converted text, --- .CONVERT TEXT TO HTML will contain 'Data was truncated'.

Also see .CONVERT HTML TO TEXT

Comments:

Read what other users have said about this page or add your own comments.


-- JeanNeron - 2012-02-03

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2020-05-12 - JeanNeron
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback