----^--->
/\

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

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

ESC

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

 

Library
Resources

Constants | Functions | GlobalSwitches | GuardNotes | Command Shorthand | MountCommands | Procedures
Functions   CENTER | DEQUOT | ESC | FCOUNT | LEN | PAD | SCOUNT | SEQNUM | WAITFOR

$ESC (Escapify the contents of a variable)

Description

Reformats the contents of a variable by adding escape characters.  This allows CommandSymbols such as <>|&^() to be manipulated and displayed literally by commands such as ECHO, FOR, etc.

Syntax

At the Command Prompt (library IS NOT initialized)

C:\>NTCmdLib $ESC VariableName

At the Command Prompt (library IS initialized)

C:\>L $ESC VariableName

In a Script (library IS NOT initialized)

CALL NTCmdLib $ESC VariableName

In a Script (library IS initialized)

%.Call% $ESC VariableName

Parameters and Switches

VariableName   The name of the environment variable containing the string to be processed.

Errorlevels, Output Variables and Custom Mount/\Commands

Name

 

Value

  Description/Contents

_ESC

 

escaped string

  The escaped output of VariableName's contents

 

ErrorLevel

 

Description/Contents

0

  Success

2

  Missing or invalid parameter

Examples, Notes and Instructions

  •     NTCmdLib $ESC var

        if          var=<title>Home Page</title>

    then        _ESC=^<title^>Home Page^</title^>

 

  • The contents of VariableName CANNOT BE outer quoted. Balanced
    inner quotes are OK. For example:

    var="<title>Home Page</title>"
    {IS BAD}

    var=<title>"Home Page"</title>
    {IS OK}

    For multiple layers of "escapification", re-call using the previous output:

    NTCmdLib $ESC _ESC
       
    {adds a second level of escaping}

Notes

  • Output is displayed to STDOUT, errors to STDERR
  • To suppress console display, use the library GlobalSwitch /Quiet (or simply /q)

    NTCmdLib /Q TaskID /TaskSwitches Parameters

    CALL NTCmdLib /Q TaskID /TaskSwitches Parameters

    %.Call% /Q TaskID /TaskSwitches Parameters


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

Resource

  Short Description
     

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

Functions   CENTER | DEQUOT | ESC | FCOUNT | LEN | PAD | SCOUNT | SEQNUM | WAITFOR

/\
//\\
//
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\