Dec 172017
 
Excellent batch file enhancement program. Creates windows, accepts variable input.
File SW-37.ZIP from The Programmer’s Corner in
Category Batch Files
Excellent batch file enhancement program. Creates windows, accepts variable input.
File Name File Size Zip Size Zip Type
SW-37.DOC 6446 2640 deflated
SW-37.EXE 21991 12139 deflated
SW-DEMO.BAT 1563 749 deflated

Download File SW-37.ZIP Here

Contents of the SW-37.DOC file




SW.EXE
Warren Small
(c) 1990

This utility will center up to 5 lines of "text" in a window. The color
of each line can be defined separately or as a group.

SW [options] "text1" [options] ["text2"] [options] ["text3"] [options]

OPTIONS
Window: /f# Foreground (0-15) /b# Background (0-7) /t|g# Text (0-15)
/l# Border (0-2) /s Shadow /2 Double Spacing /0 No Margin
Screen: /k#[ ] Clear screen with color (0-7) [char]
Other: /r# Row (1-21) /c# Column (1-80) /p# Pause /a Alert
/q... Query /h# here + # /e# enhanced text

Switches can be in any order, upper or lower case, and a space is
required between each. The only exception is text color. A /t# must appear
before each "text" on the parameter line if you want to change the default.
/g# will change the color of all lines of "text". And a /t# after a /g# will
override the color set by /g# for the next line of "text".

Foreground and Background colors for the window are set by the /f# and
/b# switches. Border type is defined by the /l# switch. 2 for double line, 1
for single line, and 0 for no border. /s adds a shadow to the right and below
the window. The /2 option will add a blank line between each text line
passed. /0 removes the blank space between the border and first line of text.

/k# will clear the screen using the color #. A single character can be
added after the # to give some texture to the screen. (e.g. /k7) This can
make the shadow effect more pronounced.

The position of the window can be set using the /r# (row) and /c#
(column) switches. These are referenced to the upper left corner of the
window. If the window is too big to fit, these coordinates will be adjusted
by the program. Thus if you have a line that places a window in the lower
right hand corner and you want to add a shadow, just put a /s on the end of
the line and the window will be positioned properly without changing the row
and column switch values.

For simpler positioning, /h# (here) will set the row according to the
present cursor position adding # to it if provided. So if you're trying to
mix regular screen text with an SW window, you don't need to know exactly
where it will be. You will still have to set the column position though. The
window will appear centered left to right otherwise.

The Query switch (/q...) allows user input of single characters. The
pressed key sets the DOS errorlevel allowing conditional branches in your
batch file.

Example: sw /eRED "Continue?" "~Yes ~No" /qyn
if errorlevel 2 goto exit
if errorlevel 1 goto next


Page 1

SW.EXE
Warren Small
(c) 1990

This will wait for the user to press the 'y' or 'n' key rejecting all
other keystrokes with a 'beep'. If 'n' is pressed, errorlevel 2 will be set
and the batch file will branch to the label ":exit". 'y' will cause a branch
to ":next". If the '~' character immediately follows the /q, the ESC key is
also available and will set errorlevel 0 if pressed. Up to 70 characters can
be designated as option keys. If you wish to use the space bar or the piping
(|) and redirection (< or >) characters, enclose all the characters in
quotes. (e.g. /q"abc "). This feature is not case-sensitive.

/e# selects the "enhanced" text color. This is the color used when you
want to highlight a character within a line. In the above example the '~'
character preceeding the 'Y' and 'N' will cause these characters to appear
bright red (/eRED) while the rest of the text is the default bright white. If
the e parameter is omitted, SW.EXE will add 1 to the color of the current
line. Up to 10 characters per line can be selected.

/p# will pause for # 10ths of a second before proceeding. If # = 0 or is
missing the program will wait for the user to press a key. If you combine
Query and Pause, the pause will occur after the query.

Defaults: Yellow double line border on a centered blue window with white
single-spaced text. No Clear Screen or Shadow. (/fYEL /bblu /gWHI /l2)

Example: sw /kwhi /fblu /bred /gYEL "Line 1" /tWHI "Line 2" "Line 3" /s

This will display a blue (/fblu) on red (/bred) window with a shadow (/s).
The screen color will be gray (/kwhi). Lines 1 and 3 are bright yellow
(/gYEL) and line 2 is bright white (/tWHI). The batch file SW-DEMO.BAT has
many more examples.

If no text strings are passed, features such as Clear Screen, Query, Pause
and Alert can be utilized with no screen output. (e.g. sw /p10 will pause for
1 second.)

COLOR VALUES

0 or bla = Black 8 or BLA = Grey
1 or blu = Blue 9 or BLU = Bright Blue
2 or gre = Green 10 or GRE = Bright Green
3 or cya = Cyan 11 or CYA = Bright Cyan
4 or red = Red 12 or RED = Bright Red
5 or mag = Magenta 13 or MAG = Bright Magenta
6 or yel = Brown 14 or YEL = Yellow
7 or whi = White 15 or WHI = Bright White

NOTE: To make "text" blink, add 128 to the color # or put a + after the color
name. (e.g. 4 for red plus 128 = 132 for blinking red or red+)




Page 2

SW.EXE
Warren Small
(c) 1990



This program is "shareware". If you find it to be usful, a donation would
be appreciated. ($5 or $10 is suggested.) This will entitle you to personal
notification of future versions and give your suggestions for enhancements
more value.

ver. 3.7 1/31/90

Warren Small
35 Benjamin Street
Manchester, NH 03103

CIS 71076,407





































Page 3


 December 17, 2017  Add comments

Leave a Reply