请问以下代码有何错误????

waterhua 2003-12-12 11:21:15
这是一个向子数据窗口添加数据的代码
if lower(dw_1.getcolumnname())="年" then
datawindowchild child
integer code
code=dw_1.getchild("年",child)
if code=-1 then
messagebox("","")
else
child.settransobject(sqlca)
child.retrieve()
boolean isnotin
long ll_rows
ll_rows=child.rowcount()
do while ll_rows>0
if child.getitemstring(ll_rows,"年数")<>dw_1.gettext() then
isnotin=true
// ll_rows
continue
else
isnotin=false
exit
end if
loop
if isnotin=true then
child.insertrow(0)
child.setitem(child.rowcount(),"年数",dw_1.gettext())
end if
if child.update()=1 then
commit;
else
rollback;
end if
end if
end if
...全文
20 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
waterhua 2003-12-13
  • 打赏
  • 举报
回复
为什么添加不进去啊??????
mittee 2003-12-12
  • 打赏
  • 举报
回复
ll_rows=child.rowcount()用
for i = 1 to ll_rows 不是挺好的么
wwwafa9 2003-12-12
  • 打赏
  • 举报
回复
那就更离谱了,你的ll_rows本来就大于0,你还要++,那不成了无限循环。
waterhua 2003-12-12
  • 打赏
  • 举报
回复
我运行时,显示的是没有保存的 能力,这是为什么,那个我改为了ll_row++
suzh1133 2003-12-12
  • 打赏
  • 举报
回复
do while ll_rows>0

loop

这个循环体没对ll_rows进行任何操作,如ll_rows --,你能跳出循环吗?
wwwafa9 2003-12-12
  • 打赏
  • 举报
回复
也许你的子数据窗口没有设置Update属性,看一下。
waterhua 2003-12-12
  • 打赏
  • 举报
回复
为什么显示的错误是没有保存的能力,保存的 语言有错吗?

396

社区成员

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

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