Chr - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions

Chr

Returns a character of a given ASCII value (character code).
See also Asc.
Syntax
Chr( number )
number
Any ASCII value (a number in the range 0 to 255 inclusive).
Usage
Numbers from 0 to 31 are the standard, nonprintable ASCII codes. For example,
Chr(10) returns a linefeed character and Chr(13) returns a carriage return character.
Therefore, the two-character string Chr(13) & Chr(10) is the newline string.
Examples
<!--- This code illustrates CHR --->
<HTML>
<HEAD>
<TITLE>
CHR Example
</TITLE>
</HEAD>
<BODY BGCOLOR=silver>
<H3>CHR Example</H3>
<!--- if the character string is not empty, then
output its CHR value --->
<CFIF IsDefined("FORM.Submit")>
</CFIF>
<FORM ACTION="chr.cfm" METHOD="POST">
<P>Type in a number between 1 and 256 to see the ASCII character
representation.
<INPUT TYPE="hidden" NAME="CharVals_range" Value="Min=1 Max=256">
<INPUT TYPE="hidden" NAME="CharVals_required" Value="Please enter an
integer from 1 to 256">
<BR><INPUT TYPE="Text"
NAME="CharVals">
<P><INPUT TYPE="Submit" NAME="Submit"> <INPUT TYPE="RESET">
</FORM>
</BODY>
</HTML>
<CFOUTPUT>#FORM.charVals# = #CHR(FORM.charVals)#</CFOUTPUT>
291

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion 4.5

Table of Contents