The following code can be customised to requirement. This code example provides the fields and indexes of a given table in the Database Schema.
DEFINE VARIABLE vIdxflags AS CHARACTER NO-UNDO.
REPEAT WITH SIDE-LABELS ATTR:
PROMPT-FOR _file._file-name.
FIND _file USING _file-name NO-LOCK.
DISPLAY _file-name.
FOR EACH _field OF _file NO-LOCK:
DISPLAY
_field._field-name FORMAT "x(25)"
_field._data-type FORMAT "x(10)"
_field._initial LABEL "INIT" FORMAT "x(4)"
_field._format FORMAT "x(30)"
_field._label FORMAT "x(30)"
WITH NO-BOX WIDTH 150.
END.
FOR EACH _index OF _file,
EACH _index-field OF _index NO-LOCK:
FIND _field OF _index-field NO-ERROR.
IF AVAILABLE (_field) THEN
ASSIGN vIdxflags = (IF RECID(_Index) EQ _File._Prime-Index THEN "p" ELSE "")
+ (IF _Index._Unique THEN "u" ELSE "")
+ (IF _Index._Wordidx EQ 1 THEN "w" ELSE "").
DISPLAY
_index-Name FORMAT "X(15)"
_index-seq
vIdxflags
_field-name FORMAT "X(30)"
WITH NO-BOX WIDTH 150.
END.
RELEASE _file.
END.