Re: character to ASCII conversion
Posted in 1995
}Date: Fri, 10 Mar 95 15:59:56 AST }From: pamr@fritz.nsaho.ns.ca (Pamela Rhodes) }X-Informix-List-Id: <list.5732> } }Is there a function in Informix 4GL SE that will convert a character into its }ascii equivalent in integer? I want to have an array of 26 integers to count }occurrences of letters. For instance, if I get a letter "E", I want my array }index to be 5 and I'll add 1 to that array position. } }I tried: let int_var = char_var } display int_var } }and got 27 for every letter of the alphabet. Staring with releases 4.12 and 6.00, there is a function ORD which takes a single string argument and returns the integer corresponding to the ASCII value of the first character of the string. For non-string arguments, it returns 0. LET int_var = ORD(char_var) Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>