0

我尝试了以下代码:

def temp-table tt-dg1
    field dtoday as date column-label "dg "
    .

buffer tt-dg1:BUFFER-FIELD("dtoday"):
column-LABEL = buffer tt-dg1:BUFFER-FIELD("dtoday"):column-LABEL + "77".

display buffer tt-dg1:BUFFER-FIELD("dtoday"):column-LABEL.

create tt-dg1.
dtoday = today.

display tt-dg1 with frame f2.

期望字段dtoday现在有一个列标签,dg 77但它仍然是dg,我需要它来将周数添加到我正在创建的电子表格的标准列标签中。

感激地收到任何帮助:)

4

2 回答 2

0

这感觉像是一个错误。在临时表上覆​​盖它时似乎不起作用。

如果您在显示之前在框架中定义您的字段,那么您可以在那里覆盖它。

form tt-dg1.dtoday with frame f2.
tt-dg1.dtoday:label = "MyLabel".
display tt-dg1.dtoday with frame f2.

这可能会或没有帮助取决于您在做什么。

于 2012-12-07T14:28:18.537 回答
0

是否可以动态创建临时表?如果是这样,您可以在那里动态设置它

DEFINE VARIABLE ttDynTable AS HANDLE NO-UNDO.
DEFINE VARIABLE vInt       AS INTEGER NO-UNDO INIT 77.

CREATE TEMP-TABLE ttDyntable.
ttDynTable:ADD-NEW-FIELD('dtoday', 'DATE', 0, "99/99/9999",?,"","dg " + STRING(vInt)).
ttDynTable:TEMP-TABLE-PREPARE("tt-dg1").

ttTTHandle = ttDyntable:DEFAULT-BUFFER-HANDLE.
ttTTHandle:BUFFER-CREATE.
ttTTHandle::dtoday = TODAY.

DISPLAY ttTTHandle:buffer-field('dtoday'):column-label ttTTHandle::dtoday.

如果不是,您可以从缓冲区中提取列标签

DEFINE TEMP-TABLE tt-dg1 FIELD dtoday AS DATE   COLUMN-LABEL "dg ". 
DEFINE VARIABLE   vTTHandle           AS HANDLE NO-UNDO.
CREATE tt-dg1.
dtoday = TODAY.

vTTHandle = BUFFER tt-dg1:HANDLE.
vTTHandle:BUFFER-FIELD("dtoday"):column-LABEL = vTTHandle:BUFFER-FIELD("dtoday"):column-LABEL + "77".

DISPLAY vTTHandle:BUFFER-FIELD('dtoday'):COLUMN-LABEL.
于 2016-04-06T15:21:58.140 回答