pb中怎么获取数据窗口的列名
1个回答
展开全部
Getcolumn 得到的是当前powerobject的字段的数量。调用语法: getcolumns ( powerobject apo_data, ref string as_columns[], ref string as_error )Int li_colcount,i//取列数Choose Case TypeOf(apo_data) Case datawindow! uo_datawindow_cics ldw ldw= apo_data li_colcount = Integer(ldw.Describe("DataWindow.Column.Count")) Case datawindowchild! datawindowchild ldwc ldwc = apo_data li_colcount = Integer(ldwc.Describe("DataWindow.Column.Count")) Case datastore! uo_datastore_cics lds lds = apo_data li_colcount = Integer(lds.Describe("DataWindow.Column.Count")) Case Else as_error = '调用GetColumns时入参错误:powerobject的类型不正确' Return -1End ChooseIf Not li_colcount > 0 Then as_error = '取数据窗口的列数不成功!' Return -1End If //取列名String columnnames[],ls_colnameFor i = 1 To li_colcount Choose Case TypeOf(apo_data) Case datawindow! ls_colname = ldw.Describe("#" + String(i) +".Name") Case datawindowchild! ls_colname = ldwc.Describe("#" + String(i) +".Name") Case datastore! ls_colname = lds.Describe("#" + String(i) +".Name") End Choose If IsNull(ls_colname) Or ls_colname = '?' Or ls_colname = '!' Then as_error = '调用GetColumns,取数据窗口的列名称不成功:'+String(i) Return -1 End If as_columns[i] = Upper(ls_colname)Next
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询