HP 3000 Manuals

IMPLEMENT [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

IMPLEMENT 

This reserved word indicates the beginning of the internal part of a
MODULE. The IMPLEMENT section may be empty or it may contain declarations
of the constants, types, variables, procedures, and functions that are
only used within the module.  In addition, it contains the bodies of the
procedures and functions whose headings appeared in the EXPORT section.
A module does not have to export procedures or functions.  It may be used
simply to create data or data types.  In such a case, there will be
nothing between the words IMPLEMENT and END. That is, every module must
have an IMPLEMENT section, but it may be empty.

Example 

     MODULE A_module;

     EXPORT                                      { Exported Type              }
        TYPE
           byte = 0..255;

        FUNCTION check (i:byte):Boolean;         { Exported Function          }

     IMPLEMENT                                   { Start of implement section }

     IMPORT stdoutput;

        FUNCTION check (i: byte;): Boolean;

        BEGIN

           IF i > 127 THEN
              BEGIN
                check := false;
                IF flag THEN
                  writeln (error);
              END
           ELSE
               check := true;
        END;

     FUNCTION control (i: byte; flag: Boolean):Boolean; {Exported function}

       BEGIN
         control := check (i,flage) AND (i < 32);
       END;

     END.



MPE/iX 5.0 Documentation