VMS Help  —  PASCAL  Directives

1  –  INCLUDE

  The %INCLUDE directive inserts the contents of  a  file  at  the
  location  of  the  directive  in  the code and has the following
  form:

  Syntax:

  %INCLUDE 'file-spec [[/[[NO]]LIST]]'

  The 'file-spec' is the name of the file to be included.

  The /LIST qualifier indicates that the included file  should  be
  printed  in  the  listing  of  the program if a listing is being
  generated.  If not specified, the default is determined  by  the
  use  of  compilation  switches.  Use of this parameter overrides
  compilation switches.

  See the "HP Pascal Language Reference Manual" for  the  complete
  description of using the %INCLUDE directive.

2  –  DICTIONARY

  The %DICTIONARY directive  allows  access  to  data  definitions
  stored  in  the  CDD/Repository, which is a product that must be
  purchased  separately  and  may  not  be   available   on   your
  environment.

  Syntax:

     %DICTIONARY 'cdd-path-name [[/[[NO]]LIST]]'

  The 'cdd-path-name' is a character string  that  represents  the
  full  or  relative  path  name of a CDD record description to be
  extracted.  The resulting path name must conform  to  the  rules
  for forming CDD path names.

  A full path name is one that begins with CDD$TOP  and  specifies
  the  names  of all its descendants; it is a complete path to the
  record definition.  Descendant names  are  separated  from  each
  other by a period.

  A relative path name  begins  with  any  generation  other  than
  CDD$TOP,  and  specifies the names of the descendants after that
  point.  You can create a relative path by establishing a default
  directory with a logical name.

  The /LIST qualifier indicates  that  the  included  declarations
  should  be printed in the listing of the program if a listing is
  being generated.  If not specified, the default is determined by
  compilation   switches.    Use   of   this  parameter  overrides
  compilation switches.

  Example:
     TYPE
        %DICTIONARY 'CDD$TOP.CORPORATE.SALARY_RANGE'

  The definition of 'CDD$TOP.CORPORATE.SALARY_RANGE' is placed  in
  a program at the position of the TYPE declaration.

3  –  TITLE and SUBTITLE

  The %TITLE and %SUBTITLE  directives  allow  you  to  specify  a
  compile-time   string  expression  for  the  listing  title  and
  subtitle lines.

  Syntax:

     %TITLE 'character string'
  or
     %SUBTITLE 'character string'

  The compiler listing header includes the  %TITLE  and  %SUBTITLE
  strings  in  the  title  and  subtitle  sections.  If you do not
  specify these directives, VSI Pascal fills the %TITLE field with
  blanks  and the first %SUBTITLE field with 'source listing'.  If
  a specified 'character  string'  is  too  long  to  fit  in  the
  predefined  title  and  subtitle  sections,  the  string will be
  truncated on the right without warning.

  If a %TITLE directive appears on the first line of  a  page,  it
  sets the title area for the current page and any following pages
  until the compiler encounters another %TITLE directive.  If  the
  %TITLE  directive  does  not appear on the first line of a page,
  then the title area is not set until the next page.

  The %SUBTITLE directive affects only the subtitle  area  in  the
  source listing section.  If a %SUBTITLE directive appears on the
  first or second line of a page, then the subtitle  area  is  set
  for  the  current  page.   If  the  %SUBTITLE directive does not
  appear in the first two lines of a page, then the subtitle  area
  is not set until the next page.

  On OpenVMS VAX, if either of these directives is used and  if  a
  listing  is  being  generated,  HP  Pascal  generates a table of
  contents page by  default.   This  page  appears  first  in  the
  listing,  preceding  the source listing section.  To disable the
  table of contents option, you must use a compilation switch.

4  –  IF

  The %IF family of directives (%IF, %ELSE, %ELIF, %ENDIF) is used
  to  conditionally  compile  specific  sections  of  source code.
  These directives are useful if you  need  to  compile  the  same
  source code for various configurations or environments.

    %IF compile-time-expression
    %THEN
        Pascal tokens ...
    [%ELIF compile-time-expression
     %THEN
         Pascal tokens ... ] ...
    [%ELSE
         Pascal tokens ... ]
    %ENDIF

  A %IF directive can have zero or more %ELIF parts  and  zero  or
  one %ELSE parts.

  %IF directives can be nested up to 32 deep.

  Note that skipped sections of source code must  still  be  valid
  VSI  Pascal  tokens.   The  skipped  tokens  are  not  processed
  semantically by the compiler.

  The compile-time expression for the %IF and %ELIF directives  is
  the  same  compile-time  expression that can be used anywhere in
  VSI Pascal.

  The /CONSTANT DCL qualifier can be used together  with  the  %IF
  directive to control the conditional processing from the command
  line.

5  –  ELSE

  See the %IF directive for more information on how to use %ELSE.

6  –  ELIF

  See the %IF directive for more information on how to use %ELIF.

7  –  ENDIF

  See the %IF directive for more information on how to use %ENDIF.

8  –  DEFINED

  The %DEFINED directive take a name and returns TRUE if the  name
  has a meaning in the current scope; otherwise it returns FALSE.

    %IF NOT %DEFINED(MaxSize)
    %THEN
       CONST MaxSize = 100;
    %ENDIF

9  –  ERROR

  The %ERROR directive accepts one or more string expressions  and
  at compile-time will generate a compiler error that includes the
  concatenation of the string expressions.

    %ERROR( string-expression,... )

10  –  WARN

  The %WARN directive accepts one or more string  expressions  and
  at  compile-time  will generate a compiler warning that includes
  the concatenation of the string expressions.

    %WARN( string-expression,... )

11  –  INFO

  The %INFO directive accepts one or more string  expressions  and
  at  compile-time  will  generate  a  compiler informational that
  includes the concatenation of the string expressions.

    %INFO( string-expression,... )

12  –  MESSAGE

  The %MESSAGE directive accepts one or  more  string  expressions
  and  at  compile-time  will  generate  a  compiler  message that
  includes the  concatenation  of  the  string  expressions.   The
  message is generated directly from the compiler and does not use
  the OpenVMS error message service $PUTMSG.

    %MESSAGE( string-expression,... )

13  –  ARCH_NAME

  The %ARCH_NAME directive returns the string "VAX",  "Alpha",  or
  "IA64"  depending on the architecture of the system on which the
  compilation is taking place.

14  –  SYSTEM_NAME

  The %SYSTEM_NAME directive returns the string "OpenVMS".

15  –  SYSTEM_VERSION

  The %SYSTEM_VERSION directive returns a  string  containing  the
  value  of  the  SYI$_VERSION  itemcode  from  the $GETSYI system
  service.

16  –  DATE and TIME

  The %DATE directive returns a string containing the date at  the
  beginning point of the compilation.

  The %TIME directive returns a string containing the time at  the
  beginning point of the compilation.

17  –  COMPILER_VERSION

  The %COMPILER_VERSION directive returns a string containing  the
  version of the VSI Pascal compiler performing the compilation.

18  –  LINE

  The %LINE directive returns an integer that denotes the  current
  line number in the source file.

19  –  FILE

  The %FILE directive returns a string containing  the  file  name
  that is currently being compiled.

20  –  ROUTINE

  The %ROUTINE directive returns a string with  the  name  of  the
  routine  that  is  currently  being  compiled.   If  used in the
  executable portion of a program, the program's name is returned.
  If used in the declaration section of a MODULE/PROGRAM, the name
  of the MODULE/PROGRAM is returned.

21  –  MODULE

  The %MODULE directive returns a string containing  the  name  of
  the MODULE/PROGRAM being compiled.

22  –  IDENT

  The %IDENT directive returns a string that  contains  the  ident
  string  of  the  compilation.   The ident string is set with the
  IDENT attribute.

23  –  FLOAT

  The %FLOAT directive returns a string that indicates the current
  floating  point default of the compilation.  The possible values
  are "VAX_FLOAT" or "IEEE_FLOAT" depending on the setting of  the
  /FLOAT DCL qualifier or the [FLOAT] module-level attribute.

24  –  F_FLOAT

  The  %F_FLOAT  directive  produces  a  VAX  F_floating   literal
  regardless   of  the  current  floating  point  default  of  the
  compilation.  Without the directive,  the  format  of  a  single
  precision  floating  literal  will  be  determined  based on the
  setting of the /FLOAT DCL qualifier or the [FLOAT]  module-level
  attribute.  The syntax is:

    %F_FLOAT floating-point-literal

  For example,

    lib$wait(%f_float 1.0);

  will ensure the correct floating literal for  LIB$WAIT  even  on
  OpenVMS I64 systems which default to IEEE floating format.

25  –  S_FLOAT

  The %S_FLOAT  directive  produces  an  IEEE  S_floating  literal
  regardless   of  the  current  floating  point  default  of  the
  compilation.  Without the directive,  the  format  of  a  single
  precision  floating  literal  will  be  determined  based on the
  setting of the /FLOAT DCL qualifier or the [FLOAT]  module-level
  attribute.   The  %S_FLOAT directive is not supported on OpenVMS
  VAX systems.  The syntax is:

    %S_FLOAT floating-point-literal

26  –  D_FLOAT

  The  %D_FLOAT  directive  produces  a  VAX  D_floating   literal
  regardless   of  the  current  floating  point  default  of  the
  compilation.  Without the directive,  the  format  of  a  double
  precision  floating  literal  will  be  determined  based on the
  setting of the /FLOAT DCL qualifier or the [FLOAT]  module-level
  attribute.  The syntax is:

    %D_FLOAT floating-point-literal

27  –  G_FLOAT

  The  %G_FLOAT  directive  produces  a  VAX  G_floating   literal
  regardless   of  the  current  floating  point  default  of  the
  compilation.  Without the directive,  the  format  of  a  double
  precision  floating  literal  will  be  determined  based on the
  setting of the /FLOAT DCL qualifier or the [FLOAT]  module-level
  attribute.  The syntax is:

    %G_FLOAT floating-point-literal

28  –  T_FLOAT

  The %T_FLOAT  directive  produces  an  IEEE  T_floating  literal
  regardless   of  the  current  floating  point  default  of  the
  compilation.  Without the directive,  the  format  of  a  double
  precision  floating  literal  will  be  determined  based on the
  setting of the /FLOAT DCL qualifier or the [FLOAT]  module-level
  attribute.   The  %T_FLOAT directive is not supported on OpenVMS
  VAX systems.  The syntax is:

    %T_FLOAT floating-point-literal
Close Help