----^--->
/\

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

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

LEN

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

$LEN (Length of String)

Description

Returns the length of a variable's contents or
a "Quoted String".

Syntax

At the Command Prompt (library IS NOT initialized)

C:\>NTCmdLib $LEN VariableName|"Quoted String"

At the Command Prompt (library IS initialized)

C:\>L $LEN VariableName|"Quoted String"

In a Script (library IS NOT initialized)

CALL NTCmdLib $LEN VariableName|"Quoted String"

In a Script (library IS initialized)

%.Call% $LEN VariableName|"Quoted String"

Parameters and Switches

VariableName   Name of a variable containing the string to be measured.  If the variables contents are quoted, the quotes ARE counted.
"Quoted String"   A literal string to be measured.  The quotes ARE NOT counted.

Errorlevels, Output Variables and Custom Mount/\Commands

Name

 

Value

  Description/Contents

_LEN

 

numeric

  variable containing the length of the input string

 

ErrorLevel

 

Description/Contents

0

  Success

2

  Missing or invalid input
Literal string not quoted

Examples, Notes and Instructions

Example 1 - standard usage with VariableName

C:\GuardPost>SET "InputString=abc 123"


C:\GuardPost>SET InputString
InputString=abc 123

C:\GuardPost>NTCmdLib $LEN InputString

  ^   =========================================================================
 /!\   NTCmdLib.cmd 2003.04.24 NT/2K/XP/K3 ("Almost Freeware" at $9 or less!)
/LIB\ =========================================================================

_LEN=7

C:\GuardPost>SET _LEN
_LEN=7

C:\GuardPost>ECHO %_LEN%
7

Example 2 - standard usage with "Quoted String"

C:\GuardPost>NTCmdLib /q $LEN "abc 123"


C:\GuardPost>ECHO %_LEN%
7

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\