home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-12 | 55.9 KB | 1,340 lines |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ╔═══════════════════════════════════╗
- ║ ║▒▒
- ║ SCREEN WIZARD ║▒▒
- ║ Batch File Enhancement ║▒▒
- ║ Version 4.5 ║▒▒
- ║ ║▒▒
- ╚═══════════════════════════════════╝▒▒
- ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- June 11, 1993
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- TABLE OF CONTENTS
-
- INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
- SW.EXE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
- DI.EXE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
- Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
- OPTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
- NOTES ON DOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
-
- WINDOW APPEARANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
- /F# Foreground Color /B# Background Color . . . . . . . . . . . 3
- Color Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
- /L# Window Border (Lines) . . . . . . . . . . . . . . . . . . . . . 3
- /S# Shadows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
- /W Wide Edge . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
- /2 Double Spacing /0 No Margin . . . . . . . . . . . . . . . . 3
- /R# Row /C# Column . . . . . . . . . . . . . . . . . . . . . . . 4
- /H# Here . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
- /D Draw Window . . . . . . . . . . . . . . . . . . . . . . . . . . 4
- /Z Zoom Window . . . . . . . . . . . . . . . . . . . . . . . . . . 4
-
- TEXT APPEARANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
- /T# Text Color /G# Global Text Color . . . . . . . . . . . . . . 5
- /E# Enhanced Text Color . . . . . . . . . . . . . . . . . . . . . . 5
- /M# Border Message . . . . . . . . . . . . . . . . . . . . . . . . 5
- /J# Justify . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
-
- SCREEN APPEARANCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
- /K# Klear Screen (with optional Fill Character) . . . . . . . . . . 6
- /K# Klear Screen, set Foreground Color . . . . . . . . . . . . . . 6
- /K# Klear Screen (with optional Fill String) . . . . . . . . . . . 6
- /O# Outside Edge (Screen Border) . . . . . . . . . . . . . . . . . 6
- /X# Xtra Lines . . . . . . . . . . . . . . . . . . . . . . . . . . 6
- /@# Set Cursor . . . . . . . . . . . . . . . . . . . . . . . . . . 6
- /@- Hide Cursor . . . . . . . . . . . . . . . . . . . . . . . . . . 7
-
- OTHER SWITCHES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
- /P# Pause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
- /Q Query . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
- /Q Function Keys . . . . . . . . . . . . . . . . . . . . . . . . . 8
- /I# User Input . . . . . . . . . . . . . . . . . . . . . . . . . . 9
- /I#var User Input, Custom Variable Name . . . . . . . . . . . . . . 9
- /I# User Input, Multiple strings . . . . . . . . . . . . . . . . . 10
- /I#### User Input, Long Strings . . . . . . . . . . . . . . . . . . 10
- /I##* User Input, Password Blanking . . . . . . . . . . . . . . . . 10
- /N# Input Line Number . . . . . . . . . . . . . . . . . . . . . . . 10
- /U Input Uppercase . . . . . . . . . . . . . . . . . . . . . . . . 11
- /ch Fill Line . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
- /ch/ Window Separator . . . . . . . . . . . . . . . . . . . . . . . 11
- /A# Alert /A#,# Alert with Frequency, Duration . . . . . . . . . 11
- /A##-##[,##] Alert Sweep . . . . . . . . . . . . . . . . . . . . . 12
-
- DEFAULTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
-
-
- i
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- SCREEN DEFINITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
-
- TIPS AND TRICKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
-
- SHAREWARE INFORMATION . . . . . . . . . . . . . . . . . . . . . . . . . . 18
-
- SW.EXE History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ii
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- INTRODUCTION
-
- The batch file language for the IBM PC could be described as useful but
- not much else. It is lacking a great deal in terms of flexibility. These 2
- utilities, SW.EXE and DI.EXE, attempt to make batch files much more powerful
- and at the same time make them nice to look at.
-
- SW.EXE grew out of my hatred for the ECHO statement. Any time that I
- needed to say something to the user, ECHO was the only way. It was slow and
- difficult to make look halfway decent. And if I wanted color, there was
- ANSI.SYS...
-
- DI.EXE was introduced with SW 4.1 as a response to users who have been
- utilizing SW as an install tool for software distribution. DI allows interro-
- gation of the disk drives to determine if they are ready for whatever use you
- had in mind. This way you can avoid hardware errors which can pop up in the
- middle of your nice SW screens. See DI-13.DOC for the details on using DI.
-
- SW.EXE will display up to 50 lines of text in a window using either its
- command line format or an external 'Screen Definition' file. With either
- method, the color of each line can be defined separately or as a group. Also,
- the colors for the window, its border, the screen background and its border
- can be specified. Five different window borders are possible and the screen
- background can be filled with characters or complete strings.
-
- SW.EXE also provides functions for retrieving input from the user,
- either single keystrokes or strings, controlling batch file execution through
- branching and alerting the user with various sounds or even simple tunes.
-
- Command Line Syntax:
-
- SW [options] "text1" [options] ["text2"] [options] ["text3"] ...
-
- External File Syntax:
-
- SW @filename [label]
-
- The biggest advantage to using the external file approach is that more
- than one window can be displayed with only one call to SW! This can be a
- tremendous speed advantage if the batch file is being run from a floppy disk.
- The screen definition can also be written into the batch file that utilizes
- it so that disk space is used optimally. The optional label shown above is
- used to mark different definitions within the same file. The demo batch file,
- SW45DEMO.BAT, contains many examples of both methods. See page 14 for more
- information.
-
- On the next page is a list of the various switches along with a short
- description of what each does. This list appears on the screen when SW is
- called without parameters.
-
-
-
- Page 1
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- OPTIONS
-
- Window: /f# Foreground (0-15) /b# Background (0-7) /l# Border (0-5)
- /s# Shadow (1-4) /w Wide Edge /2 Double Spacing /0 No Margin
- /r# Row (1-25) /c# Col (1-80) /h# here + # /d Draw /z Zoom
- Text: /t#|g# Text (0-15) /e# Enhanced Text /m# Border Msg /j# Justify
- Screen: /k#[ ] Clear screen (0-7) [char] /o# Outside edge /@# Set Cursor
- Other: /p#[-] Pause /a#[,#] Alert (0-9) /q... Query /char Fill Line
- /i# User Input /n# Input Line /u Uppercase /x# Xtra Lines
-
- Switches can be in almost any order, upper or lower case (except /q and
- /i, see page 8), and a space is required between each.
-
- NOTES ON DOS
-
- - There is a limit to the length of a command line whether it is typed
- directly from the DOS prompt or inside a batch file. This limit is 128 char-
- acters. Anything past that point will be ignored.
-
- - The Query feature described on page 8 makes use of Errorlevel codes to
- allow the batch file to determine which key has been pressed. A series of IF
- ERRORLEVEL x statements are used to test for the value. You must test from
- largest to smallest since the statement will be true if the value is equal to
- OR greater than x.
-
- - The User Input feature (page 9) and four DI switches make use of the
- DOS Environment. (DOS 3.3 or higher is required for these features) This is
- an area in memory containing information stored by your boot up procedure as
- well as some programs. You can see this information by typing SET from the
- command line. There are three variables commonly found in the environment.
- PATH is a list of directories DOS will search to find a program not in the
- current directory. You must set this yourself, usually as part of the
- AUTOEXEC.BAT file. COMSPEC tells DOS where to find COMMAND.COM. If it is
- anywhere but the root directory of the boot drive, you will have to set it.
- PROMPT describes what the DOS prompt will look like. Your DOS manual has more
- information.
-
- - To check the answers returned by User Input, the IF statement is used.
- In your batch file, the variable name must be preceded and followed the %
- sign. On page 9 is a quick example. If you wish to check the actual value use
- this form:
- IF "%ANS%"=="" goto Label
-
- This will branch to Label if the user entered nothing. Use IF NOT to reverse
- the logic of the comparison. Adding NOT to the above example would branch to
- Label if ANS had some value.
-
- - To be sure there is room in the environment you can set the size
- manually when booting. "SHELL=C:\COMMAND.COM /E:512 /P" in your CONFIG.SYS
- file will set the size to 512 bytes. This value can be as large as 32768.
-
-
- Page 2
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- WINDOW APPEARANCE
-
- /F# Foreground Color /B# Background Color
- Foreground and background colors for the window are set by the /f# and
- /b# switches. The color can be selected using the numbers or names.
- Valid background colors are limited to 0-7. If your command line gets to
- be longer than 128 characters, use the numbers to gain some space. DOS
- will ignore anything past the 128th position on the command line.
-
- 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
-
- /L# Window Border (Lines)
- Border type is defined by the /l# (line) switch.
-
- /l0 - none /l1 - ┌─ /l2 - ╔═
- /l3 - ╒═ /l4 - ╓─ /l5 - █▀
-
- If a character is used instead of a number, it will be used as the
- window border. (e.g. /l* or /l▓).
-
- /S# Shadows
- A shadow can be added with the /s# option. If the shadow covers other
- characters on the screen they will be darkened, rather than hidden.
-
- /s1 - right, below (default if /s is used alone)
- /s2 - left, below
- /s3 - right, above
- /s4 - left, above.
-
- /W Wide Edge
- The /w switch will give your window a wide edge, making it 2 rows taller
- and 4 columns wider. Using this option will reduce the maximum string
- length to 64 and the maximum number of lines from 20 to 18 if you are
- using a screen definition. The /w switch will have no effect on a window
- with no border (/l0).
-
- /2 Double Spacing /0 No Margin
- The /2 option will add a blank line between each text line passed. The
- /0 switch removes the blank space between the border and first and last
- lines of text. Combine /0 with the /l0 switch and the resulting window
- will be only as large as needed for the text passed.
-
-
- Page 3
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- /R# Row /C# Column
- 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.
-
- If you wish to set the size of the window yourself, a second /r# and /c#
- will define the bottom row and right column. If the text passed to SW
- will not fit in the window, these settings will be adjusted by SW
- automatically, adjusting the bottom and right sides first. If you set
- only top and bottom or left and right, SW will calculate the proper
- values for you.
-
- A shorthand version of absolute sizing is available. You can now show
- the start and end with one switch for the height, /r#### and one for the
- width, /c####. The first 2 digits are the start value. /r1020 is equiva-
- lent to /r10 /r20, saving 3 characters on the line.
-
- /H# Here
- For simpler positioning, /h# (here) will set the row according to the
- present cursor position adding # to it if provided. The value can be
- plus or minus. Use the /h# switch when you're trying to mix screen
- output from another program with an SW window. The window can be easily
- placed relative to the other text and will be centered left to right
- unless you use the /c# switch.
-
- /D Draw Window
- When a Pause, Query or User Input is utilized, the window will "popup"
- on the screen and disappear when the pause finishes or the input has
- been processed. If you want the window to be left on the screen, specify
- the /d switch. This will draw the window instead. See page 8 for more
- information on Pause, Query and User Input.
-
- ┌──────────────────────────────────────────────────────────────────────┐
- │ NOTE TO PREVIOUS USERS - Since Pause, Query and User Input windows │
- │ now disappear when the function is completed, you may wish to change │
- │ your batch files by adding the /D switch. │
- └──────────────────────────────────────────────────────────────────────┘
-
- /Z Zoom Window
- A special effect for SW is Zoom Window. Sometimes called "exploding" by
- other applications, this switch will cause the window to be drawn in
- several steps, from small to its final size. The shadow and border are
- zoomed as well with the text added when the proper size is reached.
-
-
-
-
-
- Page 4
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- TEXT APPEARANCE
-
- /T# Text Color /G# Global Text Color
- Text color can be controlled with the /t# and /g# switches. Both use the
- same color table shown above and both are position sensitive. /g# will
- change the text color for all text following the switch. /t# will effect
- only the text string immediately after the switch. Multiple /g# switches
- could be used to color groups of lines. To make "text" blink, add 128 to
- the color # or put a + after the color name. (e.g. red+ = 4 + 128 = 132
- = blinking red). The window foreground color can also blink if desired.
-
- /E# Enhanced Text Color
- This switch selects the "enhanced" text color. This is the color used
- when you want to highlight characters within a line. The location of
- this switch is important as it effects only those lines of text that
- follow it, like the /G# switch. In fact, you could use the switch to
- give each line a different highlight color.
-
- Marking characters to be highlighted in a line can be accomplished in
- one of two ways. The Query example on page 8 shows the use of the ~
- (tilde) character preceding the 'Y' and 'N' and will cause these charac-
- ters 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 use the
- color of the current line with the opposite intensity. There is no limit
- to the number of characters that can be highlighted on each line.
-
- If you want to highlight a group of characters on a line, an alternative
- to placing a ~ in front of each character is to surround the portion of
- the line you want highlighted with curly braces ({ and }). If you need
- to use any these characters on a line without highlighting, use a pair
- of each. The string "{{Normal Text}}" will appear as "{Normal Text}" in
- the window without being highlighted.
-
- /M# Border Message
- A /m# preceding a text string marks the string as a Border Message. If
- it is the first string in the window, it will appear at the top. If it
- appears after the first line of regular text, the message will appear at
- the bottom. The # must be l, r or c for left, right and center. Center
- is the default if /m is used alone. The message color is defined the
- same way as all other text with /t#, /g#, and /e#.
-
- /J# Justify
- Text can be justified (aligned) to the left or right as well as the
- default centering. This switch works on all strings following its
- position, just like /g#. /jl will align text left and /jr will line up
- the text to the right. /jc would restore the default.
-
-
-
-
-
-
- Page 5
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- SCREEN APPEARANCE
-
- /K# Klear Screen (with optional Fill Character)
- The /k# switch will clear the screen using the color # (0-7) and places
- the cursor at the upper left corner. A single character can be added
- after the # to give some texture to the screen. (e.g. /k4─ or /kred─)
- This can make the shadow effect more interesting.
-
- /K# Klear Screen, set Foreground Color
- A second /k# switch on the same line can be used to set the screen fore-
- ground color (0-15). SW /kblu /kWHI sets the screen color to bright
- white on blue. This will NOT affect the current DOS screen color. The
- default screen foreground value is 7 or whi.
-
- /K# Klear Screen (with optional Fill String)
- Instead of a simple fill character for the background, a string could be
- used in the form /k#string. The string can be up to 80 characters long.
- Interesting patterns will result depending on the length. Lengths like
- 2, 4, 5, 8, 10, etc. divide into 80 evenly. Other values result in each
- line being offset from the last. Don't limit yourself to just words. Use
- some of the special IBM characters in different combinations. The Demo
- batch file has some examples. If you want spaces within the string,
- either surround the string with quotes or substitute the underscore (_)
- for each space. They will be replaced by spaces before being displayed.
-
- /O# Outside Edge (Screen Border)
- The /o# switch will set the screen border color. All color values are
- valid. Using the switch without a color will reset the border to normal.
- This switch could be used alone to set or reset the border. SW /ored
- will set the screen border to red. Some programs ignore the border
- color, others reset it and still others set one of their own. You will
- have to experiment on your own is you wish to set a special border color
- for a program.
-
- /X# Xtra Lines
- SW is EGA 43 and VGA 28/50 line aware, i.e. if the screen is already in
- one of those modes, SW will be able to utilize the entire screen. This
- switch allows SW to setup 28, 43 and 50 line displays by using /X28,
- /X43 and /X50 respectively. /X25 will return to the normal 25 line mode.
- The maximum text lines displayed in a box is increased to 23 for the 28
- line mode, 38 in the 43 line mode and 45 in the 50 line mode. 5 more
- lines can be displayed if the window uses /L0 /0 for parameters.
-
- /@# Set Cursor
- If you wish to move the cursor to a particular place on the screen, this
- switch will accomplish it. The number which follows /@ can be a row or a
- row and col. /@15 will place the cursor on row 15 col 1 and /@234 will
- set it on row 2 col 34. The next text output to the screen will begin at
- this point. It is important to note that setting the column to something
- other than 1 will affect only the first line put on the screen. The rest
- will start at the left margin. This switch does NOT affect SW's output.
-
- Page 6
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- /@- Hide Cursor
- SW can hide the cursor after it has finished processing with this
- switch. You can make the cursor reappear with any SW command which means
- that you need to include this switch on each command line if you want
- the cursor to remain hidden. Only one instance of the switch is neces-
- sary in a screen definition.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 7
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- OTHER SWITCHES
-
- /P# Pause
- The /p# switch 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
- unless the query specifies a default (See below). Adding a - after the
- number will allow the user to interrupt the timer. e.g. /p50- will pause
- for 5 seconds or less if the user presses a key. Maximum value for pause
- is 300 or 30 seconds.
-
- /Q Query (Controlled Branching)
- The Query switch (/q...) allows user input of single characters. The
- selected 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
-
- 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".
-
- /Q Function Keys
- The Query can also look for function keys, if desired. They can be
- included in the string with other characters in the form "/qabc[F1]".
- Pressing the F1 key, in this case, will return EL 4. F1 through F10 can
- be used with F10 being represented by [F0]. See the section on Screen
- Definitions beginning on page 14 for a special application of F1.
-
- /Q Special Characters, ~ ` ^ *
- If the ~ (tilde) 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 "). Query is not case-sensitive.
-
- The ` or ^ character can be used to indicate a default choice for the
- Query. This choice is available to avoid conflicts with NDOS/4DOS.
-
- Example: sw /eRED "Continue?" "~Yes ~No" /q^yn
-
- This makes a 'Y' the default. SW will return Errorlevel 1 if ENTER is
- pressed. Also, by combining a pause with a default choice, SW will
- return the default if no key is pressed before the pause time elapses.
-
- An asterisk (*) used in the Query string acts like a wild card choice.
- SW will return an Errorlevel corresponding to its position in thestring.
-
-
- Page 8
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- Example: sw /eRED "Press ~Y to Continue" "Any other key to abort" /qy*
-
- 'Y' returns Errorlevel 1 and all other keys return 2. ESC and/or a
- default response could be combined with the wildcard option as well.
- Pressing ENTER would then return the default choice as would a Pause
- timeout.
-
- Users who wish SW to flush the keyboard buffer prior to checking for
- Queries can use an uppercase /Q switch rather than a /q. In both cases,
- the result of the query is the same.
-
- /I# User Input (Requires DOS 3.3 or higher)
- The /i# switch will add an edit line to the window which will accept
- User Input. The # defines the length of the line. This feature can be
- used to ask for directory names, file names, drive letters or other
- information which can then be used by the batch file. SW will put the
- answer in the batch file's environment with the label ANS. DOS 3.3 or
- higher is needed for this feature. You can then use the ANS variable in
- your batch file. A Pause used with this feature will occur after the
- input.
-
- Example: sw "Which Directory?" /i40
- if exist %ans%\nul cd %ans%
-
- This does has some limitations since it is difficult to check the
- validity of the answer from a batch file.
-
- ┌─────────────────────────────────────────────────────────────────────┐
- │ NOTE TO SW 3.8 USERS: If you have used the /i# switch in your batch │
- │ files, be sure to remove the line "CALL SW-ENV.BAT" since SW 4.x │
- │ does not create the batch file in favor of direct manipulation of │
- │ the environment. │
- └─────────────────────────────────────────────────────────────────────┘
-
- /I#var User Input, Custom Variable Name
- Optionally, you can specify your own environment variable name with the
- /i# switch. The variable is indicated by a string, up to 8 characters
- long, placed after the number. e.g. /i24Dir gives you a 24 character
- field and places the answer in the environment variable DIR. (All
- environment variables are shifted to upper case.) This allows you to get
- more than one string before processing. Just be sure your environment is
- sized properly. Check the SHELL command in your DOS manual.
-
- The string input editing keys include HOME, END, , , BackSpace, DEL,
- INSert and Overtype modes and use of the ESCape key for aborting. A
- large cursor indicates the Overtype mode and a small cursor signifies
- Insert.
-
- IMPORTANT NOTE: SW 4.2a altered the action of ESC by NOT changing the
- original value and returning EL 1 to the batch file. This prevents
- unnecessary alteration of the environment. If an error occurs when SW
-
- Page 9
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- tries to add the result to the environment, an EL 2 will be returned. EL
- 0 is returned with normal input.
-
- When using the /I switch, SW will check the environment to see if the
- variable you are using is already present. If it is, the value will be
- used as a default value in the User Input field. A SET command should
- always precede an SW call with the /I switch. If you do NOT want a
- default, you have to make sure the variable is not present. 'SET ANS='
- preceding the input call will make sure there is no value in the ANS
- variable.
-
- Like the /Q switch, /I will flush the keyboard buffer if an uppercase /I
- is used rather than /i. The results for both are equivalent.
-
- /I# User Input, Multiple strings
- Assuming that you have adequate space in your environment, you can
- retrieve more than one string from a user with only one call to SW. This
- is only practical for screen definitions since it requires a good deal
- of information to set it up and probably would not fit in a 128 charac-
- ter command line. Each input defined would need its own variable name
- and prompt. The only caveat to this method is that an ESC is not record-
- ed except by the last /I to be processed.
-
- /I#### User Input, Long Strings
- If you need to get string input that is longer than the maximum field
- length of 70 , use the form /I####. The last 2 digits define the field
- size and the rest of the number represents the maximum length of the
- string. e.g /I8020 defines a 20 character field with a maximum string
- length of 80. Additionally, if the default value found in the environ-
- ment exceeds the string length, SW will automatically adjust to compen-
- sate. However, the string cannot be made any longer. Maximum string
- length is 127 characters minus the length of the variable name. Maximum
- field length is 70 if it is on a line by itself. The field size will be
- adjusted if its length plus the length of text on the same line exceeds
- 70 or 64 if using wide margins.
-
- /I##* User Input, Password Blanking
- For anyone wanting to use SW to get password input, add an asterisk
- between the length and the variable name (if used). This prevents the
- password from being displayed on the screen by substituting an asterisk
- for each character entered, improving security. It is important to note
- that since a batch file is being used to check to validity of the entry,
- someone could find out what the password is by looking at the file so
- you should at least hide the file to make it more difficult to circum-
- vent.
-
- /N# Input Line Number
- By default, the User Input field is placed on the last line of the box.
- By using the /n# switch, the field can be placed on any line. If # is
- positive, the field will appear after the string on line #. If # is
- negative, the field will appear by itself on line #.
-
- Page 10
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- /U Input Uppercase
- If you want only uppercase characters in the answer, use the /u switch.
- This can be useful when asking for a drive letter and want to put the
- results on the screen for verification.
-
- /D Draw Window
- Pause, Query and User Input windows "popup" on the screen, i.e they
- disappear after the Pause, Query or Input finish. /D is used if you want
- the window to stay on the screen.
-
- /ch Fill Line
- This parameter is used to indicate a character which will be used to
- fill a text line position in the window. Any character that is not
- already used by another switch is valid. This switch could be used for
- horizontal separators in the text box using a ─ (ASCII 196) or a ═
- (ASCII 205). The area filled is just inside the border of the box. The
- switch should be positioned as if it were a string on the command line
- or within the Screen Definition. Its color can be specified the same as
- a normal text line. See the first Screen Definition on Page 14 for an
- example of its use.
-
- /ch/ Window Separator
- This switch is similar to Fill Line except that it will fill the line
- completely. If a horizontal line drawing character (ASCII 196 or 205) is
- used along with borders /l1 through /l4, the line will be connected to
- the border. The line will assume the color of the border.
-
- /A# Alert /A#,# Alert with Frequency, Duration
- The Alert switch (/a#) can be used to produce the normal IBM beep if #
- is 0 or missing. If that's too boring, nine other sounds can be produced
- varying from simple tones to more complex sounds using the values below.
-
-
- Alert Switch Values
- 1 - Low Freq Tone 5 - Bweep Two
- 2 - Mid Freq Tone 6 - Bomb
- 3 - High Freq Tone 7 - Siren
- 4 - Bweep One 8 - Phasor
- 9 - Tweeter
-
- The demo batch file gives you a chance to try them all.
-
- The /A switch can also produce any tone that the PC speaker can put out.
- Using the form /A##,##, the first number will be the frequency of the
- tone (20-20000) and the second is its duration (1-300 tenths of a
- second). Using a screen definition, songs are actually possible using a
- series of lines like "_window /a440,1". This produces a 440 hertz tone
- for 1 tenth of a second. SW45DEMO.BAT has some short examples. The use
- of a screen definition is needed for speed of execution. Trying this
- from several command lines in the batch file will result in a less than
- smooth output.
-
- Page 11
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- For you musicians out there, there is an easier way to create those
- little tunes. Notes can be specified with the /A switch as well. Middle
- C is designated as C4. A sharp is shown as C4# and a flat as B3b. The
- full form of the switch is /AA4,10 which will play an A, 4th octave, for
- 1 second. The tunes in SW45DEMO.BAT use this form of /A. The valid range
- is from E0 to B9. It should be noted that the IBM speaker has limita-
- tions in reproducing high notes and the practical limit is probably
- around a G9 or about 12,000 Hz. Your results could vary depending on
- your computer type.
-
- /A##-##[,##] Alert Sweep
- A quick sweep of tones can be programmed with this form of the /A
- switch. This first number is the start frequency. After the hyphen is
- the finish frequency. Optionally, the third number can be used to define
- the number of steps to be used from the start frequency to the finish
- frequency. Each tone is sounded for about 1/18th of a second so 18 steps
- will take about 1 second. The default is 10 steps. Any valid frequency
- can be used. Notes values are not accepted.
-
- Example: sw /a100-1000,15
-
- This will start at 100 Hz and reach 1000 Hz in 15 steps. The start
- frequency can be larger than the finish frequency for a reverse sweep.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 12
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- DEFAULTS
-
- Yellow double line border on a centered blue window with white single-
- spaced text. No Clear Screen, Shadow or Zoom. Enhanced color will default to
- the text color with the opposite intensity. (/fYEL /bblu /gWHI /l2 /ewhi)
-
- Example: sw /kwhi /fblu /bred /gYEL "Line 1" /tWHI "Line 2" "Line 3" /s2
-
- This will display a blue (/fblu) on red (/bred) window with a shadow to
- the left and below it (/s2). The screen color will be white (/kwhi). Lines 1
- and 3 are bright yellow (/gYEL) and line 2 is bright white (/tWHI). See the
- batch file SW45DEMO.BAT for many more examples.
-
- If no text strings are passed, features such as Clear Screen (/k#),
- Query (/q...), Pause (/p#), Alert (/a#[,#]), and Outside Edge (/o#) can be
- used with no window output. (e.g. sw /p10 will pause for 1 second.)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 13
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- SCREEN DEFINITIONS
-
- Screen Definitions, introduced with version 4.0, greatly enhance the
- flexibility and power of SW. It simplifies the command line by putting all
- the switches and text into a file that SW can read into memory. Multiple
- windows can be defined in the file and displayed with one call to SW. Also,
- text handling by one window is expanded to 20 single spaced lines, more if
- EGA or VGA modes are used (See /X#, page 6).
-
- When you run SW45DEMO.BAT, you can easily see the advantages of using a
- screen definition. All switches just described are applicable in a screen
- definition, including Query, Pause, and User input. Windows will be displayed
- in the order that they are read from the file. A pause with the third window
- causes the pause to take place after the third window is displayed.
-
- In the batch file, the syntax for using a screen definition is:
-
- SW @filename [label]
-
- The definition can be in a separate file or even within the same batch file
- (See note on page 16). The optional label is used when more than one defini-
- tion is in the file. The default label is 'Display'. 'End_Display' marks the
- end of the definition.
-
- What follows is a breakdown of a portion of one of the screen defini-
- tions that can be found in SW45DEMO.BAT. There are a total of 5 definitions
- used by the demonstration, three of which are within the batch file and two
- are from external files.
-
- ┌─────────────────────┬─────────────────────────────────────────────────────┐
- │Default Label │ :Display │
- │first window │ _window /kcya┼ /r2 /s /bred /w /0 │
- │text 1 │ SW.EXE - Expanded Text Handling! │
- │text 2, new color │ /tWHI+ Multiple Windows! │
- │text 3, footer │ /m v 4.5 │
- │2nd window │ _window /r10 /s /bwhi /gblu /l1 /fred /0 │
- │text 1, new color │ /tBLU Optional Command Line Syntax: │
- │text 2 │ SW @filename [label] │
- │3rd window │ _window /r16 /s /bwhi /gblu /l1 /fred /0 │
- │text 1, new color │ /tBLU SW 4.x ADDITIONAL FEATURES │
- │text 2, fill line │ /tred /─ │
- │text 3, justify left │ /jl - Define the entire screen with multiple windows│
- │text 4 │ using external text files. │
- │4th window, pause │ _window /r25 /l0 /0 /p100- │
- │text 1 │ - Press any key for more - │
- │5th window, pause │ _window /r19 /bwhi /gblu /l0 /jl /0 /p100- │
- │text 1 │ - Text handling can be expanded to 20 single-spaced │
- │text 2 │ lines per window. │
- │. │ . │
- │. │ . │
- │Final label │ :End_Display │
-
- Page 14
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- └─────────────────────┴─────────────────────────────────────────────────────┘
-
- The _window line contains the switches that describe the window and
- screen and have the same form as they would on a command line, preceded by a
- slash and separated by a space. The lines that follow will be interpreted as
- text until another '_window' or the 'end_display' label is found.
-
- The text switches can appear on the same line preceding the text. The /t
- switch is used to change the color one line of text and is separated from the
- text by a space. /g can be used before a text line to change the color of the
- rest of the lines. /j can be used to change the text alignment and /m is used
- to specify a border message. Finally, /e is used to specify the "enhanced"
- text color. Multiple switches can precede the text. The text can be enclosed
- by quotes if additional spaces before or after are desired. This example has
- 4 pauses and defines small windows that fit inside larger ones to change the
- text without redrawing the whole window.
-
- If a different label is needed, simply substitute it for 'Display'. The
- label can be up to 15 characters. In SW45DEMO.BAT 2 of the other definitions
- use the labels 'Snd_Menu' and '4.5'.
-
- Note that when using the /k switch with a fill string in a screen
- definition, do not use quotes around the fill string. This is necessary
- because of the way the switch is processed when using the screen definition.
- As before, if you need spaces within the string, use the underscore (_)
- character. It will be replaced with a space.
-
- A Query will have to be the last item in the definition for the return
- code to be valid. User Input can occur anywhere but you will have to wait for
- the entire definition to be displayed before checking the answer.
-
- Environment variables will be evaluated when included inside a screen
- definition. This enables you to create a screen to display the user's answers
- or other information without having to resort to the command line mode. If
- the variable is not found, the variable name will be displayed in the window
- just as it appears in the screen definition.
-
- It is possible to "nest" screen definitions. One potential use is to
- reuse a portion of one definition and add a new window to it. Here's what a
- simple example would look like:
-
- :Display1
- :Display2
- _window ...
- text
- :End_Display1
- _window ...
- text
- :End_Display2
-
- The command "SW @file Display1" would show only the first window and "SW
-
- Page 15
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- @file Display2" would display both. Any line beginning with a colon (:) is
- ignored by SW. This technique could save some disk space.
-
- A Screen Definition can contain a special help window that can be
- accessed with the F1 key. A Query (See page 8) must be part of the screen def
- but it does not need to include the F1 key. The help window is preceded by
- "_window_help" and is defined the same as a regular window. This window is
- displayed only when the F1 key is pressed. It is a "popup" window which will
- disappear after pressing any key. The "_window_help" can appear anywhere in
- the definition and only one is permitted.
-
- ┌───────────────────────────────────────────────────────────────────────────┐
- │ One final note on Screen Definitions. If you include them in a batch file,│
- │ be certain that the flow of the batch file does not go through the screen │
- │ def. The DOS batch processor will not have any idea what those lines mean.│
- │ If you see a lot of "Bad command or file name" appearing when the batch is│
- │ run, check to see if the screen definition has been bypassed with a goto │
- │ or check for a goto that directs the batch file to the screen def. │
- └───────────────────────────────────────────────────────────────────────────┘
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 16
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- TIPS AND TRICKS
-
- - Change the contents of a window without redrawing the whole thing. Use
- the /l0 and /0 switches to create a window just big enough for the text and
- without a border. This way you can overwrite part or all of the inside of a
- window and change the text in a flash. The first demo screen definition above
- uses this technique.
- - Use the ECHO batch file command to create screen definitions "on the
- fly". If you use the redirect character > and the redirect with append >> you
- can build a screen definition while running the batch file. In SW45DEMO.BAT,
- this method is used to create the help screen for DI.EXE. Here is a portion:
-
- echo :Display > di.hlp
- echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
- echo SW.EXE - Now with DI!>> di.hlp
- echo /mc v 4.2 >> di.hlp
- echo _window /jl /s /0 /r9 >> di.hlp
- echo /mc Disk Information >> di.hlp
- echo.>> di.hlp
- di >> di.hlp
- echo. >> di.hlp
- echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
- echo - Press any key to continue - >> di.hlp
- echo :End_Display >> di.hlp
-
- The first line creates the file "di.hlp" and the following lines append to
- it. Then you call SW @di.hlp. Please note that, if quotes are used around any
- strings, the >> should be placed directly after the end quote so there won't
- be a space after it in the file. If there is a space, SW would display the
- end quote in the window which is probably not desirable. You should also keep
- in mind when capturing text from another program, that any text longer than
- 72 characters will be truncated and should be less than 20 lines long unless
- you are using an EGA or VGA mode (See /X#, page 6). If more lines are found
- they are ignored. This way you can show the result of an operation without
- destroying the look of the screen.
-
- - Use the Enhanced text color attribute (/e#) to display text in two
- colors on the same line. You could make whole words stand out in this manner.
-
- SW /tRED /eRED+ "{Blinking} Red"
-
- - If you want to display an empty window, set the size with /r#### and
- /c####, then pass one space in a string. SW /r814 /c2060 " "
-
- - Use a FOR loop to evaluate errorlevels returned by a Query. Although
- it is slower and requires the use of numbered labels, it can shorten a long
- series of IF ERRORLEVELs to one line. In the demo batch file, the sound menu
- uses a line like the following to select the sound:
-
- for %%e in (1 2 3 4 5 6 7 8 9 10 11 12) do if errorlevel %%e goto beep%%e
-
-
- Page 17
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- SHAREWARE INFORMATION
-
- These programs are "shareware". You are allowed to use the programs,
- free of charge, for a reasonable amount of time. If you find them to be
- useful, and continue to utilize them, a registration fee of $15 is required.
- This will entitle you to personal notification of future releases and give
- your suggestions for enhancements more value. Many of the enhancements listed
- in the history are the result of user comments and suggestions.
-
- *** BONUS PROGRAMS! ***
-
- Anyone registering SW 4.5 will receive a disk with the latest version,
- plus an additional program, SWV.EXE. This program is a simple text file
- viewer that integrates with SW. SW can generate a window and then call SWV to
- display the file within that window. This can be indispensable when a batch
- file needs to display a large amount of information with only a little work.
- SWV includes features like Search, Place Marks, and Zoom to full screen. SWV
- can be used as a stand-alone as well and is EGA 43 and VGA 28/50 line aware.
-
- You will also receive SW-DIR.EXE, a pop-up file directory for batch
- files. It inherits many of the appearance switches of SW while allowing the
- user to pick from the file list and return the name through the environment.
- DOS 3.3 or higher is required.
-
- The newest bonus program is SW-DOS.EXE which allows SW to call DOS
- commands or even batch files and have the output confined to a window. It can
- be used to display the results of file copying, archive extractions and even
- a shell to DOS. Now you don't have to sacrifice a nice SW screen just to be
- able to see what your batch file is doing.
-
- Finally, you will receive some more examples of what can be done with SW
- with a little work and imagination. Thanks to Bill Davis for HIS work and
- imagination. There is also an example of how multiple strings can be re-
- trieved with a screen definition.
-
- Registered SW 3.x users can upgrade to SW 4.5 for $5. This is a free
- upgrade for SW 4.x users. 4.x users who wish to receive SWV, SW-DOS and SW-
- DIR can do so by sending $2.50 for postage and handling to the address below.
- Please specify disk size. The file SW-45.REG is provided to simplify regis-
- tration and ordering. CompuServe Members can register by entering GO SWREG at
- the ! prompt and registering ID #641. Just follow the instructions online.
-
- Site licenses can be negotiated. Feel free to give it to friends or
- upload the original archive file to other BBS's provided that no fee is
- charged for distribution and it is not modified in any way. Note to BBS
- Sysops: Please post this archive file as is, with all files included, and
- without changing the filename.
-
-
-
-
-
- Page 18
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
-
- SW.EXE Ver. 4.5 - June 11, 1993
-
- Warren Small CIS 71076,407
- 35 Benjamin Street GEnie W.SMALL
- Manchester, NH 03109 Prodigy RSJW31A
-
- SW.EXE History
-
- 3.6 - 12/31/89 First general release.
-
- 3.7 - 02/01/90 Increased text lines to 5. Colors can be specified with
- 3 letter codes (p. 3). Added Here (/h#, p. 4), Double Spacing (/2, p. 3), No
- Margin (/0, p. 3), Enhanced text color (/e#, p. 5).
-
- 3.8 - 04/22/91 Added 3 border styles (p. 3), 3 shadow positions (p. 3),
- Pause Interrupt (/p#-, p. 8), User Input (/i#, p. 9).
-
- 4.0 - 10/31/91 User Input changed to modify environment rather than
- create SW-ENV.BAT (p. 9). Removed limit on Highlighting (p. 5). Added custom
- window border (/l#char, p. 3), Border Message (/m#, p. 5), Justify (/j#, p.
- 5), Outside Edge color (/o#, p. 6), 9 Alert sounds (/a#, p. 11), Wide window
- edge (/w, p. 3), Foreground color for screen (/k# /k#, p. 6), Query wildcard
- (p. 8), default (p. 8), and Pause timeout (/q*^ /p#-, p. 8), Window size
- control (/r# /r# /c# /c#, p. 4). Screen Definitions introduced (p. 14).
-
- 4.1 - 12/1/91 Enhanced User Input (p. 9). Pause, Query and User Input
- window changed to popup style. Added Fill String (/k#string, p. 6), Zoom
- Window (/z, p. 4), Input Line (/n#, p. 10), Uppercase Input (/u, p. 11), Draw
- Window to override popup (/d, p. 4, 11), custom environment variables
- (/i#var, p. 9). New utility added to check disks (DI.EXE, see separate docs).
-
- 4.2 - 2/2/92 Added Fill Line (/char, p. 11), shorthand window sizing
- (/r#### /c####, p. 4), Alert Freq, Duration (/a#,#, p. 11) or Note, Duration
- (/aN,#, p. 12), key buffer flush option for /Q (p. 9) and /I (p. 10), default
- value for /I by setting environment variable (p. 10), Window appearance
- modified slightly for bordered (1-4) and borderless windows. 5 text line
- limit removed from command line form of SW. Environment variables are now
- evaluated inside screen definitions (p. 15).
-
- 4.2a - 2/29/92 Fixed bug in environment variable evaluation in screen
- files which caused rest of file to be read improperly. Added another Query
- default indicator ^ for compatibility with NDOS (p. 8). User Input enhanced
- to allow large string input in small fields (/I####, p. 10).
-
- 4.3 - 6/30/92 /x# added for EGA 43 line & VGA 50 line modes (p. 6). SW
- now also detect and setup 43 and 50 line modes. Text lines longer than 70
- characters are truncated without displaying an error. "Nested" labels
- possible in screen defs (p. 15).
-
- 4.3a - 9/16/92 Corrected /w /l5 /─ bug. Added multi-input capability
-
- Page 19
-
- SCREEN WIZARD 4.5
- Warren Small
- (c) 1992
-
- for screen defs (p. 10).
-
- 4.3b - 11/22/92 Fixed /l0 /0 /x43 bug. Added /@# (p. 6) to set cursor
- position and /@- to hide it (p. 7).
-
- 4.4 - 12/16/92 Added /x28 mode for VGA displays (p. 6). Added use of {}
- to highlight groups of characters (p. 5). Allowed /E# to be used for each
- line of text (p. 5). Text handling increased for /L0 /0 windows to the
- maximum the screen will allow (80 characters by 25, 28, 43 or 50 lines.)
-
- 4.4a - 12/29/92 Fixed /I bug which caused input line to appear in the
- wrong place.
-
- 4.4b - 3/5/93 Help now in external file to shrink EXE and provide a way
- for the user to customize it. Added password blanking to /I (p. 10).
-
- 4.5 - 6/12/93 Window separator added (/ch/, p. 11). Function keys added
- to Query (p. 8). Help window added to screen def (p. 16). Alert Sweep tones
- added (p. 12).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 20
-