Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1352930
  • 博文数量: 416
  • 博客积分: 13005
  • 博客等级: 上将
  • 技术积分: 3297
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-05 16:26
文章分类

全部博文(416)

文章存档

2014年(1)

2013年(4)

2012年(46)

2011年(64)

2010年(12)

2009年(4)

2008年(40)

2007年(187)

2006年(58)

分类:

2007-06-05 22:41:04


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
下载: 下载



阅读(679) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~