数据窗口标题排序

kiddy111 2007-04-03 10:34:20
我找了一段代码,但运行不成功,麻烦各位大虾帮看一下
string ls_object_name, ls_object_type,ls_cur_col
string is_oldsort,is_oldcol



if row = 0 and this.describe(ls_object_name + ".band") = "header" and &
this.describe(ls_object_name + ".text") <> "!" then
ls_cur_col = left(ls_object_name , len(ls_object_name) - 2)
if ls_cur_col <> is_oldcol then
this.modify("destory p_sort")

is_oldcol = ls_cur_col
this.setsort("ls_cur_col, A")
is_oldsort = "A"
this.sort()
else
if is_oldsort = "A" then
this.setsort("ls_cur_col, D")
is_oldsort = "D"
else
this.setsort("ls_cur_col, A")
is_oldsort = "A"
end if
this.sort()
end if
end if
...全文
205 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
doodle 2007-04-03
  • 打赏
  • 举报
回复
string is_oldsort,is_oldcol//这两个是实例变量 应该定义在实例变量区
你也没说明白问题出在哪里 设断点调试一下
liubocy 2007-04-03
  • 打赏
  • 举报
回复
实例变量 string is_oldsort,is_oldcol

数据窗口Clicked()代码:
string ls_object_name, ls_object_type,ls_cur_col

IF row = 0 THEN
ls_object_name = dwo.name
IF This.describe(ls_object_name + ".band") = "header" and &
This.describe(ls_object_name + ".text") <> "!" THEN
ls_cur_col = left(ls_object_name , len(ls_object_name) - 2)
IF ls_cur_col <> is_oldcol THEN
this.modify("destroy t_"+is_ordercol)
is_oldcol = ls_cur_col
is_oldsort = "D"
ELSE
IF is_oldsort = "A" THEN
is_oldsort = "D"
ELSE
is_oldsort = "A"
END IF
END IF
This.setsort(ls_cur_col + " " + is_oldsort)
This.sort()
END IF
END IF
--------------------------------------------------------------------

注意标题的名称是对应字段的名称+‘_t’,到不是一定要‘_t’,长度2位就可以

1,076

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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