global type f_change_mdl from function_object
end type
forward prototypes
global function string f_change_mdl (string mdl_test)
end prototypes
global function string f_change_mdl (string mdl_test);string mdl_start,mdl_end,temp1 //mdl_start转换前字符串;mdl_end转换后字符串
long weizhi,max_zishu
integer i,j,z
mdl_start=mdl_test
max_zishu=len(mdl_start)
j=0
//z=0
//for i=1 to max_zishu
// if mid(mdl_start,i,1)='"' or mid(mdl_start,i,1)="'" then
// z++
// end if
//next
//
for i=1 to max_zishu
j=j+1
if mid(mdl_start,j,1)='"' then
mdl_end=Replace(mdl_start,j,1,'~~"')
j=j+1
else
mdl_end=mdl_start
temp1=left(mdl_start,j) //测试
end if
mdl_start=mdl_end
if mid(mdl_start,j,1)="'" then
mdl_end=Replace(mdl_start,j,1,"~~'")
j=j+1
else
mdl_end=mdl_start
temp1=left(mdl_start,j) //测试
end if
mdl_start=mdl_end
next
return mdl_start
// weizhi=Pos(mdl_start,'"')
// if weizhi>0 then
// mdl_end=Replace(mdl_start,weizhi,1,'~~"')
// return mdl_end
// else
// return mdl_start
// end if
//
end function
附件是用此函数的一个例子(PB程序)
|
文件: |
test.rar |
大小: |
38KB |
下载: |
下载 | |
阅读(716) | 评论(0) | 转发(0) |