Progress Programming Tips
By Rod Gaither (rdg@worldinfo.com)
PPT-14 Creating file and field lists for ED4W
Tip:
Another use you can put the Schema data to is generating lists of
tables, fields, and indexes for use with other development tools. In
the example below I am outputing the tables and fields for use in ED
for Windows color syntax highlighting setup. By including these lists
in the setup file for the Progress file type my table and field
references are automatically color highlighted, thus standing out
nicely from variables and other programming constructs.
---- Code insert begins ----
DEF VAR fld-list AS CHAR FORMAT "x(95)".
DEF VAR fld-type AS CHAR FORMAT "x(4)".
OUTPUT TO VALUE(SUBSTRING(dbname,1,4) + "word.txt").
PUT UNFORMATTED "; " dbname SPACE(3) TODAY SKIP(1).
PUT UNFORMATTED "; Database Table Names" SKIP "[User 5]" SKIP.
FOR EACH _file WHERE NOT _file._file-name BEGINS "_" BY
_file._file-name :
PUT UNFORMATTED _file-name SKIP.
END.
PUT UNFORMATTED SKIP(1) "; Database Field Names" SKIP "[User 6]" SKIP.
FOR EACH _field WHERE NOT _field._field-name BEGINS "_"
BREAK BY _field._field-name:
IF FIRST-OF(_field._field-name)
THEN PUT UNFORMATTED _field._field-name SKIP.
END.
OUTPUT CLOSE.
---- Code insert ends ----
I highly recommend ED4W for any programming task. Check it out
at www.getsoft.com for a trial version.
Wisdom:
When all you have is a hammer, pretty soon everything begins
to look like a nail.
Rod Gaither | rdg@worldinfo.com
World Information Systems | (910) 333-2580 Voice
Greensboro, NC | (910) 333-2584 Fax