数据库

本类阅读TOP10

·SQL语句导入导出大全
·SQL Server日期计算
·SQL语句导入导出大全
·SQL to Excel 的应用
·Oracle中password file的作用及说明
·MS SQLServer OLEDB分布式事务无法启动的一般解决方案
·sqlserver2000数据库置疑的解决方法
·一个比较实用的大数据量分页存储过程
·如何在正运行 SQL Server 7.0 的服务器之间传输登录和密码
·SQL中两台服务器间使用连接服务器

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
取数据窗口发生变化的一个函数(补充篇)

作者:未知 来源:月光软件站 加入时间:2005-5-13 月光软件站

取数据窗口发生变化的一个函数(补充篇)
by ...---... (QQ:21417511)

前几天收到一份MAIL,说上文《取数据窗口发生变化的一个函数》写的函数中代码没放全,仔细看了一下,是用了另外一些函数,在此表示道歉啦。现在补全那些函数:of_strip() , of_getitem() , of_getstring() ,  uf_isnull(),不同的函数用不同颜色区分开了。

各位看官有兴趣自己看着改改吧……  :)

/*------------------------------------------------------------------------------

 Function:   public u_dw.of_Strip

 Returns:         String

 Parameters:      value String a_szarg

 Description:  

--------------------------------------------------------------------------------
 2005-4-25 2.0.0  Initial version by cuixuf (Mail:[email protected])
------------------------------------------------------------------------------*/

Integer nLength, nPos

nLength = Len( a_szArg)

For nPos = 1 To nLength
 Choose Case Mid( a_szArg, nPos, 1)
  Case "~t", "~r", "~n", '"',":"
   a_szArg = Replace( a_szArg, nPos, 2, "  ")
 End Choose
Next

Return Trim( a_szArg)

/*------------------------------------------------------------------------------

 Function:   public u_dw.of_Getitem

 Returns:         Any

 Parameters:      value DataStore ads_target
                  value Integer ai_row
                  value Integer ai_col
                  value String as_type

 Description:  

--------------------------------------------------------------------------------
 2005-4-25 2.0.0  Initial version by cuixuf (Mail:[email protected])
------------------------------------------------------------------------------*/

Choose Case Left(as_type,5)
 Case Left("char(n)",5)
  return ads_target.GetItemString(ai_row,ai_col)
 Case Left("date",5)
  return ads_target.GetItemDate(ai_row,ai_col)
 Case Left("datetime",5)
  return ads_target.GetItemDateTime(ai_row,ai_col)
 Case Left("decimal",5)
  return ads_target.GetItemDecimal(ai_row,ai_col)
 Case "int","long",Left("number",5),"real","ulong"
  return ads_target.GetItemNumber(ai_row,ai_col)
End Choose

/*------------------------------------------------------------------------------

 Function:   public u_dw.of_Getitem

 Returns:         Any

 Parameters:      value Integer ai_row
                  value Integer ai_col
                  value String as_type

 Description:  

--------------------------------------------------------------------------------
 2005-4-25 2.0.0  Initial version by cuixuf (Mail:[email protected])
------------------------------------------------------------------------------*/

Choose Case Left(as_type,5)
 Case Left("char(n)",5)
  return this.GetItemString(ai_row,ai_col)
 Case Left("date",5)
  return this.GetItemDate(ai_row,ai_col)
 Case Left("datetime",5)
  return this.GetItemDateTime(ai_row,ai_col)
 Case Left("decimal",5)
  return this.GetItemDecimal(ai_row,ai_col)
 Case "int","long",Left("number",5),"real","ulong"
  return this.GetItemNumber(ai_row,ai_col)
End Choose

/*------------------------------------------------------------------------------

 Function:   public u_dw.of_Getstring

 Returns:         String

 Parameters:      value Any aa_data
                  value String as_type

 Description:  

--------------------------------------------------------------------------------
 2005-4-25 2.0.0  Initial version by cuixuf (Mail:[email protected])
------------------------------------------------------------------------------*/

if isNull(aa_data) then return "[Null]"

Choose Case Left(as_type,5)
 Case Left("char(n)",5)
  return "'"+string(aa_data)+"'"
 Case Left("date",5),Left("datetime",5),Left("decimal",5),"int","long",Left("number",5),"real","ulong"
  return string(aa_data)
End Choose

/*------------------------------------------------------------------------------

 Function:   public n_functions.uf_Isnull

 Returns:         Boolean

 Parameters:      value String as_str

 Description:  

--------------------------------------------------------------------------------
 2005-4-25 2.0.0  Initial version by cuixuf (Mail:[email protected])
------------------------------------------------------------------------------*/

if isnull(as_str) or trim(as_str) = "" then
 return true
else
 return false
end if

另外说一句,如果大家有什么建议或者叫个好,扔个鸡蛋之类的话,请直接在评论上给出吧,因为我的MAIL中经常会自动把邮件转到垃圾信箱中,上面提到的邮件就是这种情形,不好意思啊……还算好,我在删除垃圾邮件之前,看了一眼,呵呵!

总而言之,欢迎大家评论,也让我知道有同志们关注,这样,我会放出更多的东东,小生在此谢过先!




相关文章

相关软件