超级难!!如何获得数据窗口内的所有对象?

bridgenew 2003-06-18 03:29:10
如何获得和访问数据窗口内所有对象?包括所有列,计算列,静态文本等所有对象
...全文
68 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
tulip2108 2003-06-18
  • 打赏
  • 举报
回复
//////////////////////////////////////////////////////////////////////////////
//
// Function: of_GetObjects //
// Access: Public//
// Arguments:
// as_objlist[]: A string array to hold objects (passed by reference)
// as_objtype: The type of objects to get (* for all, others defined
// by the object .TYPE attribute)
// as_band: The dw band to get objects from (* for all)
// Valid bands: header, detail, footer, summary
// header.#, trailer.#
// ab_visibleonly: TRUE - get only the visible objects,
// FALSE - get visible and non-visible objects
//
// Returns: Integer
// The number of objects in the array
//
// Description: The following function will parse the list of objects
// contained in the datastore control associated with this service,
// returning their names into a string array passed by reference,
// and returning the number of names in the array as the return value
// of the function.


string ls_ObjString, ls_ObjHolder
integer li_Start=1, li_Tab, li_Count=0

/* Get the Object String */
ls_ObjString = ids_requestor.Describe("Datawindow.Objects")

/* Get the first tab position. */
li_Tab = Pos(ls_ObjString, "~t", li_Start)
Do While li_Tab > 0
ls_ObjHolder = Mid(ls_ObjString, li_Start, (li_Tab - li_Start))

// Determine if object is the right type and in the right band
If (ids_requestor.Describe(ls_ObjHolder + ".type") = as_ObjType Or as_ObjType = "*") And &
(ids_requestor.Describe(ls_ObjHolder + ".band") = as_Band Or as_Band = "*") And &
(ids_requestor.Describe(ls_ObjHolder + ".visible") = "1" Or Not ab_VisibleOnly) Then
li_Count ++
as_ObjList[li_Count] = ls_ObjHolder
End if

/* Get the next tab position. */
li_Start = li_Tab + 1
li_Tab = Pos(ls_ObjString, "~t", li_Start)
Loop

// Check the last object
ls_ObjHolder = Mid(ls_ObjString, li_Start, Len(ls_ObjString))

// Determine if object is the right type and in the right band
If (ids_requestor.Describe(ls_ObjHolder + ".type") = as_ObjType or as_ObjType = "*") And &
(ids_requestor.Describe(ls_ObjHolder + ".band") = as_Band or as_Band = "*") And &
(ids_requestor.Describe(ls_ObjHolder + ".visible") = "1" Or Not ab_VisibleOnly) Then
li_Count ++
as_ObjList[li_Count] = ls_ObjHolder
End if

Return li_Count
Thinkinger 2003-06-18
  • 打赏
  • 举报
回复
string ls_objstring
integer li_start=1

ls_objstring = dwobject.describe("datawindow.objects")

//对象名称是用~t符号来分割的,你用循环语句进行提取各个对象就行了
dotnba 2003-06-18
  • 打赏
  • 举报
回复
dw_control.Object.DataWindow.Objects
Thinkinger 2003-06-18
  • 打赏
  • 举报
回复
分太少,不予解决,呵呵!

611

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧