从浏览和创建临时表中获取值

发布于 2025-01-06 20:45:15 字数 78 浏览 1 评论 0原文

我有一个动态浏览器。它将根据通过 UI 给出的某些输入动态填充值。

现在我想获取该浏览中显示的值并为其创建一个临时表。 请帮忙

I have a dynamic Browser.It will populate values dynamicaly based on some input given through UI.

Now i wan to get the values displayed in that Browse and make a temp-table for that.
please help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

池木 2025-01-13 20:45:15

要添加新值,您首先要在临时表中插入一个新行,然后安排更新该行。下面的代码很难看,但可以用来说明:

define temp-table tt_simple no-undo
  field id   as integer
  field name as character
  index id_idx is unique id
.

define variable r as integer no-undo.

define query q for tt_simple.

define browse b query q display tt_simple.name with 5 down.

form b with frame easy.

form
  tt_simple.name
 with
  frame updEasy
  column 30
  row 1
.

procedure newRecord:
  define input parameter initName as character no-undo.
  create tt_simple.
  assign
    r    = r + 1
    id   = r
    name = initName
  .
end.

run newRecord( "abc" ).
run newRecord( "xyz" ).

on "enter" of b in frame easy do:
  apply "entry" to tt_simple.name in frame updEasy.
  return no-apply.
end.

on "insert-mode", "CTRL-I" anywhere do:
  run newRecord( "" ).
  close query q.
  open query q for each tt_simple.
  get last q.
  apply "entry" to tt_simple.name in frame updEasy.
  return no-apply.
end.

on "go" of tt_simple.name in frame updEasy do:
  tt_simple.name = self:screen-value.
  close query q.   
  open query q for each tt_simple.
  apply "entry" to b in frame easy.
  return no-apply.
end.

on "value-changed" of b in frame easy do:
  display tt_simple.name with frame updEasy.
end.

open query q for each tt_simple.

enable tt_simple.name with frame updEasy.
enable b with frame easy.
apply "entry" to b in frame easy.

wait-for "close" of this-procedure.

To add new values you first insert a new row into the temp-table and then arrange to update that row. The following code is ugly but it may serve to illustrate:

define temp-table tt_simple no-undo
  field id   as integer
  field name as character
  index id_idx is unique id
.

define variable r as integer no-undo.

define query q for tt_simple.

define browse b query q display tt_simple.name with 5 down.

form b with frame easy.

form
  tt_simple.name
 with
  frame updEasy
  column 30
  row 1
.

procedure newRecord:
  define input parameter initName as character no-undo.
  create tt_simple.
  assign
    r    = r + 1
    id   = r
    name = initName
  .
end.

run newRecord( "abc" ).
run newRecord( "xyz" ).

on "enter" of b in frame easy do:
  apply "entry" to tt_simple.name in frame updEasy.
  return no-apply.
end.

on "insert-mode", "CTRL-I" anywhere do:
  run newRecord( "" ).
  close query q.
  open query q for each tt_simple.
  get last q.
  apply "entry" to tt_simple.name in frame updEasy.
  return no-apply.
end.

on "go" of tt_simple.name in frame updEasy do:
  tt_simple.name = self:screen-value.
  close query q.   
  open query q for each tt_simple.
  apply "entry" to b in frame easy.
  return no-apply.
end.

on "value-changed" of b in frame easy do:
  display tt_simple.name with frame updEasy.
end.

open query q for each tt_simple.

enable tt_simple.name with frame updEasy.
enable b with frame easy.
apply "entry" to b in frame easy.

wait-for "close" of this-procedure.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文