ryanmckeever
New Member
Hope you are well...
I'm trying to develop a generic browse object
I want to pass it in a TT handle
It'll take this handle and build a browse exactly like it...
This works...
The problem arose when I tried to tidy the browse up.
If you look at the included code....
This will work if you copy it to a procedure editor
When you run this the message shows that the format and the label for the static TT has been ignored...The field name is correct
Does anyone know how to pick up this information?
DEFINE TEMP-TABLE ttTest
FIELD fld1 AS DEC LABEL "test"
FIELD fld2 AS CHAR FORMAT 'x(20)'
FIELD fld3 AS DATE
FIELD fld4 AS INT FORMAT '9'.
DEFINE VARIABLE hTT AS HANDLE NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
/* this just populates some data to the TT */
DO i = 1 TO 20:
CREATE ttTest.
ASSIGN
fld1 = i
fld2 = "ryan mc keever:" + STRING(i)
fld3 = TODAY - i
fld4 = i.
END.
hTT = TEMP-TABLE ttTest:handle.
RUN pcReadTT (hTT).
PROCEDURE pcReadTT:
DEFINE INPUT PARAMETER iphTT AS HANDLE.
DEFINE VARIABLE hB AS HANDLE NO-UNDO.
DEFINE VARIABLE hQ AS HANDLE NO-UNDO.
DEFINE VARIABLE iInd AS INTEGER NO-UNDO.
DEFINE VARIABLE hCol AS HANDLE NO-UNDO.
DEFINE VARIABLE hField AS HANDLE NO-UNDO.
hB = iphTT
EFAULT-BUFFER-HANDLE.
CREATE QUERY hQ.
hQ:SET-BUFFERS(hB).
hQ:QUERY-PREPARE("for each " + iphTT:NAME + " Where TRUE ").
hQ:QUERY-OPEN().
/* Loop around the fields of the buffer */
DO iInd = 1 TO hB:NUM-FIELDS:
hField = hB:BUFFER-FIELD(iInd).
/* show what these attributes are set to */
/* I want to build a browser column like this !!!!! */
MESSAGE
hField:NAME
hField:FORMAT
hField:WIDTH-CHARS
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
END.
I'm trying to develop a generic browse object
I want to pass it in a TT handle
It'll take this handle and build a browse exactly like it...
This works...
The problem arose when I tried to tidy the browse up.
If you look at the included code....
This will work if you copy it to a procedure editor
When you run this the message shows that the format and the label for the static TT has been ignored...The field name is correct
Does anyone know how to pick up this information?
DEFINE TEMP-TABLE ttTest
FIELD fld1 AS DEC LABEL "test"
FIELD fld2 AS CHAR FORMAT 'x(20)'
FIELD fld3 AS DATE
FIELD fld4 AS INT FORMAT '9'.
DEFINE VARIABLE hTT AS HANDLE NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
/* this just populates some data to the TT */
DO i = 1 TO 20:
CREATE ttTest.
ASSIGN
fld1 = i
fld2 = "ryan mc keever:" + STRING(i)
fld3 = TODAY - i
fld4 = i.
END.
hTT = TEMP-TABLE ttTest:handle.
RUN pcReadTT (hTT).
PROCEDURE pcReadTT:
DEFINE INPUT PARAMETER iphTT AS HANDLE.
DEFINE VARIABLE hB AS HANDLE NO-UNDO.
DEFINE VARIABLE hQ AS HANDLE NO-UNDO.
DEFINE VARIABLE iInd AS INTEGER NO-UNDO.
DEFINE VARIABLE hCol AS HANDLE NO-UNDO.
DEFINE VARIABLE hField AS HANDLE NO-UNDO.
hB = iphTT

CREATE QUERY hQ.
hQ:SET-BUFFERS(hB).
hQ:QUERY-PREPARE("for each " + iphTT:NAME + " Where TRUE ").
hQ:QUERY-OPEN().
/* Loop around the fields of the buffer */
DO iInd = 1 TO hB:NUM-FIELDS:
hField = hB:BUFFER-FIELD(iInd).
/* show what these attributes are set to */
/* I want to build a browser column like this !!!!! */
MESSAGE
hField:NAME
hField:FORMAT
hField:WIDTH-CHARS
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
END.