description of using the CLASS_S attribute. 4 IMMEDIATE The IMMEDIATE attribute causes a formal parameter value in a routine declaration to be passed by immediate value. See the "HP Pascal Language Reference Manual" for the complete description of using the IMMEDIATE attribute. 4 REFERENCE The REFERENCE attribute causes the formal parameter in a routine to be passed by reference using foreign parameters. See the "HP Pascal Language Reference Manual" for the complete description of using the REFERENCE attribute. 3 PEN_CHECKING_STYLE The PEN_CHECKING_STYLE attribute selects the desired compile-time and link-time checking to perform when the generate environment file is inherited. PEN_CHECKING_STYLE( option ) COMPILATION_TIME Uses the compilation time of the environment file in all subsequent compile-time and link-time checking for users of this environment file. This is the default. IDENT_STRING Uses the [IDENT()] string of the environment file in all subsequent compile-time and link-time checking for users of this environment file. NONE Disables all compile-time and link-time checking for users of this environment file. 3 POS POS forces the field (of a packed or unpacked record) to a specific bit position within the record. Syntax: POS( n ) The constant expression 'n' specifies the bit location, relative to the beginning of the record, at which the field begins. See the "HP Pascal Language Reference Manual" for the complete description of using the POS attribute. 3 READONLY The READONLY attribute specifies that an object can be read by a program, but cannot have values assigned to it. See the "HP Pascal Language Reference Manual" for the complete description of using the READONLY attribute. 3 Size Size attributes indicate the amount of storage to be reserved for the object. 4 BIT The BIT attribute specifies the amount of storage in bits to be received by the object. Syntax: BIT [[( n )]] The optional constant 'n' indicates the number of bit storage units. It must denote a positive integer. If you omit n, the default value is 1. See the "HP Pascal Language Reference Manual" for the complete description of using the BIT attribute. 4 BYTE The BYTE attribute specifies the amount of storage in bytes to be received by the object. Syntax: BYTE [[( n )]] The optional constant 'n' indicates the number of byte storage units. It must denote a positive integer. If you omit 'n', the default value is 1. See the "HP Pascal Language Reference Manual" for the complete description of using the BYTE attribute. 4 WORD The WORD attribute specifies the amount of storage in words to be received by the object. Syntax: WORD [[( n )]] The optional constant 'n' indicates the number of word storage units. It must denote a positive integer. If you omit n, the default value is 1. See the "HP Pascal Language Reference Manual" for the complete description of using the WORD attribute. 4 LONG The LONG attribute specifies the amount of storage in longwords to be received by the object. Syntax: LONG [[( n )]] The optional constant 'n' indicates the number of longword storage units. It must denote a positive integer. If you omit 'n', the default value is 1. See the "HP Pascal Language Reference Manual" for the complete description of using the LONG attribute. 4 QUAD The QUAD attribute specifies the amount of storage in quadwords to be received by the object. Syntax: QUAD [[( n )]] The optional constant 'n' indicates the number of quadword storage units. It must denote a positive integer. If you omit 'n', the default value is 1. See the "HP Pascal Language Reference Manual" for the complete description of using the QUAD attribute. 4 OCTA The OCTA attribute specifies the amount of storage in octawords to be received by the object. Syntax: OCTA [[( n )]] The optional constant 'n' indicates the number of octaword storage units. It must denote a positive integer. If you omit 'n', the default value is 1. See the "HP Pascal Language Reference Manual" for the complete description of using the OCTA attribute. 3 TRUNCATE The TRUNCATE attribute indicates that an actual parameter list for a routine can be truncated at the point that the attribute was specified. This attribute can be specified on a formal parameter in a routine declaration, and can be used with the PRESENT function. See the "HP Pascal Language Reference Manual" for the complete description of using the TRUNCATE attribute. 3 UNBOUND The UNBOUND attribute specifies that a routine does not access automatic variables outside the scope in which it is declared. That is, the bound procedure value of an unbound routine does not include the static scope pointer. This attribute can be applied to routines and formal routine parameters. See the "HP Pascal Language Reference Manual" for the complete description of using the UNBOUND attribute. 3 UNSAFE The UNSAFE attribute indicates that an object can accept values of any type without type checking. The exact properties of an unsafe object depend on the object's machine representation. See the "HP Pascal Language Reference Manual" for the complete description of using the UNSAFE attribute. 3 VALUE The VALUE attribute causes the variable to be a reference to an external constant or to be the defining point of a global constant. See the "HP Pascal Language Reference Manual" for the complete description of using the VALUE attribute. 3 Visibility The visibility attributes indicate the ability of an object to be shared by compilation units. 4 LOCAL The LOCAL attribute indicates that an object is unavailable to other independently compiled units. By default, all variables and routines are local. See the "HP Pascal Language Reference Manual" for the complete description of using the LOCAL attribute. 4 GLOBAL The GLOBAL attribute provides a strong definition of a variable or routine so that other independently compiled units can refer to it. Syntax: [GLOBAL] or, [GLOBAL(idenifier)] or, [GLOBAL('string-literal')] The 'identifier' is the name of the identifier passed to the linker. It is passed in uppercase on OpenVMS systems. If you omit the identifier, the name of the variable is used. The 'string-literal' is a specified string literal that is passed unmodified to the linker. See the "HP Pascal Language Reference Manual" for the complete description of using the GLOBAL attribute. 4 EXTERNAL The EXTERNAL attribute indicates a variable or routine that is assumed to be global in another independently compiled unit. Syntax: [EXTERNAL] or, [EXTERNAL(identifer)] or, [EXTERNAL('string-literal')] The 'identifer' is the name of the identifier passed to the linker. It is passed in uppercase on OpenVMS systems. If you omit the identifier, the name of the variable is used. The 'string-literal' passes a specified string-literal to the linker unmodified. 4 WEAK_EXTERNAL The WEAK_EXTERNAL attribute specifies that a variable or routine is not critical to the linking operation. To resolve a weak reference, the linker searches only the named input modules. You can specify an identifier with this attribute to indicate the name by which the corresponding object is known to the linker. Syntax: [WEAK_EXTERNAL] or, [WEAK_EXTERNAL(identifier)] or, [WEAK_EXTERNAL('string-literal')] The 'identifier' is the name of the identifier passed to the linker. If you omit the identifier, the name of the variable is used. The 'string-literal' is the name of the string literal that is passed to the linker unmodified. Compilation units cannot have the EXTERNAL or WEAK_EXTERNAL attribute. 4 WEAK_GLOBAL The WEAK_GLOBAL attribute specifies that an object is linked only when it is specifically included in the linking operation. To resolve a weak reference, the linker searches only the named input modules. You can specify an identifier to indicate the name by which the corresponding object is known to the linker. Syntax: [WEAK_GLOBAL] or, [WEAK_GLOBAL(identifier)] or, [WEAK_GLOBAL('string_literal')] The 'identifier' is the name of the identifier passed to the linker. If you omit the identifier, the name of the variable is used. The 'string-literal' passes a specified string literal to the linker unmodified. See the "HP Pascal Language Reference Manual" for the complete description of using the WEAK_GLOBAL attribute. 3 VOLATILE The VOLATILE attribute indicates to the compiler that the value of an object is subject to change at unusual points in program execution. Normally, during execution, an object's value generally changes only when another value is assigned to it, when it is passed as a writeable VAR parameter, when it is read into by a READ, READLN, or READV procedure, or when it is used as the control variable of a FOR loop. In addition, the compiler expects to evaluate the object only when it appears in an expression. The value of a volatile object may change as the result of an action not directly specified in the program. Thus, the compiler assumes that the value of a volatile object can be changed or evaluated at any time during program execution. Consequently, a volatile object does not participate in any optimization based on assumptions about its value. The behavior of many device registers, and modifications by asynchronous processes and exception handlers, are two examples that demonstrate volatile behavior. See the "HP Pascal Language Reference Manual" for the complete description of using the VOLATILE attribute. 3 WRITEONLY The WRITEONLY attribute specifies that an object can have values assigned to it but cannot be read by a program. See the "HP Pascal Language Reference Manual" for the complete description of using the WRITEONLY attribute. 2 Directives 3 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. 3 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. 3 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. 3 ELSE See the %IF directive for more information on how to use %ELSE. 3 ELIF See the %IF directive for more information on how to use %ELIF. 3 ENDIF See the %IF directive for more information on how to use %ENDIF. 3 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 3 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,... ) 3 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,... ) 3 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,... ) 3 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,... ) 3 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. 3 SYSTEM_NAME The %SYSTEM_NAME directive returns the string "OpenVMS". 3 SYSTEM_VERSION The %SYSTEM_VERSION directive returns a string containing the value of the SYI$_VERSION itemcode from the $GETSYI system service. 3 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. 3 COMPILER_VERSION The %COMPILER_VERSION directive returns a string containing the version of the VSI Pascal compiler performing the compilation. 3 LINE The %LINE directive returns an integer that denotes the current line number in the source file. 3 FILE The %FILE directive returns a string containing the file name that is currently being compiled. 3 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. 3 MODULE The %MODULE directive returns a string containing the name of the MODULE/PROGRAM being compiled. 3 IDENT The %IDENT directive returns a string that contains the ident string of the compilation. The ident string is set with the IDENT attribute. 3 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. 3 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. 3 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 3 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 3 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 3 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 2 Comments Comments document the actions or elements of a program. The text of a comment can contain any ASCII character except a nonprinting control character, such as an ESCAPE character. You can place comments anywhere in a program that white space can appear. You signify a comment with braces or with a parenthesis and asterisk pair, as follows: Example: { This is a comment } (* This is also a comment *) VSI Pascal allows you to mix the two symbol pairs in one comment, as follows: { The delimiters of this comment do not match. *) (* VSI Pascal allows you to mix delimiters in this way. } VSI Pascal does not allow you to nest comments. The following example causes a compile-time error because the comment ends at the first closing delimiter (}). Example The following is illegal: (* Comments can not be nested { in VSI Pascal } within a program *) 2 Release_Notes Please refer to SYS$HELP:PASCAL%%%.RELEASE_NOTES for VSI Pascal release notes.