當前位置:開發者網絡 >> 技術教程 >> 數據庫專欄 >> 其他相關 >> 內容
精彩推薦
分類最新教程
分類熱點教程
    
取數據窗口發生變化的一個函數(補充篇)
作者:未知
日期:2005-04-29
人氣:
投稿:(轉貼)
來源:未知
字體:
收藏:加入瀏覽器收藏
以下正文:

取數據窗口發生變化的一個函數(補充篇)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:cuixuf@sina.com)------------------------------------------------------------------------------*/

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 ChooseNext

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:cuixuf@sina.com)------------------------------------------------------------------------------*/

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:cuixuf@sina.com)------------------------------------------------------------------------------*/

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:cuixuf@sina.com)------------------------------------------------------------------------------*/

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:cuixuf@sina.com)------------------------------------------------------------------------------*/

if isnull(as_str) or trim(as_str) = "" then return trueelse return falseend if另外說一句,如果大家有什麼建議或者叫個好,扔個雞蛋之類的話,請直接在評論上給出吧,因為我的MAIL中經常會自動把郵件轉到垃圾信箱中,上面提到的郵件就是這種情形,不好意思啊……還算好,我在刪除垃圾郵件之前,看了一眼,呵呵!

總而言之,歡迎大家評論,也讓我知道有同志們關注,這樣,我會放出更多的東東,小生在此謝過先!
相關文章: