1.

Solve : Please, What does the @ do in the following example??

Answer»

Thanks in advance!
Please,
what does the @ do in the following example?

@echo Free Pascal Compiler test...
@echo For error MESSAGES, see fpctest.err.
@echo off
@if "%1"=="" goto usage
@if not exist %1. goto invpath
@del fpctest.err
@make file=%2 fpc=%1 -fMakefile.fpc
@type fpctest.err
@goto exit
:invpath
@echo invalid path "%1"
@goto exit
:usage
@echo usage: fpctest ^ ^
:exit

Thanks!
...Vernon
winXP, FreePascal/LazarusA @ at the start of a line prevents the line from being echoed when the batch is executed. You can achieve the same result by having this line as the first line of a batch file. Then you don't need the '@'s at the start of each line.

Code: [Select]@echo off
I don't know why the writer of that batch you posted chose to do it like that.

Ah, yes.
Thanks!

fav songs:
http://www.youtube.com/watch?v=NYWuNh22KO4
http://www.youtube.com/watch?v=7We1mex6OeMQuote from: vmars on January 14, 2009, 03:39:56 PM

fav songs:
http://www.youtube.com/watch?v=NYWuNh22KO4
http://www.youtube.com/watch?v=7We1mex6OeM

that's your reward Dias.

I'm to scared to click the links myself.
My favourite song would be the "ewe overture" or "symphony of the Billy-Goats".
I prefer the pictures though.Quote from: BC_Programmer on January 14, 2009, 04:04:15 PM
Quote from: vmars on January 14, 2009, 03:39:56 PM
fav songs:
http://www.youtube.com/watch?v=NYWuNh22KO4
http://www.youtube.com/watch?v=7We1mex6OeM

that's your reward Dias.

I'm to scared to click the links myself.
My favourite song would be the "ewe overture" or "symphony of the Billy-Goats".
I prefer the pictures though.

Cruel. I don't like those songs. I like Queen, Green Day, and Tim Powter.When you start talking with US "old-schoolers" you will hear some funny stories.

I was working for ITT Servcom in the early 80's and I was in a bank presidents office one day when I noticed a bright colored DOS menu on his computer screen.
I asked "How do you do that" and for the next hour, I sat there getting my first formal training in DOS batch file and menu creation, from a Bank President.

A PRACTICAL use of the @ sign would be to blank out just one line, in a batch file where all the other lines are being echoed to the screen.

When you start a batch file with Echo OFF, you put the @ sign at the start of the line so the command Echo Off won't be echo'ed to the screen.

I was taught to put:
@Echo Off
cls

at the beginning of every batch file. I do that to this very day.
It clears the screen ( CLS ) and keeps it clean while the batch file runs, unless you instruct it to echo certain lines to the screen.

For batch file testing, you MAY want to disable the @Echo Off command during the testing procedure. Then you can see if there are any error messages to your commands.

To disable any line, just put two colons ( :: ) at the beginning of the line and DOS will totally ignore that line. If you use REM, then DOS will continue to read the entire line, even though it will not (usually) execute it. There are a few instances where the line or part of it MAY be executed, that's why I never use REM, but always the double colon. Now it's just a habit.

Also, the batch file runs faster if DOS doesn't have to read the remark lines.

Cheers Mates, keep up the good work!

The Shadow Quote from: BatchFileCommand on January 14, 2009, 04:40:53 PM
Quote from: BC_Programmer on January 14, 2009, 04:04:15 PM
Quote from: vmars on January 14, 2009, 03:39:56 PM
fav songs:
http://www.youtube.com/watch?v=NYWuNh22KO4
http://www.youtube.com/watch?v=7We1mex6OeM

that's your reward Dias.

I'm to scared to click the links myself.
My favourite song would be the "ewe overture" or "symphony of the Billy-Goats".
I prefer the pictures though.

Cruel. I don't like those songs. I like Queen, Green Day, and Tim Powter.

I was of course joking

Queen is my all time favourite band.Quote from: TheShadow on January 14, 2009, 05:07:59 PM
To disable any line, just put two colons ( :: ) at the beginning of the line and DOS will totally ignore that line. If you use REM, then DOS will continue to read the entire line, even though it will not (usually) execute it. There are a few instances where the line or part of it MAY be executed, that's why I never use REM, but always the double colon. Now it's just a habit.

I'm an old schooler myself, and I might just add that the undocumented unofficial use of a broken LABEL ( as a comment will break inside a FOR loop, which is why I never use it.


Discussion

No Comment Found