Scripting > UNICOM Intelligence Function Library > Text functions > AscW
 
AscW
Returns an integer value representing the Unicode character code (sometimes called the code point) for a character.
Syntax
AscW(Val)
Parameters
Val
Type: Text
Text value. See also Specifying text strings as arguments.
(return)
Type: Long
Unicode character code for first character of Val.
Remarks
A Unicode character code is an integer from 0 to 65535.
This function returns 0 if Val is empty. If the current data value is NULL, Val is an empty string and 0 is returned.
Example
This mrScriptBasic example uses the AscW function to return the character code for a single character:
AscW("a")
The return value is 97.
The next example shows an SQL query that uses the AscW function to return the character code for the first character of the name variable (which stores the respondent's name).
SELECT AscW(name) FROM vdata
See also
ChrW
Text functions