给LZ提供一个获取汉字拼音首字母的函数.
function HZToPY
parameter achHZString
local achPYString,i,j,chPY,achHZ
achPYString=''
set collate to 'PINYIN'
achPYCode='八嚓咑妸发旮铪讥讥咔垃呣拿讴趴七呥仨他哇哇哇夕丫匝咗'
for i=1 to len(achHZString)
if asc(substr(achHZString,i,1))>160
achHZ=substr(achHZString,i,2)
chPY=''
for j=1 to 26
if substrc(achHZ,1,1)<substrc(achPYCode,j,1)
chPY=chr(asc('a')+j-1)
exit
endif
endfor
achPYString=achPYString+upper(chPY)
i=i+1
else
if (asc(substr(achHZString,i,1))>32)
achPYString=achPYString+upper(substr(achHZString,i,1))
endif
endif
endfor
return achPYString
endfunc