您还没有绑定微信,更多功能请点击绑定

计算汉字笔画

FUNCTION gnjshzbh **************************************************************[b] 函数功能:计算汉字笔画 调用值: lcc2nword 要计算的汉字 返回值: n 汉字笔画 [/b]******************************************************************** PARAMETERS lcc2nword LOCAL laword(30),lnstrokes,lnwordlength,lnnumber,lccollate lccollate=SET("Collate") SET COLLATE TO "STROKE" lnstrokes=0 FOR lnwordlength=1 TO LENC(lcc2nword) lcword=SUBSTRC(lcc2nword,lnwordlength,1) lcstr='丁万不且丞丣並临丵乾亁亂僊僵亸償儭儳儶儷亹儽儾囔圞灥囖灩灪' FOR i=1 TO 29 laword(i)=SUBSTRC(lcstr,i,1) ENDFOR laword(30)=lcword ASORT(laword,1,30,1) lnnumber=ASCAN(laword,lcword) lnstrokes=lnstrokes+(31-lnnumber) ENDFOR SET COLLATE TO (lccollate) RETURN lnstrokes
'============================================================================ 求汉字笔划数Clear? HZ2BH( [二] )? HZ2BH( [红] )? HZ2BH( [雨] )? HZ2BH( [灪] )Return ----------------------------------------- 函数: HZ2BH 功能: 求汉字笔划数 参数: tcSource 一个双字节汉字 返回: lnResult 该汉字的笔划 设计: 红雨 时间: 2003年12月20日 -----------------------------------------Function HZ2BH( tcSource ) Local lnResult lnResult = 0 If Type([tcSource])=[C] If Len(tcSource) > 1 and asc(Subs(tcSource,1,1)) > 126 Local lcOldCollate, lcStr, liStr, lnStr lcOldCollate = Set([Collate]) lcStr = [一二三不且丞丣並临丵乾亁亂僊僵亸償儭儳儶儷亹儽儾囔圞灥囖灩灪] lnStr = Len(lcStr)/2 Set Collate To [STROKE] For liStr = 1 to lnStr lnResult = liStr - 1 If left(tcSource,2) < Subs( lcStr, (liStr*2)-1, 2 ) Exit Endif Endfor Set Collate To lcOldCollate Endif Endif Return lnResultEndfunc

0 个评论

游客无法查看评论和回复, 请先登录注册

发起人

推荐文章

文章状态

  • 发布时间: 2008-12-18 08:44
  • 浏览: 1311
  • 评论: 0
  • 赞: 0