Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

CHRCODE

CHRCODE

CHRCODE returns the numeric UNICODE value of the first character of the string passed to the function.
Normally, before you pass any string value to CHRCODE, you parse out the specific character you want to convert to a UNICODE value. For example, you might use RTRIM or another string-manipulation function. If you pass a numeric value, CHRCODE converts it to a character string and returns the UNICODE value of the first character in the string.
This function is identical in behavior to the ASCII function. If you currently use ASCII in expressions, it will still work correctly. However, when you create new expressions, use the CHRCODE function instead of the ASCII function.

Syntax

CHRCODE (
string
)
Argument
Required/
Optional
Description
string
Required
Character string. Passes the values you want to return as UNICODE values. You can enter any valid expression.

Return Value

Integer. The UNICODE value of the first character in the string.
NULL if a value passed to the function is NULL.

Example

The following expression returns the UNICODE value for the first character of each value in the ITEMS column:
CHRCODE( ITEMS )
ITEMS
RETURN VALUE
Flashlight
70
Compass
67
Safety Knife
83
Depth/Pressure Gauge
68
Regulator System
82

0 COMMENTS

We’d like to hear from you!