Category : Batch File Utilities - mostly for DOS
Archive   : SECHO20.ZIP
Filename : SECHO.DOC

 
Output of file : SECHO.DOC contained in archive : SECHO20.ZIP

Welcome to Version 2.0 of SECHO...Special ECHO for the IBM machines.

Background...
I Love Color. My Word Processors are set up in full color. My
Database Programs are set up in full color. Spreadsheets, Utilities,
EVERYTHING. But the one thing that didn't have any color were my
batch files. I tried adding it throught the usual means of ansi codes
and a small program to route these codes through ANSI.SYS, but this
was not only slow, but cumbersome, and you could only have 1 color on
each line. Thus, Secho was born.
Secho is a replacment for the DOS echo command, but Secho supports MANY
formatting, color, and variable commands within each line to be echoed.
Trust me, you'll love it.

Technical Information...
Secho is written in Turbo Pascal Version 4.0. As soon as it is
available, I will convert it to Turbo 5.0. It was developed on a
8 MHZ Turbo XT, with a Nec V-20 processor, so if you find any timing
anomilies, drop me a line and I will clean them up!

How it works...
Secho works EXACTLY like the Dos echo command. As long as the file
SECHO.EXE is available somewhere in Dos' path, it will work without
a hitch! You simple enter SECHO , and it is echoed
to the screen. However, within that you can have a
myriad of commands for changing color, drawing windows, positioning the
cursor, printing variables to the screen, and MORE!!!

The Commands...
A quick rundown before the actual syntax. Many numerical parameters
need to be 2 digits. This means that if you want the value of 1,
you have to enter 01. The reason for this was space and speed, and
once you get used to it, it causes no headaches!

\a
This is the audible alarm. There are no parameters, and it is a
replacment for the bell. It has a fun Zip sound, which I spent a
good 45 minutes tuning, so if you don't like it...complain!!
Example: SECHO \a
This would sound the Alarm!

\b#
This sets the background colors of ALL following output. The colors
are listed below. The parameter for this command is one, and only
one digit.
Example: SECHO \b1
This would set the background color to blue.

\c
Very self explanitory. This command will clear the screen. No
parameters are used.
Example: SECHO \c
This would clear the screen. (Redundancy is one of my better
personal traits.)

\d
When executed, this command will display the current date to the
screen, in the current colors. The format is "Sunday, July 22, 1988."
Example: SECHO \d
Obvious Result, yes?

\f##
The f command sets the foreground color. It MUST be two digits.
Again, the list of colors are below.
Example: SECHO \f01
This would set the foreground color to blue. A note, if you
were to enter SECHO \f1, an error message would appear, telling
you that "Err=2." This means that the second digit of the
parameter is invalid.

\g
I don't really know why this is here, but I have found a couple uses
for it. This command will display, in the current colors, the current
path you are in.
Example: SECHO \g
This would print to the screen your current position in the
directory tree. ie: C:\APPS\DOS

\h#
The h command prints a number of backspaces. The parameter can be only
one digit.
Example: SECHO Hello!\b6Goodbye
This would print Hello! to the screen, then immediatelly
backspace over it and print Goodbye. Would be handy to have
a pause command, eh? Read on!

\m
No parameters, this one just prints out the free RAM in the system, in
the current color parameters!
Example: SECHO Free Ram: \m
Would print Free Ram: 569,000 (or whatever you happen to have
free at the time!)

\p#
This is the afore-mentioned pause command. Takes one parameter, which
can be only one digit. If the number is between 1 and 9, it will
pause that many seconds. If the number is 0, it will prompt the user
to press any key, and wait for a keypress.
Example: SECHO \p0
This would print " [PRESS ANY KEY] " to the screen, and await
a keypress. When a key is hit, it will backspace over and
remove the press any key message.

\r#
Prints 1 - 9 carrage returns to the screen. The parameter can be one
and only one digit long.
Example: Secho Hello!\r3Hello!
This would print Hello!, then three lines below, print hello!
again!

\s
Handy! Outputs to the screen, in the current colors, the amount of
free space on the current drive. It is in the format 367,203 bytes.
If applicable, i.e. the drive is larger than one megabyte, it will
also convert this to meg.
Example: Secho Drive Space: \s
The output from this command could look like this:
Drive Space: 3,250,585 bytes free. ( 3.1 Meg)

\t
Like the \d command, this will output the current time, according
to the system clock.
Example: Secho \t
The output would look like this: 12:32 pm

\wX1Y1X2Y2P
This is the draw a window command. It is a bit involved. The parameter
is 9 digits long, and the breakdown is as follows.
Digits one and two are the x coordinates of the upper left corner of
the window.
Digits three and four are the y coordinates of the upper left corner
of the window.
Digits five and six are the x coordinates of the lower right corner.
Digits seven and eight are the y coordinates of the lower right corner.
Note, the coordinates MUST be 2 digits each, so if you want position 1,
you MUST use 01.
Digit nine is the window style.
If it is a one, the window will be drawn with double lines.
If it is a two, the window will be drawn with single lines.
If it is a three, the window will have double horizontal lines,
and single vertical lines.
If it is a four, the window will have single horizontal lines,
and double vertical lines.
Example: SECHO \w010140123
This will draw a window with the upper left corner having
the coordinates of (01,01) and the lower right corner having
the coordinates of (40,12). The window will have double
horizontal lines, and single vertical lines.

\xXXYY
This is screen positioning. It have a FOUR digit parameter.
The first two digits are the x value, and the second two are the y
value.
Example: SECHO \x4012
This will position the cursor at (40,12), and subsequent
output will start there.

\z
Screen ZAP! This is another command I added as a special effect.
It will cause the screen to fade out, then clear. Just like the
\c command, but more fun to watch. Try it!

\-String,#1,#2
This is the repeat function. What it will do, is repeat String #2 times.
The first output of String will be in color #1, the second in #1+1, etc
It cycles colors, and when it reaches 15, it reverts to color 1.
Try it...its neat!

}filename
This will only work if the } is the VERY first thing on the command line.
This is what is called file mode. Look at TEST.BAT to see it implemented.
If you are going to output lots of data, doing it line by line from a
batch file can be SLOW. The } command lets you create a file of secho
commands, which are read by secho. This method is MUCH faster then
normal command line mode, but also requires a data file.
Again, look at TEST.BAT, and TEST.DAT for more information.

The Colors!!!!

This is a list of Color that secho can use!

Foreground Background
01 - Blue 1 - Blue
02 - Green 2 - Green
03 - Cyan 3 - Cyan
04 - Red 4 - Red
05 - Magenta 5 - Magenta
06 - Low Yellow (Brown) 6 - Low Yellow (Brown)
07 - Light Gray 7 - Gray
08 - Dark Gray
09 - Light Blue
10 - Light Green
11 - Light Cyan
12 - Light Red
13 - Light Magenta
14 - Light Yellow
15 - White



There it is! If you have any Comments, Suggestions, Donations, Thoughts,
Grievances, Additions, Bug, Kind Words, etc, contact me at the following:

Starfleet Command - Handle Genesis - User ID: 3 - Phone: (313)258-9864

And please, drop me a line if you have any thoughts one way or the other
about secho.


Chris Lucksted.
Secho Version 2.0 - Compiled September 25, 1988 - 4:20pm.
(C)1988 Genesoft