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 |
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
相关专题
- (3664篇文章)SQL Server 索引和查询专题
- (1680次浏览)在PB中如何实现数据模糊查询
- (844次浏览)用PB开发多媒体数据库管理系统
- (777次浏览)PowerBuilder数据窗口编程技巧十则
- (748次浏览)PB8.0应用程序编译发布技术研究
- (711次浏览)如何发布独立的POWERBUILDER应用
- (693次浏览)在PB中动态修改SQL语句
- (664次浏览)低级键盘钩子屏蔽Win键、Alt+Tab键的响应
- (662次浏览)用Powerbuilder开发WEB数据库
- (662次浏览)PowerBuilder应用开发系列讲座(9)
- (654次浏览)用PB做一个通用右键菜单






