View comments | RSS feed

Chr

Description

ASCII Character function.

Return value

A character, of the given ASCII character code.

Category

String functions

Syntax

Chr(number) 

See also

Asc

History

New in ColdFusion MX: ColdFusion supports the Java UCS-2 representation of Unicode characters, up to a value of 65536. (Earlier releases supported 1-255.)

Parameters

Parameter Description
number
A value (a number in the range 0 to 255, inclusive)

Usage

The values 0 - 31 are standard, nonprintable codes. For example:

Example

<h3>CHR Example</h3>
<!--- if the character string is not empty, output its CHR value --->
<cfif IsDefined("FORM.Submit")>
  <cfoutput>#FORM.charVals# = #CHR(FORM.charVals)#</cfoutput>
</cfif>
<form action = "chr.cfm">
<p>Enter a number between 1 and 256 to see the ASCII representation.
<input type = "hidden" name = "CharVals_range" Value = "Min = 1 Max = 256">
<input type = "hidden" name = "CharVals_required" Value = "Enter an integer from 1
to 256">
<br><input type = "Text" name = "CharVals">
<p><input type = "Submit" name = "Submit"> <input type = "RESET">
</form>

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | Bug Reporting

Version 6

Comments are no longer accepted for ColdFusion MX. ColdFusion 8 is the current version.

Comments


pglynn said on Dec 10, 2004 at 10:30 AM :
a link to a conversion chart (chr values = numbers) would be nice. thanks.
No screen name said on Nov 13, 2005 at 2:00 PM :
Here's one: http://www.lookuptables.com/
LBPSlava said on Mar 27, 2007 at 6:52 PM :
From the "New" note, it seems that CHR(1074) should produce a Cyrillic charcter. Instead, it returns "2".

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/6/CFML_Reference/functions-pt136.htm