View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > Asc PreviousNext

Asc

Determines the value of a character.

The value of the first character of a string; if string is empty, returns zero.

String functions

Asc(string)

Chr

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

Parameter

Description

string

A string

<h3>Asc Example</h3>
<!--- if the character string is not empty, output its ASCII value --->
<cfif IsDefined("FORM.charVals")>

   <cfif FORM.charVals is not "">
      <cfoutput>#Left(FORM.charVals,1)# = 
     #Asc(FORM.charVals)#</cfoutput>
   <cfelse>
<!--- if it is empty, output an error message --->
      <h4>Enter a character</h4>
   </cfif>
</cfif>

<form action = "asc.cfm">
<p>Enter a character to see its ASCII value
<br><input type = "Text" name = "CharVals" size = "1" MAXLENGTH = "1">
<p><input type = "Submit" name = ""> <input type = "RESET">
</form>

Contents > CFML Reference > ColdFusion Functions > Asc PreviousNext

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

Version 6.1

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

Comments


Greg Hamer said on Jan 14, 2004 at 8:20 PM :
In example, should be <form action = "asc.cfm" METHOD=POST>

 

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

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functa20.htm