The code that the ever-ejected pin-out index is Delphi and cannot be used directly in C Builder. I translated them into BCB, I hope you like it. Instructions: You need to call getpychar this function. Example: char z = getpychar ("中"); // This time z 'char a = getpychar ("love"); // This time A is' a'
#include
// Features: Detect whether Value is between LP..// -------------------------------- ---------------------------------------- BOOL __FASTCALL IN (int LP, int HP , int value) {assert (lp <= HP); return (value <= HP) && (value> = lp));
// Parameter: One Chinese character // Return value: Pinyin char __fastcall getpychar (ANSISTRING HZ) {Assert (hz.length () == 2; word hi = word (hz [1]) << 8; WORD LO = byte (Hz [2]); int N = Hi LO; IF (IN (0xB0A1, 0XB0C4, N)) Return 'a'; IF (in (0xB0C5, 0XB2C0, N)) Return 'B'; IF (IN (0xB2C1, 0XB4ED, N)) Return 'C'; IF (IN (0xB4EE, 0XB6E9, N)) Return 'd'; IF (IN (0xB6EA, 0xB7A1, N)) Return 'E'; IF (in (0xB7A2, 0XB8C0, N))) RETURN 'F'; IF (IN (0xB8C1, 0XB9FD, N)) RETURN 'G'; IF (in (0xB9FE, 0XBF6, N)) Return 'h'; if (in (0xBBF7 , 0xBFA5, N)) RETURN 'J'; IF (IN (0xBFA6, 0XC0AB, N)) Return 'K'; IF (in (0xC0AC, 0xC2E7, N)) Return 'L'; IF (in (0xC2e8, 0xc4c2 , N)) RETURN 'M'; IF (IN (0xC4C3, 0XC5B5, N)) Return 'N'; IF (IN (0xC5B6, 0XC5BD, N)) Return 'o'; if (in (0xC5BE, 0xC6D9, N) )) RETURN 'P'; IF (IN (0xC6DA, 0xC8BA, N)) Return 'q'; IF (IN (0xC8BB, 0XC8F5, N)) RETURN 'R'; IF (in (0xC8F6, 0XCBF0, N))) Return 's'; IF (IN (0xCBFA, 0xCDD9, N)) RETURN' T '; IF (IN (0xCDDA, 0xCEF3, N)) Return' W '; IF (in (0xCEF4, 0XD188, N)) Return' X '; IF (IN (0xD1B9, 0XD4D0, N)) Return' Y '; IF (IN (0xD4D1, 0XD7F9, N)) Return' Z '; return char (0);}