please dont rip this site

Using brackets to group expressions


by http://www.ss64.com/nt/index.html

Brackets can be useful to make complex commands more readable and/or to span commands across several lines.

      (command)

      (
        command )

e.g.
   IF EXIST C:\pagefile.sys (
                             ECHO pagefile found on C: drive)

The use of brackets is only required if the command is run over several lines e.g.

IF EXIST filename (
del filename
) ELSE (
echo The file was not found.
)

The IF statement does not use any great intelligence when evaluating Brackets, so for example the command below will fail:

IF EXIST MyFile.txt (ECHO Some(more)Potatoes)

This version will work:

IF EXIST MyFile.txt (ECHO Some[more]Potatoes)

It is worth noting that although brackets are legal in NTFS pathnames, such brackets will be misinterpreted by the command processor.

Testing Numeric values

Do not use brackets or quotes if you are comparing numeric values with an IF command
e.g.
IF (2) GEQ (15) echo "bigger"
or
IF "2" GEQ "15" echo "bigger"
Will perform a character comparison and will echo "bigger"
however the command
IF 2 GEQ 15 echo "bigger"
Will perform a numeric comparison and works as expected.

This is opposite to the SET /a command where quotes are required.

See also:


file: /Techref/os/win/winnt/brackets.htm, 1KB, , updated: 2007/8/16 14:08, local time: 2012/5/24 05:20,
TOP NEW HELP FIND: 
38.107.179.233:LOG IN

 ©2012 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF="http://www.ecomorder.com/techref/os/win/winnt/brackets.htm"> Using brackets to group expressions</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 
SX MASTERS: Eric Smith and Richard Ottosen's SERVID is an intellegent RS232 video terminal (4x20 character display) in one SX chip. See the write up.
 
miSim DE is an excellent, portable and powerful IDE for developing PIC applications.
The only consistant, simple to use yet powerful development environment. It simulates real-world devices via virtual component "plugins" (LED,LCD,key,motor,TV,etc) in real time, has a syntax highlighting editor, macro assembler and disassembler. Regular updates and third-party plugins keep this software ahead of any other PIC IDE.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .