如何取得某一个数据窗口中计算字段的名字???
如何取得某一个数据窗口中计算字段的名字???
一般字段没问题,但是如何取得计算字段的名字!!
推荐阅读
必须给该字段起一个英文名,然后用getitem系列函数取值。
就象取一般字段的值一樣如:
dw_1.getitemnumber(1, compute_1) 行號用1就可以了.
string ls_objectslist
string ls_objects[]
string ls_computecols[]
long ll_startpos = 1
long ll_endpos
integer i, m
integer li_bound
ls_objectslist = dwcontrol.describe("datawindow.objects")
if len(ls_objectslist) = 0 then return
ls_objectslist = ls_objectslist + "~t"
do while true
ll_endpos = pos(ls_objectslist, "~t", ll_startpos)
if ll_endpos = 0 then exit
ll_objects[i++] = mid(ls_objectslist, ll_startpos, ll_endpos - ll_startpos)
ll_startpos = ll_endpos + 2
loop
li_bound = i
for i = 1 to li_bound
if dwcontrol.describe(ll_objects[i] + ".type") = "compute" then
ls_computecols[m++] = ll_objects[i]
end if
next
ls_computecols[]就是所有的计算列了!
dwcontrol.object.计算字段[],不只行不行,好长时间没玩pb 了
.

讨论区