函数
public function string wf_getywname (string hzname)函数
功能返回表名列名如departmentd_id
public function string wf_getywtype (string hzname)函数
功能返回列类型
注释
() f_getoken()函数代码如下
public function string wf_dateconvert (string svalue)函数
功能见程序中注释
string syearsmonthsday
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 befaft
/* bef 为日期aft为时间*/
position = pos(inputvalue )
if position = then inputvalue += ::
position = pos(inputvalue )
if position = then
return error
else
bef = left(inputvalue position )
aft = right(inputvaluelen(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 syearsmonthsday
date idate
idate = date(bef)
syear = string(year(idate))
smonth = right(+string(month(idate)))
sday = right(+string(day(idate)))
return syear+smonth+sday
end function
public subroutine wf_setcolumn (datawindow dw_ datawindow dw_)
pfc_n_cst_string lnv_string
String scol stable_col
String shz syw stype stable
Integer i row
If Not IsValid(dw_) Then Return
If Not IsValid(dw_) Then Return
dw_ReSet()
For i = To long(dw_ObjectDataWindowColumnCount)
scol = dw_Describe(# + String(i) + Name) //列名(可变)
stable_col = dw_Describe(scol + dbName) //所在表列名(OK)
stable = lnv_stringof_gettoken(stable_col) //所在表
syw = stable_col //列名(不变OK)
shz = trim(dw_Describe(scol + _tText)) //中文名
stype = dw_Describe(scol + ColType) //列类型
if dw_Describe(scol + Type) = column &
and shz <> ! and shz <> ? then
shz = lnv_stringof_globalreplace(shz) //去掉单引号
shz = lnv_stringof_globalreplace(shz) //去掉双引号
shz = lnv_stringof_globalreplace(shz~r~n_) //去掉换行符
shz = lnv_stringof_globalreplace(shz _) //去掉空格
shz = lnv_stringof_globalreplace(shz:) //去掉冒号
shz = lnv_stringof_globalreplace(shz) //去掉冒号
row = dw_InsertRow()
dw_objectdata[row] = shz
dw_objectdata[row] = syw
dw_objectdata[row] = stype
dw_objectdata[row] = stable
end if
Next
public function long wf_min (long a long b long c)函数
功能给定三个数abc 如果abc均为 则返回;否则返回abc中不为的数中的最小值例: a = b = c = 则返回例: a = b = c = 则返回例: a = b = c = 则返回
long b long c)函数