在数据库中搜索后,如何使用progress 4gl在编辑器小部件中显示结果字段值 [英] After searching in a database how to display the result field values in an editor widget using progress 4gl

查看:118
本文介绍了在数据库中搜索后,如何使用progress 4gl在编辑器小部件中显示结果字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

接受客户编号,然后将每个订单和项目的详细信息输出到编辑器小部件. 在编辑器小部件(将editor-1作为对象名称)中显示它们.

Accept a customer number and then output the details of each order and items to an editor widget. Display them in the editor widget ( editor-1 as object name).

define temp-table ttcustomer
field custnum like customer.cust-num
field cname like customer.name
field orders like order.order-num
field items like item.item-num
field itemname like item.item-name .


find first customer WHERE customer.cust-num = input f1 NO-LOCK .

create ttcustomer . 

  assign
  ttcustomer.custnum = customer.cust-num
  ttcustomer.cname     = customer.name. 



 for each order WHERE Order.cust-num = input f1  NO-LOCK .

  assign
  ttcustomer.orders   = order.order-num.

  for each order-line where order-line.order-num = order.order-num no-lock.


     for each item where item.item-num = order-line.item-num no-lock.

     assign 
     ttcustomer.items = item.item-num
     ttcustomer.itemname = item.item-name. 
     end.
  end.
end.

推荐答案

我不知道为什么要在编辑器上显示它.因此,我假设您要将每个循环中收集的信息连接到一个编辑器中. 因此,在最后结束之后,您可以执行以下操作:

I have no idea why you would want to display that on an editor. So I'll assume you want to concatenate the info you gathered in the for each loop into an editor. So after the last end, you could do this:

define variable editor-1 as character view-as editor.
for each ttcustomer:
    assign editor-1 = editor-1 + ttcustomer.items + ' ' + ttcustomer.itemname + chr(13). 
end.
display editor-1.

如果chr(13)无法跳过一行,请尝试chr(10). PS:编辑器实际上可能不是您要显示此内容的小部件.我会用浏览器.但是由于这个问题需要编辑,所以在那里. PS2:您没有分配放置在临时表上的其他字段,因此我没有显示它们.但这只是将它们添加到上面的分配行中的问题,而不会忘记空格,破折号或您想用作分隔符的任何内容.

If chr(13) doesn't work to skip a line, try chr(10). PS: An editor is really probably not the widget you want to display this. I'd use a browse. But since the question asks for an editor, there. PS2: You didn't assign the other fields you put on the temp-table, so I'm not displaying them. But it's just a matter of adding them to the assign line above, not forgetting the spaces, dashes or whatever you'd like to use as a separator.

这篇关于在数据库中搜索后,如何使用progress 4gl在编辑器小部件中显示结果字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆