Code

Returns the Unicode code points for the characters in the text.

Format 

Code ( text )

Parameters 

text - one or more characters

Data type returned 

number

Originated in version 

10.0

Description 

Returns the Unicode code points for the characters in text. If zero characters are in text, returns an empty string.

If one character is in the text, the function returns the code point for that character. If the text contains multiple characters, the Unicode code point for each character is returned as a group of five digits where the code point for the first character is represented by the low five digits, the code point for the second character in the next higher (to the left) five digits, and so forth.

When converting a composite character such as ä, the function returns the Unicode code point for the composite character.

The following table shows some common navigational characters and the corresponding values returned by this function. These are useful when testing which keystroke activated an OnLayoutKeystroke or OnObjectKeystroke script trigger.

For navigational key

Code returns

Notes

backspace

8

Corresponds to Unicode/ASCII code for BS (backspace)

tab

9

Corresponds to Unicode/ASCII code for HT (horizontal tab)

shift-tab

9

The shift can be detected using the value returned from the Get(TriggerModifierKeys) function

enter

 10

Corresponds to Unicode/ASCII code for LF (line feed)

return

 13

Corresponds to Unicode/ASCII code for CR (carriage return)

escape

 27

Corresponds to Unicode/ASCII code for ESC (escape)

left arrow

 28

Corresponds to Unicode/ASCII code for FS (file separator)

up arrow

 29

Corresponds to Unicode/ASCII code for GS (group separator)

right arrow

 30

Corresponds to Unicode/ASCII code for RS (record separator)

down arrow

 31

Corresponds to Unicode/ASCII code for US (unit separator)

space

 32

Corresponds to Unicode/ASCII code for Space

forward delete

127

Corresponds to Unicode/ASCII code for Delete

Notes 

  • If there are too many characters to be represented in a number field in a FileMaker Pro file, the function returns "?".

Example 1 

Code ( "" ) returns an empty string.

Code ( "a" ) returns 97.

Code ( "b" ) returns 98.

Code ( "ab" ) returns 9800097.

Code ( "ä" ) returns 228.

Code ( "ä" ) (an a followed by a dieresis character entered in a separate keystroke) returns 77600097.