• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 在PB中如何實現數據模糊查詢(三)

    發表于:2008-02-25來源:作者:點擊數: 標簽:
    4. 函數: 4.1 public function string wf_getywname (string hzname)函數 功能:返回"表名.列名",如"department.d_id"。 4.2 public function string wf_getywtype (string hzname)函數 功能:返回列類型。 注釋: (1) f_getoken()函數代碼如下: 4.3 pub
    4. 函數:

        4.1 public function string wf_getywname (string hzname)函數

        功能:返回"表名.列名",如"department.d_id"。

     


        4.2 public function string wf_getywtype (string hzname)函數

        功能:返回列類型。

        注釋:

        (1) f_getoken()函數代碼如下:

     


        4.3 public function string wf_dateconvert (string svalue)函數

        功能:見程序中注釋。

        string syear,smonth,sday
        date idate
        idate = date(svalue)
        syear = string(year(idate))
        smonth = string(month(idate))
        sday = string(day(idate))
        svalue = syear + "-" + smonth + "-" + sday
        return svalue
        end function
        public function string wf_datetime (string inputvalue)
        inputvalue = trim(inputvalue)
        integer position
        string bef,aft
        /* bef 為日期,aft為時間*/
        position = pos(inputvalue," ")
        if position = 0 then inputvalue += " 00:00:00"
        position = pos(inputvalue," ")
        if position = 0 then
        return "error"
        else
        bef = left(inputvalue , position - 1)
        aft = right(inputvalue,len(inputvalue) - position)
        if (not isdate(bef)) or (not istime(aft)) then
        return "error"
        end if
        end if
        //bef = wf_dateconvert(bef)
        //return bef + " " + aft
        string syear,smonth,sday
        date idate
        idate = date(bef)
        syear = string(year(idate))
        smonth = right('00'+string(month(idate)),2)
        sday = right('00'+string(day(idate)),2)
        return syear+smonth+sday
        end function
        public subroutine wf_setcolumn (datawindow dw_1, datawindow dw_2)
        pfc_n_cst_string lnv_string
        String scol, stable_col
        String shz, syw, stype, stable
        Integer i, row
        If Not IsValid(dw_1) Then Return
        If Not IsValid(dw_2) Then Return
        dw_2.ReSet()
        For i =1 To long(dw_1.Object.DataWindow.Column.Count)
        scol = dw_1.Describe("#" + String(i) + ".Name") //列名(可變)
        stable_col = dw_1.Describe(scol + ".dbName") //所在表.列名(OK)
        stable = lnv_string.of_gettoken(stable_col,".") //所在表
        syw = stable_col //列名(不變.OK)
        shz = trim(dw_1.Describe(scol + "_t.Text")) //中文名
        stype = dw_1.Describe(scol + ".ColType") //列類型
        if dw_1.Describe(scol + ".Type") = "column" &
        and shz <> "!" and shz <> "?" then
        shz = lnv_string.of_globalreplace(shz,"'","") //去掉單引號
        shz = lnv_string.of_globalreplace(shz,'"','') //去掉雙引號
        shz = lnv_string.of_globalreplace(shz,"~r~n","_") //去掉換行符
        shz = lnv_string.of_globalreplace(shz," ","_") //去掉空格
        shz = lnv_string.of_globalreplace(shz,":","") //去掉冒號
        shz = lnv_string.of_globalreplace(shz,":","") //去掉冒號
        row = dw_2.InsertRow(0)
        dw_2.object.data[row,1] = shz
        dw_2.object.data[row,2] = syw
        dw_2.object.data[row,3] = stype
        dw_2.object.data[row,4] = stable
        end if
        Next

        4.4 public function long wf_min (long a, long b, long c)函數

        功能:給定三個數a,b,c, 如果a,b,c均為0, 則返回0;否則,返回a,b,c中不為0的數中的最小值.例1: a = 0, b = 0, c = 0 ,則返回0。例2: a = 0, b = 2, c = 6 ,則返回2。例3: a = 9, b = 0, c = 0 ,則返回9。
    , long b, long c)函數

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>