标点符号函数简化问题
把一个备注内容通过分段分成几个行,但是有时行首有中文标点符号,我想设计一个函数把行首标点添加到上一行尾比如有行a1,行b1,行c1,行d1等等,大家有什么好的办法,说说。。
设计一函数如下:
程序代码:
*!* 校验行首是否为中文标点符号(包括","。"》"三种),如果是则把标点符号删掉在它前一行尾增加此标点符号 *!* 用法bdfh(首行变量,下一行变量,1或2),如果是1则返回首行,2则返回第二行 *!* 如bdfh(a1,b1,1)则返回a1值,bdfh(a1,b1,2)则返回b1值 FUNCTION bdfh PARAMETERS sbdfhtmp,wbdfhtmp,bdfhtmp IF ASC(SUBSTRC(wbdfhtmp,1,1))=41900&&, sbdfhtmp=sbdfhtmp+CHR(41900) wbdfhtmp=SUBSTRC(wbdfhtmp,2) ENDIF IF ASC(SUBSTRC(wbdfhtmp,1,1))=41399&&》 sbdfhtmp=sbdfhtmp+CHR(41399) wbdfhtmp=SUBSTRC(wbdfhtmp,2) ENDIF IF ASC(SUBSTRC(wbdfhtmp,1,1))=41379&&。 sbdfhtmp=sbdfhtmp+CHR(41379) wbdfhtmp=SUBSTRC(wbdfhtmp,2) ENDIF IF ASC(SUBSTRC(wbdfhtmp,1,1))=41378&&、 sbdfhtmp=sbdfhtmp+CHR(41378) wbdfhtmp=SUBSTRC(wbdfhtmp,2) ENDIF IF ASC(SUBSTRC(wbdfhtmp,1,1))=41919&&? sbdfhtmp=sbdfhtmp+CHR(41919) wbdfhtmp=SUBSTRC(wbdfhtmp,2) ENDIF IF ASC(SUBSTRC(wbdfhtmp,1,1))=41889&&! sbdfhtmp=sbdfhtmp+CHR(41889) wbdfhtmp=SUBSTRC(wbdfhtmp,2) ENDIF IF ASC(SUBSTRC(wbdfhtmp,1,1))=41915&&; sbdfhtmp=sbdfhtmp+CHR(41915) wbdfhtmp=SUBSTRC(wbdfhtmp,2) ENDIF IF ASC(SUBSTRC(wbdfhtmp,1,1))=41914&&: sbdfhtmp=sbdfhtmp+CHR(41914) wbdfhtmp=SUBSTRC(wbdfhtmp,2) ENDIF RETURN IIF(bdfhtmp=1,sbdfhtmp,wbdfhtmp) ENDFUNC
程序代码:
a1=bdfh(a1,b1,1)&&第一行和第二行检测 b1=bdfh(a1,b1,2)&&第一行和第二行检测 b1=bdfh(b1,c1,1)&&第二行和第三行检测 c1=bdfh(b1,c1,2)&&第二行和第三行检测 c1=bdfh(c1,d1,1)&&第三行和第四行检测 d1=bdfh(c1,d1,2)&&第三行和第四行检测