字符变量如何作为datawindow的列名使用?(在线等...)

byfq 2002-04-10 03:36:50
eg.
string ls_colarray[],ls_colname
ls_colarray = dw_1.Object.ls_colname.Primary
如何使上式可以正常使用?
...全文
82 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
byfq 2002-04-26
  • 打赏
  • 举报
回复
大家看看我自己找到的办法,
eg.
string ls_colarray[],ls_colname

ll_colxh = adw_tjb.Describe(ls_colname + ".ID")
ll_rownum = dw_1.rowcount()
ls_colarray = dw_1.Object.Data[1,ll_colxh,ll_rownum,ll_colxh]
fangss 2002-04-11
  • 打赏
  • 举报
回复
integer ls_ret
string ls_mod
string ls_i,ls_j
ls_1='1'
ls_j='2'
ls_mod="t"+ls_i+ls_j+".text='' "//要modify的
ls_ret=dw_1.modify(ls_mod)
因为我要动太修改一些数据窗口内容,所以要拼一下modify的内容,这是我程序的大致辞意思,不知你的为何不行?
难道因为是我修改的text?要不你先按我的试试~~
byfq 2002-04-11
  • 打赏
  • 举报
回复
楼上说的方法好象不行,执行下面代码,只看到一个“?”
eg.
string ls

ls = dw_2.Describe("selectgather.Values")
messagebox('',ls)

byfq 2002-04-11
  • 打赏
  • 举报
回复
to Top

回复人: sorrow_arrow(想你一分,就恨你一分)
看来是真的不行了,我等......
yt_yule 2002-04-11
  • 打赏
  • 举报
回复
整列的数据:
string ls_namearray[]
ls_namearray = dw_1.object.列名.primary
没用过,不懂! 请sorrow_arrow(想你一分,就恨你一分) 解释一下!
sorrow_arrow 2002-04-11
  • 打赏
  • 举报
回复
不好意思,没有看全部,我看没有别的方法了,你还是使用getitem函数吧,一行一行的来取,一行一行的赋给数组吧
sorrow_arrow 2002-04-11
  • 打赏
  • 举报
回复
整列的数据:
string ls_namearray[]
ls_namearray = dw_1.object.列名.primary
byfq 2002-04-11
  • 打赏
  • 举报
回复
对,text可以,value 也可以,但value是代码表的value,并且不是我说的意思,我是想取整列的数据
byfq 2002-04-10
  • 打赏
  • 举报
回复
根据帮助里说的应该是不可以的,你用过吗?那个取的是代码表的value,是datawindow的属性,明天我试下
Description
The values in the code table for the column.
Controls
Column objects
Syntax
Dot notation:

dw_control.Object.columnname.Values

Describe and Modify argument:

"columnname.Values { = ' string ' }"
Parameter Description
columnname The column for which you want to specify the contents of the code table
string (exp) A string containing the code table values for the column. In the string, separate the display values and the actual values with a tab character, and separate multiple pairs of values with a slash using this format:"displayval~tactualval/displayval~tactualval/ ..."For example:"red~t1/white~t2"String is quoted and can be a DataWindow painter expression
Usage
In the painter
Set the value using the Object property sheet, Edit tab, Display Value and Data Value options (available for edit style DropDownListBox and for Edit and EditMask when a code table is enabled).
When Style is Edit, check Use Code Table.
When Style is EditMask, check Spin Control and Code Table.
fangss 2002-04-10
  • 打赏
  • 举报
回复
呵呵,没看你的解释,用modify可以!
fangss 2002-04-10
  • 打赏
  • 举报
回复
ls_colarray = dw_1.Object.ls_colname.Primary
不要用这种方式了,
dw_1.modify()和dw_1.describe()来做设置和取得,里面是string的:)
byfq 2002-04-10
  • 打赏
  • 举报
回复
你们没看懂我的例子,
我要根据列名取某列的所有数据赋到数组里(当然我这里不能使用列号),用Modify 能做到吗?
wmy_xt 2002-04-10
  • 打赏
  • 举报
回复
使用 Modify 函数
hevenliu 2002-04-10
  • 打赏
  • 举报
回复
string ls_colname
ls_colname="abc"
dw.modify("xxxx_t.text='"+ls_colname+"'")
jiazhij 2002-04-10
  • 打赏
  • 举报
回复
应该有列的定义方式
不能用string()转换吗?
我是菜鸟很多东西不懂

不可以使用列号吗?

n_column=integer(dw.Object.DataWindow.Column.Count)

609

社区成员

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

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