0

I tried the below code :

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.

Expecting field dtoday to now have a column-label of dg 77 but it's still dg, I need this to add week numbers to the standard column-labels of a spreadsheet I am creating.

Any help gratefully receieved :)

doydoy44
  • 5,720
  • 4
  • 29
  • 45
NinjaWfc
  • 11
  • 1
  • 2

2 Answers2

0

This feels like a fault. It does not appear to work when overriding it on the temp-table.

If you define your field in a frame before display then you can overide it there.

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

That may or not help depending on what you are doing.

  • Thanks for taking the time to respond, I need to be able to set it in the temp-table as this is then being passed to the program that creates the multi-tabbed spreadsheet. – NinjaWfc Dec 10 '12 at 08:42
0

Is it possible to dynamically create the temp table? if so you can dynamically set it there

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.

if not you can just pull the column-label from the buffer instead

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.
joeg1ff
  • 161
  • 2