Comment

From VSI OpenVMS Wiki
Revision as of 06:40, 19 December 2018 by Darya.zelenina (talk | contribs) (Created page with "A '''comment''' is a command line or part of a command line in DCL that is ignored by the CLI. Comments are marked with an exclamation point (!). =Example= Consider the f...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

A comment is a command line or part of a command line in DCL that is ignored by the CLI. Comments are marked with an exclamation point (!).

Example

Consider the following command procedure, TEST.COM:

$ show time !This comment is ignored
$! This entire line is ignored as well
 

Here is the result of running it:

$ @test
  19-DEC-2018 11:19:38
 

Use

The most important and obvious way to use comments is documenting a command procedure:

$  !  Copyright (c) 1987 Digital Equipment Corporation.  All rights reserved.
$  !
$  !  MONITOR.COM  (Generate MONITOR recording file)
$  !
$  !  This command file is to be placed in a cluster-accessible
$  !  directory called SYS$MONITOR. At system startup time, for each
$  !  node, it creates in SYS$MONITOR a MONITOR recording file, which
$  !  is updated throughout the life of the boot. It also creates in
$  !  MON$ARCHIVE, a summary file from the recording file of the
$  !  previous boot, along with a copy of that recording file.
$  !  Logical name definitions for both cluster-accessible directories,
$  !  SYS$MONITOR and MON$ARCHIVE, must be included in SYSTARTUP.COM.
$  !
 

Another use of comments is disabling a command line that is not needed now but may be needed in the future:

$! Uncomment the following command to start the OpenVMS Management
$! Station server application.
$!
$!$ @SYS$STARTUP:TNT$STARTUP