Command tools changes

Modifications to consider regarding command line tools.

This topic describes changes that may need code review.

See also new 5.01 features of commands.

fglcomp -W keywords warning option

Most keywords can be used as variable or function identifiers without any problem. However, some keywords will lead to problems:
  • Keywords used in the grammar of expression can not be used as variable or function names.
  • Keywords used as the name of primitive types can not be used as type names.
Example 1: Ambiguitie:
DEFINE date DECIMAL(10,2) = 999.99
DISPLAY date -- displays the current date as formatted string
Example 2: Syntax error:
DEFINE date_value DATE
DEFINE day INT = 999
DISPLAY day(date_value)
DISPLAY day
DISPLAY day(date_value) -- syntax error

Starting with version 5.01.06, the fglcomp compiler has a new "keywords" parameter for the -W option, that checks for symbols (variables) using a language keyword name that can lead to ambigius semantics.

The message number is -8455.

This warning option is enabled by default, and can be disabled with the "no" option prefix:
fglcomp -W no-keywords mysource.4gl

It is strongly discouraged to disable this warning.

Changes to fgldbsch

Starting with version 5.01.00, the fgldbsch tool will by default deny SQL table or column names that are not valid identifiers (like "Customer Name"), or when a table/column name is a case-insensitive duplicate of other table/column names (like "Stock" vs "STOCK").

To bypass this control and allow invalid table or column names in the .sch file, use the -sl (sloppy) option. This option has been implemented in case if an SQL table mixes valid and invalid column names, and DEFINE varname LIKE tabname.colname instructions are used with the columns using regular identifier names.

To skip problematic tables and extract valid table defintions, use the already-existing -ie (ignore errors) option.

Use the -v verbose option to get details of the database schema extraction process.

Changes in earlier versions

Make sure to check the upgrade notes of earlier versions, to not miss changes introduced in maintenance releases.