Back to Contents


Tools and Components

Summary:

See also: Installation and Setup.


fglrun

Purpose:

The fglrun tool is the runtime system program that executes p-code BDL programs.

Syntax:

fglrun [options] [ program[.42r] | module[.42m] ] [argument [...]]

Notes:

  1. options are described below.
  2. program.42r is the name of a program file linked with fgllink.
  3. module.42m is the name of a module containing the MAIN routine.
  4. argument is a program argument passed to the program, see arg_val().
  5. Note that the .42r or .42m extension is optional: if not used, fglrun will automaticall search for files with these extensions.

Options:

Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.
-i { mbcs } Displays information. -i mbcs displays information about multi-byte character set settings.
-d Start in debug mode. See Debugger for more details.
-e extfile [,...] Specify a C extension module to be loaded. This option can take a comma-separated list of extensions.
-l Link pcode nodules together, see Compiling Programs.
-o outfile Specify the output file for the link mode (-l option).
-b Displays compiler version information of the module, see Compiling Programs.
-p Generate profiling information to stderr (UNIX only). See Profiler for more details.
-M Display a memory usage diagnostic when program ends, see Optimization.
-m Check for memory leaks. If leaks are found, displays memory usage diagnostic and stops with status 1, see Optimization.
--java-option=option Passes Java runtime options when initializing the JNI interface.
See Java Interface for more details.

Usage:

This tool executes BDL programs.

fglrun myprogram.42r -x 123

For more details, see Executing FGL Programs.


fglform

Purpose:

The fglform tool compiles form specification files into XML formatted files used by the programs.

Syntax:

fglform [options] srcfile[.per]

Notes:

  1. options are described below.
  2. srcfile.per is the form specification file.
  3. The .per form file extension is optional.

Options:

Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.
-i { mbcs } Displays information. -i mbcs displays information about multi-byte character set settings.
-m Extract localized strings.
-M Write error messages to standard output instead of creating a .err error file.
-W { all } Display warning messages. Only -W all option is supported for now.
-E Preprocess only.
-p option Preprocessing control, where option can be one of:
- nopp: Disable preprocessing.
- noli: No line number information (only with -E option).
- fglpp: Use # syntax instead of & syntax.
-I path Provides a path to search for include files.
-D ident Defines the macro 'ident' with the value 1.

Usage:

This tool compiles a .per form specification file into a .42f compiled version:

fglform custform.per

The .42f compiled version is an XML formatted file used by BDL programs when a form definition is loaded with the OPEN FORM or OPEN WINDOW WITH FORM instructions.


fglmkmsg

Purpose:

The fglmkmsg tool compiles message files into a binary version used by the BDL programs.

Syntax:

fglmkmsg [options] srcfile [outfile]

Notes:

  1. options are described below.
  2. srcfile is the source message file.
  3. outfile is the destination file.

Options:

Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.
-r msgfile De-compiles a binary message file.

Usage:

This tool compiles a .msg message file into a .iem compiled version:

fglmkmsg mess01.msg

For backward compatibility, you can specify the output file as second argument:

fglmkmsg mess01.msg mess01.iem

The .iem compiled version can be used by BDL programs, for example, when the HELP clause is used in a MENU or INPUT instruction.

See message files for more details.


fglcomp

Purpose:

The fglcomp tool compiles BDL program sources files into a p-code version.

Syntax:

fglcomp [options] srcfile[.4gl]

Notes:

  1. options are described below.
  2. srcfile.4gl is the program source file.
  3. The .4gl extension is optional.

Options:

Option Description
-V or --version Display version information for the tool.
-h or --help Displays options for the tool. Short help.
-i { mbcs } Displays information. -i mbcs displays information about multi-byte character set settings.
-S Dump Static SQL statements found in the source to stdout.
-m Extract %"string" Localized Strings from source to stdout.
-M Write error messages to standard output instead of creating a .err error file.
-W what Display warning messages. For a complete description, see below.
-E Preprocess only. See Preprocessor for more details.
--timestamp Add compilation timestamp to build information in 42m header.
-p option Preprocessing control, where option can be one of:
- nopp: Disable preprocessing.
- noli: No line number information (only with -E option).
- fglpp: Use # syntax instead of & syntax.
-G Produce .c and .h globals interface files for C Extensions.
-I path Provides a path to search for include files. See Preprocessor for more details.
-D ident Defines the macro 'ident' with the value 1. See Preprocessor for more details.
--build-doc Generate source documentation.
--build-rdd Generate the .rdd data definition during compilation.
--verbose Print detailed compilation information
--java-option=option Passes Java runtime options when initializing the JNI interface.
See Java Interface for more details.

Usage:

This tool compiles a .4gl into a .42m p-code module that can be linked to other modules to create a program or a library.

fglcomp customers.4gl

If a compilation error occurs, the tool generates a file that has the .err extension, with the error message inserted at the line where the error occurred. You can change this behavior by using the -M option to display the error message to the standard output.

To create a executable program, the fgllink or fgl2p tool must be used to link the .42m compiled file with other modules.

The -W option

The -W option can be used to check for wrong language usage, that must be supported for backward compatibility. When used, this option helps to write better source code.

The argument following -W option can be one of return, unused, stdsql, print, error and all.

The -W option also supports the negative form of arguments by using the no- prefix as in: no-return, no-unused, no-stdsql. You might need to use these negative form in order to disable some warning when using the -W all option:

fglcomp -Wall -Wno-stdsql customers.4gl

The order of warning arguments is important: switches will be enabled/disabled in the order of appearance in the command line. Using the negative form of warning arguments before -W all makes no sense. 


fgllink

Purpose:

The fgllink tool assembles p-code modules compiled with fglcomp into a .42r program or a .42x library.

Syntax:

To create a library:

fgllink [options] -o outfile.42x module.42m [...]

To create a program:

fgllink [options] -o outfile.42r { module.42m | library.42x } [...]

Notes:

  1. options are described below.
  2. outfile.42r is the name of the program to be created.
  3. outfile.42x is the name of the library to be created.
  4. module.42m is a p-code module compiled with fglcomp.
  5. library.42x is the name of a library to be linked.

Options:

Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.
-o outfile.ext Output file specification, where ext can be 42r for a program or 42x for a library.
otheroption Other options are passed to fglrun for linking.

Usage:

This tool links .42m p-code modules together to create a .42x library or a .42r program file.

fgllink -o myprog.42x module1.42m module2.42m lib1.42x

Note that fgllink is just a wrapper calling fglrun with the -l option.


fgl2p

Purpose:

The fgl2p tool compiles source files and assembles p-code modules into a .42r program or a .42x library.

Syntax:

To create a library:

fgl2p [options] -o outfile.42x { pcodem.42m | srcfile.4gl } [...]

To create a program:

fgl2p [options] -o outfile.42r { pcodem.42m | srcfile.4gl | library.42x } [...]

Notes:

  1. options are described below.
  2. outfile.42r is the name of the program to be created.
  3. outfile.42x is the name of the library to be created.
  4. pcodem.42m is a p-code module compiled with fglcomp.
  5. source.4gl is a program source file.
  6. library.42x is the name of a library to be linked.

Options:

Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.
-o outfile.ext Output file specification, where ext can be 42r for a program or 42x for a library.
otheroption Other options are passed to the linker or compiler.

Usage:

This tool can compile .4gl source files and link .42m p-code modules together, to create a .42x library or a .42r program file.

fgl2p -o myprog.42x module1.4gl module2.42m lib1.42x

This tool is provided for convenience, in order to create programs or libraries in one command line. It uses the fglcomp and the fgllink tools to compile and link modules together.


fgldbsch

Purpose

The Database schema extractor is the tool provided to generate the Database Schema Files from an existing database.

Syntax:

fgldbsch -db dbname [options]

Notes:

  1. dbname is the name of the database from which the schema is to be extracted.
  2. options are described below.

Options:

Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.
-H Display long help.
-v Enable verbose mode (display information messages).
-ct Display data type conversion tables.
-db dbname Specify the database as dbname. This option is required to generate the schema files.
-dv dbdriver Specify the database driver to be used.
-un user Define the user name for database connection as user.
-up pswd Define the user password for database connection as pswd.
-ow owner Define the owner of the database tables as owner.
-cv string Specify the data type conversion rules by character positions in string.
-of name Specify output files prefix, default is database name.
-tn tabname Extract the description of a specific table.
-ie Ignore tables with columns having data types that cannot be converted.
-cu Generate upper case table and column names.
-cl Generate lower case table and column names.
-cc Generate case-sensitive table and column names.
-sc Extract shadow columns.
-st Extract system tables.
-om Run schema extractor in old fglschema mode (accepts -c and -r options)

Usage:

The fgldbsch tool extracts the schema description for any database supported by the product.

For more details about database schema extraction, see Database Schema Files.


fglmkstr

Purpose:

The fglmkstr tool compiles localized string files.

Syntax:

fglmkstr [options] source-file[.str]

Notes:

  1. options are described below.
  2. source-file is the .str string file. You can omit the file extension.

Options:

Option Description
-V Display version information for the tool.
-h Displays options for the tool. Short help.

Usage:

This tool is used to compile .str localized string files into .42s files. 

For more details, see Localized Strings.