HP 3000 Manuals

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


VIRTUOSO CODE GENERATOR Reference Manual

#section 

Defines a section of text in which generated text may be placed.

Syntax 

     #section name="section-name"

Keywords 

section-name     is the name of the section being defined.  The name is
                 limited to 32 characters in length and must conform to
                 the same naming restrictions as keywords.

Description 

You can use this construct to define places in the program at which to
reposition text generated elsewhere.  These sections let you control the
ordering of the generated text.  This construct is closely tied to the
#entry construct which directs the generator to place a block of text in
a section defined by #section.  Within the designated section, the
entries are placed alphabetically by entry name.  Refer to the #entry
construct for more information.

The #section and #entry constructs allow you to generate blocks of text
from many different locations in the Virtuoso source file and still
ensure that these blocks of text all appear in the same place in the
generated output.  For example, many different macros might place entries
in the Working-Storage section.  These macros might appear in the
Procedure Division before or after the GOBACK statement.  However,
all the entries from the macros would still be generated in the
Working-Storage section and would appear in alphabetical order by entry
name.  Thus, the #section and #entry constructs allow a great deal of
flexibility and control during code generation.  In fact, the #section
construct can be used within the #entry construct providing that a
stand-alone #section is eventually defined for placement of the text.

Examples 

EXAMPLE 1

     #entry name="ent1ofsec1" section="sec1"
     This is from ent1ofsec1
     #endentry

     #entry name="ent1ofsec2" section="sec2"
     #section name="sec1"
     This is from ent1ofsec2
     #endentry

     #section name="sec2"

The above example illustrates how to use the #section construct within an
#entry definition.  The information associated with the first #entry is
assigned to section 1.  This same information is then added to entry 2
and assigned to section 2.  Finally, the combined text from section 2 is
placed in the program at the point where the #section construct appears.
Note that the stand- alone #section is required in order to place the
accumulated entries into the program at the specified point.

See the #entry construct description for examples of the use of #section
and #entry.



MPE/iX 5.0 Documentation