HP 3000 Manuals

##option [ VIRTUOSO CODE GENERATOR Reference Manual ] MPE/iX 5.0 Documentation


VIRTUOSO CODE GENERATOR Reference Manual

#option 

Allows generator defaults to be changed to user-specified values.

Syntax 

     #option [textmode="text-mode"] [cobolindent=cobol-indent] &
     #       [macroformat="macro-format"] [subchar="char"] &
     #       [trace="trace"] [subst="substitution"] &
     #       [constructchar="constructchar"]

Keywords 

text-mode        is the type of formatting to be invoked for the
                 generated output.  The default value is COBOL. The valid
                 textmodes are:

                   COBOL
                   TEXT
                   OVERLAY

                 COBOL textmode is for generating COBOL code.  Spacing is
                 preserved in parameter replacement and lines are wrapped
                 if text extends beyond column 72 after parameter
                 replacement.  Special formatting is invoked:

                 -    Wrapped lines conform to COBOL syntax rules.
                 -    Columns 1-6 will contain generated COBOL sequence
                      numbers.
                 -    Columns 73-80 will be preserved and will be
                      appended to any extra output lines generated due to
                      line wrapping.

                 TEXT textmode provides line-level formatting.  In this
                 mode, truncation is avoided and line wrap-around is
                 provided.  Input is not forced to align; spacing is
                 preserved when replacing parameters, and appropriate
                 formatting is performed.

                 OVERLAY textmode is intended for generating columnar
                 type reporting.  Lines exceeding column 80 are not
                 wrapped to a new line, but are truncated instead.
                 Replacement text that doesn't fit into the space allowed
                 is also truncated.

cobol-indent     specifies the relative number of columns that subsequent
                 lines of COBOL code should be indented.  If an input
                 line, after parameter replacement, is too long to fit
                 within the COBOL constraint of column 72, the output
                 will be wrapped to additional lines and will be indented
                 this number of spaces.  This parameter also controls the
                 placement of multiple lines generated to properly format
                 COBOL quoted strings.  This parameter is only applicable
                 if textmode = COBOL; the default value is 4.

macro-format     is ON or OFF. If ON, text from the called macro will be
                 placed in the generated code to align with the column
                 where the macro was called.  Macro text will be indented
                 by the number of spaces between the "#" sign and the
                 macro name.  If OFF, the macro text will not be indented
                 when the macro call is indented and will placed in the
                 same output columns as it is in the macro file.  If
                 macro-format is ON and the indentation will not allow
                 for the placement of a complete word in the output line,
                 the indentation will be reset to the left margin.  If
                 textmode is OVERLAY, the line will be truncated at
                 column 80.  The default is ON.

char             is the character that is to be used when designating
                 that parameter replacement (substitution) is to be
                 performed.  By default, uses the "!" as the substitution
                 character.

trace            is ON or OFF. If ON, the first 8 characters of the
                 called macro name or include file name are printed in
                 columns 73-80 of the output file (GENOUT). This trace
                 parameter is valuable when debugging the generated
                 module.

substitution     is ON or OFF. If ON, then the listing file will show
                 substituted keywords (except "?" in #for and #getrel).
                 If OFF, then the substituted values of keywords will not
                 appear in the listing.  That is, if subst is OFF, you
                 will see !keyword, not the substituted value of the
                 keyword.  For example, if the value of the keyword was
                 "hello", you would not see "hello".  The default value
                 is OFF.

constructchar    is the character used to designate Virtuoso construct
                 and macro calls.  Only one such character can be used at
                 one time.  The default character is "#".

Description 

The parameters for the #option construct affect all of the succeeding
generated text unless changed by a later #option construct.  The
parameters textmode, macro-format, subchar, and trace can also be
specified in the :RUN string.  See Chapter 5 for more information.

The output line begins in the same column as the input line with one
exception.  If a macro is called and macroformat is ON, the text lines in
the macro are indented by the number of spaces between the "#" sign and
the macro name.  This feature is provided so that the generated COBOL
code or generated TEXT will be indented to align with the call to the
macro.

In COBOL and TEXT textmodes, if the input line, after parameter
replacement occurs, fits within the ending column constraint, (COBOL 72
and TEXT 80), the line appears in the same columns in the output file as
in the input text.  If line wrap is required, subsequent lines are
indented by the value specified by COBOLINDENT if textmode = COBOL or
will begin in the same column if textmode = TEXT.

Change the substitution character when the default substitution character
conflicts with text in the model.  For example, if "!" is a valid
character in your input text, then change the substitution character.  To
do this, specify the subchar parameter.  The substitution character must
be a single character, and it cannot be the "#" sign.

Examples 

The current substitution character may be changed using the subchar 
parameter.  The substitution character must be a single character and
cannot be the "#" sign.

EXAMPLE

     #option subchar="$"

The above example illustrates changing the substitution character from
the current substitution character to a "$" character and the following
example shows its usage.

     #let element = "name"
     #getent element="$element"

Refer to Chapter 2 for examples of formatting in COBOL, TEXT, and OVERLAY
modes and for examples of macro indentation.



MPE/iX 5.0 Documentation