----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

Rem

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

Types of
.Mount/\Commands

.CrystalClear | .ExactName | .ExitELn | .GetValue | .ifCondition | .ifELn | .IsPattern | .ListValue | .NetValue | .NowValue | .RedirRapids | .ReliableReporting | .RestoreValue | .SetELn | .ValueEcho

CrystalClear
Series

  AppendTempFile | Call | CheckTempFile | ClearTempFile | DeleteMe | DeleteTempFile | ForAll | ForExpand | HideComments | HideTempFile | MarkTempFile | ReadTempFile | Rem | ShowComments | ShowTempFile | SortTempFile | SwitchesList | TouchTempFile | Wait | WriteTempFile

.Rem

Description

  1. Allows comments to be placed anywhere in a script that a normal command would be accepted.
  2. Overcomes the limitations of the built-in REM command as well as commonly used alternatives such as ":: Comment".
  3. Can be dynamically redefined to let comments be displayed for testing or clarity of execution.

Syntax

%.Rem%   Optional Text

Parameters and Switches

Optional Text

  Optional comment (display can be toggled on or off with .ShowComments and .HideComments)

Errorlevels and Output Variables

n/a

           

Examples, Notes and Instructions

REM_Demo.cmd

01. @ECHO OFF
02. SETLOCAL ENABLEEXTENSIONS
03.
04.
IF /I "%1"=="REM"  GOTO:CASE1
05. IF /I "%1"=="::"   GOTO:CASE2
06. IF /I "%1"==".Rem" GOTO:CASE3
07.
08. ECHO:REM_Demo [ REM ^| :: ^| .Rem ]
09. %.ExitEL1%
10.
11. :CASE1
12.
13.    %.DashLine%
14.
    ECHO:[internal REM command]
15.    %.DashLine%
16.

17.    FOR %%A IN (1 2 3) DO (
18.       (
ECHO:[%%A] Before the remarked line)
19.       (REM [%%A] ***EMBEDDED COMMENT***)
20.       (
ECHO:[%%A] After the remarked line)
21.    )
22.
23.    GOTO:FINISH
24.
25. :CASE2
26.
27.    %.DashLine%
28.    ECHO:[Commonly used :: technique]
29.
   %.DashLine%
30.
31.    FOR %%A IN (1 2 3) DO (
32.       (
ECHO:[%%A] Before the remarked line)
33.       (:: [%%A] ***EMBEDDED COMMENT***)
34.       (
ECHO:[%%A] After the remarked line)
35.    )
36.
37.
   GOTO:FINISH
38.
39. :CASE3
40.
41.    %.DashLine%
42.    ECHO:[Mount/\Command .Rem]
43.
   %.DashLine%
44.
45.    FOR %%A IN (1 2 3) DO (
46.       (
ECHO:[%%A] Before the remarked line)
47.       (%.Rem% [%%A] ***EMBEDDED COMMENT***)
48.       (
ECHO:[%%A] After the remarked line)
49.    )
50.
51.
   GOTO:FINISH
52.
53. :FINISH
54.
55.    %.UnderLine%
56.    %.dtEcho% End of Script [%~nx0]
57.    %.ExitEL0%

NT
2K
XP
K3
C:\GuardPost>REM_Demo
REM_Demo [ REM | :: | .Rem ]

C:\GuardPost>REM_Demo REM
-----------------------------------------------------------------------------
[internal REM command]
-----------------------------------------------------------------------------
The syntax of the command is incorrect.
C:\GuardPost>REM_Demo ::
-----------------------------------------------------------------------------
[Commonly used :: technique]
-----------------------------------------------------------------------------
[1] Before the remarked line
The filename, directory name, or volume label syntax is incorrect.
[2] Before the remarked line
The filename, directory name, or volume label syntax is incorrect.
[3] Before the remarked line
The filename, directory name, or volume label syntax is incorrect.
_____________________________________________________________________________
[Mon 03/17/2003 05:39:08] End of Script [REM_Demo.cmd]

C:\GuardPost>REM_Demo .Rem
-----------------------------------------------------------------------------
[Mount/\Command .Rem]
-----------------------------------------------------------------------------
[1] Before the remarked line
[1] After the remarked line
[2] Before the remarked line
[2] After the remarked line
[3] Before the remarked line
[3] After the remarked line
_____________________________________________________________________________
[Mon 03/17/2003 05:39:17] End of Script [REM_Demo.cmd]

C:\GuardPost>%.ShowComments%

C:\GuardPost>REM_Demo .Rem
-----------------------------------------------------------------------------
[Mount/\Command .Rem]
-----------------------------------------------------------------------------
[1] Before the remarked line
         [1] ***EMBEDDED COMMENT***
[1] After the remarked line
[2] Before the remarked line
         [2] ***EMBEDDED COMMENT***
[2] After the remarked line
[3] Before the remarked line
         [3] ***EMBEDDED COMMENT***
[3] After the remarked line
_____________________________________________________________________________
[Mon 03/17/2003 05:39:32] End of Script [REM_Demo.cmd]

C:\GuardPost>%.HideComments%

C:\GuardPost>REM_Demo .Rem
[Mount/\Command .Rem]
-----------------------------------------------------------------------------
[1] Before the remarked line
[1] After the remarked line
[2] Before the remarked line
[2] After the remarked line
[3] Before the remarked line
[3] After the remarked line
_____________________________________________________________________________
[Mon 03/17/2003 05:39:54] End of Script [REM_Demo.cmd]

C:\GuardPost>

  • Output is displayed to STDOUT

Related .Mount/\Commands, #Constants, $Functions, :Procedures

Resource

  Short Description
.ShowComments   Toggles the display of all lines that have been commented using .Rem.
.HideComments   Reverses the effect of .ShowComments (this is the default setting).

 

K

E

Y

Common Commands INTERNAL External /SWITCH Parameter Help text AddonTool
Mounted Commands .Mount/\Command CmdShorthand #Constant $FUNCTION :Procedure !GuardNote
Operating Systems NT/2K/XP/K3 NT Only NT/2K 2K Only 2K/XP XP Only XP/K3 K3 Only 2K/XP/K3

CrystalClear
Series

  AppendTempFile | Call | CheckTempFile | ClearTempFile | DeleteMe | DeleteTempFile | ForAll | ForExpand | HideComments | HideTempFile | MarkTempFile | ReadTempFile | Rem | ShowComments | ShowTempFile | SortTempFile | SwitchesList | TouchTempFile | Wait | WriteTempFile
/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright © 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\