$PBExportHeader$f_get_pym.srf $PBExportComments$汉字拼音的函数 global type f_get_pym from function_object end type forward prototypes global function string f_get_pym (string as_inputstring) end prototypes global function string f_get_pym (string as_inputstring);//返回汉字拼音的函数,支持混合字符传(可以包含非汉字) //利用PB6能够对汉字进行比较的功能,可以生成所有的汉字拼音码...... //在PB6.5版本下通过 //SunGxf Soft 顾伟章 //注:核心思路来源与陶清PB论坛上,非常感谢 long i string ls_ch,ls_returnStr For i=1 to Len(as_InputString) //依次处理as_InputString中每个字符 ls_ch=Mid(as_InputString , i , 1) If Asc(ls_ch)<128 then // 非汉字 ls_returnStr = ls_returnStr+ls_ch // 不变 Else // 是汉字 ls_ch = Mid(as_InputString , i , 1) // 取出此汉字 //处理汉字 CHOOSE CASE ls_ch CASE is >= '匝' ls_returnStr += "Z" CASE is >= '丫' ls_returnStr += "Y" CASE is >= '夕' ls_returnStr += "X" CASE is >= '哇' ls_returnStr += "W" CASE is >= '他' ls_returnStr += "T" CASE is >= '撒' ls_returnStr += "S" CASE is >= '然' ls_returnStr += "R" CASE is >= '七' ls_returnStr += "Q" CASE is >= '趴' ls_returnStr += "P" CASE is >= '哦' ls_returnStr += "O" CASE is >= '拿' ls_returnStr += "N" CASE is >= '妈' ls_returnStr += "M" CASE is >= '廓' ls_returnStr += "L" CASE is >= '咖' ls_returnStr += "K" CASE is >= '讥' ls_returnStr += "J" CASE is >= '哈' ls_returnStr += "H" CASE is >= '嘎' ls_returnStr += "G" CASE is >= '发' ls_returnStr += "F" CASE is >= '讹' ls_returnStr += "E" CASE is >= '搭' ls_returnStr += "D" CASE is >= '擦' ls_returnStr += "C" CASE is >= '八' ls_returnStr += "B" CASE is >= '阿' ls_returnStr += "A" END CHOOSE // i = i+1 // 指向下一个汉字 End if Next // 处理完毕 RETURN ls_returnStr end function