Difference between revisions of "HTML ENTITIES()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(29 intermediate revisions by one user not shown)
Line 1: Line 1:
{{YLM to do}}
 
 
 
==Purpose==
 
==Purpose==
 
Function to return a string from a character string or memo field where qualifying characters have been replaced with their html entity equivalents  
 
Function to return a string from a character string or memo field where qualifying characters have been replaced with their html entity equivalents  
Line 10: Line 8:
  
 
==See Also==
 
==See Also==
[[AT()]], [[ATNEXT()]], [[CHRTRAN()]], [[HTML_ENTITY_DECODE()]], [[INLIST()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[STR()]], [[STR_REPLACE()]], [[STREXTRACT()]], [[STRTRAN()]], [[STUFF()]], [[SUBSTR()]]
+
[[ASC()]], [[AT()]], [[ATNEXT()]], [[CHR()]], [[CHRTRAN()]], [[DECODE()]], [[ENCODE()]], [[HTML_ENTITY_DECODE()]], [[INLIST()]], [[LEFT()]], [[OCCURS()]], [[RAT()]], [[RIGHT()]], [[STR()]], [[STR_REPLACE()]], [[STREXTRACT()]], [[STRTRAN()]], [[STUFF()]], [[SUBSTR()]]
  
  
 
==Description==
 
==Description==
The STRTRAN() function will search <expC1> or <memofield> and replace text within <expC1> or <memofield> with <expC3> wherever the occurrence of <expC2> is found.  The optional <expN1> specifies the start position for the search in <expC1>.  If this is not specified then the default is 1.  The optional <expN2> specifies the number of occurrences of <expC2> to replace with <expC3>.  If this is not specified, then all occurrences starting from <expN1> are replaced.  This function can be used to remove blank spaces in character strings.  The STRTRAN() function returns a character expression that contains the result of the string translation.
+
The HTML_ENTITIES() function will search <expC> or <memofield> and return a string where qualifying characters have been replaced with their html entity equivalents.  
  
<pre>
+
 
" = &quot;
+
The following characters are converted to their HTML entity equivalents:
& = &amp;
+
 
' = &#39;
+
* Tab (chr(9))
< = &lt;
+
* Line feed (chr(10))
> = &gt;
+
* Carriage return (chr(13))
</pre>
+
* &quot;
 +
* &amp;
 +
* &#39;
 +
* &lt;
 +
* &gt;
  
  
 
==Example==
 
==Example==
<code lang="recital">
+
<pre>
? strtran("Hello World", "ello", "i")
+
<!-- dispmemo.rsp -->
Hi World
+
<html>
</code>
+
<body>
 +
<%
 +
open database southwind
 +
use example
 +
goto 1
 +
? &quot;&lt;pre&gt;&quot; + html_entities(notes) + &quot;&lt;/pre&gt;&quot;
 +
close databases
 +
%>
 +
</body>
 +
</html>
 +
</pre>
  
  

Latest revision as of 14:26, 1 July 2011

Purpose

Function to return a string from a character string or memo field where qualifying characters have been replaced with their html entity equivalents


Syntax

HTML_ENTITIES(<expC> | <memofield>)


See Also

ASC(), AT(), ATNEXT(), CHR(), CHRTRAN(), DECODE(), ENCODE(), HTML_ENTITY_DECODE(), INLIST(), LEFT(), OCCURS(), RAT(), RIGHT(), STR(), STR_REPLACE(), STREXTRACT(), STRTRAN(), STUFF(), SUBSTR()


Description

The HTML_ENTITIES() function will search <expC> or <memofield> and return a string where qualifying characters have been replaced with their html entity equivalents.


The following characters are converted to their HTML entity equivalents:

  • Tab (chr(9))
  • Line feed (chr(10))
  • Carriage return (chr(13))
  • "
  • &
  • '
  • <
  • >


Example

<!-- dispmemo.rsp -->
<html>
<body>
<%
open database southwind
use example
goto 1
 ? "<pre>" + html_entities(notes) + "</pre>"
close databases
%>
</body>
</html>


Products

Recital Server, Recital