A1 DOS UTILITIES SERIES 2 HANDBOOK BATCH FILE ENHANCEMENTS AND TEST PROGRAMS Eric Rodda-Software PO Box 434 Parkholme, South Australia 5043 Included with the REGISTERED version of the A1 DOS Utilities only. CONTENTS ----------------------------------------------------------------------- WELCOME 1 PROGRAM SUMMARY 2 BATCH FILES 3 USING THE UTILITIES 7 HINTS AND EXAMPLES 9 REGISTRATION 17 AUTHOR'S COMMENT 19 HELP FOR PROGRAMS A1 20 ANSICHK 23 ASCII 24 BLANK 24 BLANKS 24 BOX 25 BUTTON 27 CLEAR 28 CLRLINE 29 COORD 30 DELAY 31 DOSVER 32 DRIVECHK 33 FILL 34 HL 35 JOYCHECK 38 KEYCHECK 39 KEYSPEED 41 MC 42 MODE3 45 MODE7 45 MOUSETST 46 MPAUSE 47 PICKESC 48 PLAY 49 READSCR 52 TIMEMARK 53 WAITFOR 55 WIPELEFT 56 WIPERITE 56 EL.BAT 57 APPENDIX A 58 APPENDIX B 59 1 Welcome to A1 DOS Utilities - Series 2 ----------------------------------------------------------------------- The original version of the utilities contained 18 programs for the enhancement of batch files and for testing various functions on the PC. Series 2 now includes extra programs and many of the originals have been updated with more features. Some of the many enhancements included in the A1 DOS Utilities are:- Changing screen colors, positioning text on the screen, delays in batch files, positioning boxes on the screen, filling the screen with patterns, playing music and sound effects, pausing for particular key to be pressed, timemark and many more ... Test programs included are KEYCHECK, MOUSETST and JOYCHECK for the keyboard, mouse and joystick (or paddles) respectively. Programs suitable for menu control are HL, PICKESC and MC (with the assistance of BOX or A1 etc). A quick note regarding the programs:- The utilities have help available on the command line by placing a /? after the program name: eg MOUSETST /? Command parameters will be expanded on in the section "USING THE UTILITIES" This HANDBOOK can be printed using the included batch file PRINT-HB. Your printer should be capable to print the extended ASCII graphic characters as these are used frequently thoughout the HANDBOOK. Please read the file UPDATE.TXT for the latest information. Enjoy ! 2 PROGRAM SUMMARY ----------------------------------------------------------------------- This section gives a brief discription of every utility in this series. A1.COM Multi-purpose batch file utility. BLANK.COM Screen clearing effect. BLANKS.COM Screen clearing effect. BOX.COM Put a rectangular/square box on screen. BUTTON.COM Displays a button (with text if required) on screen. CLEAR.COM Screen clearing effects. CLRLINE.COM Clear one or more lines of the screen. COORD.COM Puts coordinate markers around edge of screen. DELAY.COM Batch file delay. DRIVECHK.COM Detect if floppy drive is ready or not. FILL.COM Fill part or all of screen with a particular character. HL.COM HighLighted menu control. JOYCHECK.COM Joystick or paddle checking program. KEYCHECK.COM Keyboard checking, active ASCII and SCAN code display. KEYSPEED.COM Control the keyboard repeat rate and delay. MC.COM Mouse Control using 'click' sensitive areas of the screen. MODE3.COM Switch back to standard color video mode when required. MODE7.COM Switch back to standard mono video mode when required. MOUSETST.COM Mouse testing program with horiz. and vert. motion tests. MPAUSE.COM Mouse activated PAUSE command. PICKESC.COM A menu CHOICE type program with extras. PLAY.COM Make sounds, play tunes, real time music from the keyboard. READSCR.COM Read a screen character and return an errorlevel. TIMEMARK.COM Time/Date stamp may be redirected to file/printer. WAITFOR.COM Halt all operations until a specified time/day. WIPELEFT.COM Screen clearing effect. WIPERITE.COM Screen clearing effect. EL.BAT Show errorlevel from an executable program, COM or .EXE. MANUAL.EXE Electronic version of the handbook. 3 BATCH FILES ----------------------------------------------------------------------- A batch file, is a text (ASCII) file and can contain a list of COMMANDS, each on its own line which the computer can execute one after the other. Once the computer has completed all commands, it returns control to DOS and the PROMPT is returned to the screen. The COMMANDS can be .EXE, .COM or .BAT files (programs) or batch commands like CALL, ECHO, FOR, GOTO, IF, PAUSE, REM and SHIFT. If a .BAT (another batch file) program is to run from a batch file, then the CALL (DOS internal) command must precede the batch file name. If this is not done control will not return to the original batch file once the secondary batch file has finished. eg. In a batch file called CLICK.BAT we will call another batch file called SPEEDY.BAT. @echo off cd \sc call speedy cd \ menu In this case if CALL had not been used the "menu" would not have been run. If you were to run an .EXE or a .COM program from a batch file, simply place the program name on its own line. In this batch file called RUN.BAT, we will run the game TRICKY.EXE from the games directory. @echo off cls cd \games tricky cd \ The "echo off" tells DOS not to display the instructions in the batch file as it executes them. The "@" symbol on the first line tells DOS not to display this line. "cls" will clear the screen and the lines with "cd", change to the particular directory and then back to the root directory again. Batch files automate processes to save you typing out the same thing time after time. One of the features of batch files which is exploited by the A1 DOS Utilities is the "if errorlevel" program control. Many of the utilities have the ability to leave a "value" in the processor, on exit, so that the next process can use that "value" (errorlevel). 4 BATCH FILES (continued) I will describe the action using the program PICKESC. The program allows an exit from the program by matching one of characters in the string, following the program name, with a keypress of the same character. ie. If I enter:- PICKESC abcd the program will exit with errorlevel 1 if the "a" or "A" is pressed, errorlevel 2 if a "b" or "B" is pressed, errorlevel 3 if a "c" or "C" is pressed or an errorlevel 4 if a "d" or "D" is pressed. If ESC (escape) is pressed then errorlevel 0 is present as the program exits. NOTE:- Errorlevel processing is always done with the highest test first. The following example shows a simple MENU structure making use of errorlevel process using errorlevels zero to four. The example uses PICKESC.COM, A1.COM, MENU.BAT and SCR.BAT all [ON DISK]. MENU.BAT will now be shown in detail between the lines of stars. ***************************************************************** echo off cls :START rem The next line CALLs a batch file which displays the selections rem on the screen. (Study SCR.BAT to see how it`s done) call SCR PICKESC abcd if errorlevel 4 goto GAMES if errorlevel 3 goto SS if errorlevel 2 goto DB if errorlevel 1 goto WP if errorlevel 0 goto DOS :WP cls echo This would load the Word Processor rem ... rem ... Commands would be placed here rem ... inplace of these rems (remarks) pause goto START :DB cls echo This would load the Database rem ... rem ... Commands would be placed here rem ... in place of these rems (remarks) pause goto START 5 BATCH FILES (continued) :SS cls echo This would load the Spreadsheet rem ... rem ... Commands would be placed here rem ... in place of these rems (remarks) pause goto START :GAMES cls echo This would load the Games Sub-menu rem ... rem ... Commands would be placed here rem ... in place of these rems (remarks) pause goto START :DOS cls echo Type MENU to return to the menu ... ***************************************************************** In this batch file, PICKESC waits for either an a,b,c, or d to be pressed. Once done, the errorlevel is determined and the batch file control is transfered to one of the five LABELS. a ... errorlevel 1 ... :WP label b ... errorlevel 2 ... :DB label c ... errorlevel 3 ... :SS label d ... errorlevel 4 ... :GAMES label and ESC ... errorlevel 0 ... :DOS label In a real menu system there would be various commands in each section after the LABEL to change directories and run programs as required. Sub-menus can be used as suggested for the GAMES section with errorlevel 0 in each sub-menu returning to the :START label for the main menu. NOTE:- The commands in the SCR.BAT could be included in this MENU.BAT instead of CALLing it. (This was done as an example of CALL.) More batch files will be used as examples in the section "HINTS AND EXAMPLES". These can be studied to workout some of the many functions available. 6 BATCH FILES (continued) POINTS TO REMEMBER:- Batch files always have a .BAT extension. CALL other batch files from a batch file. ERRORLEVEL checking done from highest to lowest To run a program simply put the program name on a line by itself. (Change to the correct directory first) Spacing and indenting may be used as required. Remark (comments) lines to start with "rem " or ": ". FURTHER INFORMATION There are many books on the market which give extensive information on batch files. Look for books with titles that include things like "Advanced DOS ..." or "Power .." or "Batch .. Tricks". These books have a wealth of information on batch file techniques. If you are looking for a computer program about batch files, I can recommend the "QTUT" DOS tutorial for beginners or experienced users. This covers common DOS commands and right though to file and disk management. I would suggest registering this program because the registered version contains additional information on batch files, recovery procedures and lots more. QTUT is by Quirindi Concepts and is available from many shareware outlets and direct from the QTUT author:- David Stewart Quirindi Concepts PO Box 259 Quirindi 2343 NSW Australia 7 USING THE UTILITIES ----------------------------------------------------------------------- All of the A1 DOS Utilites have been written in Assembly Language, with basically the same format. All have command line HELP available with the " /?" switch after the program name:- eg BOX /? By using this switch on each program, the options will be explained. The latter part of this handbook contains all of the HELP screens. Generally each option uses a slash then a letter and then a number. Some options are simply turned on with a /x1 and turned off with a /x0. Other options use the numbers sometimes up to 255 to perform various tasks. A couple of commmon switches are the /Fn where n is a number from 0 to 15, and /Bn where n is a number from 0 to 7. These are for the foreground and background colors respectively for various programs. eg the color number 4 is for RED and the color number 14 is for YELLOW. All colors are listed in the command line HELP for those programs that use them; and in APPENDIX B. The order of the switches on the command line after the program name, is not important. (see exception, Page 8) If a program allows the use of a "string" in quotes, as an option, this can be positioned before, after or in between the switches. Any of the following are all valid command lines:- A1 "Testing" /c3 /f14 /b1 /m1 /y12 A1 /c3 /f14 /b1 /m1 /y12 "Testing" A1 /c3 /f14 /b1 "Testing" /m1 /y12 A1 "Testing" /m1 /y12 /c3 /f14 /b1 Notice that at least one space is required between switches or "strings". Strings must start and end with double quotes. The command line can extend up to 127 characters (allow it to scroll off the screen.) 8 USING THE UTILITIES (continued) SYNTAX and other ERRORS. If an error occurs from incorrect information or syntax errors on the command line, one of two things will happen:- Generally the HELP screens will be presented, showing the switch information. If this happens check the command line to ensure all switch values are within range, strings start and end with double quotes and that there is a space between each switch, etc. Some of the utilities have extended error handling, which give an idea about which area should be checked for errors. REDIRECTION The only program in the A1 DOS Utilities to allow redirection is TIMEMARK.COM so that output can go to a file or printer, etc. All other programs have direct screen writes, which will prevent any attempt to redirect output. Redirection to a file is performed in one of two ways. 1) To create a new file using the output of a program:- TIMEMARK /t2 > filename.ext ...this creates filename.ext. 2) To append to an existing file:- TIMEMARK /t2 >> filename.ext ...adds another line to file. Redirecting program output to the printer is either:- TIMEMARK /c3 > PRN ...to send to a printer. or TIMEMARK /c3 > LPTn ...where n is the printer port number (generally n=1) NOTE: The switches used for TIMEMARK here are just examples, others may be used as required. Further notes:- Exception to standard command line format ... PICKESC This program was originally written in the C Language for the:- CARD - Monitor Alignment package. It has now been re-written in Assembly Language and more features have been added. Backward compatibility has been retained at the same time. This means that PICKESC must be used exactly as shown on the help screen with the string of characters before any switches and NOT in "quotes". To see help screen for this program:- PICKESC /? 9 HINTS AND EXAMPLES ----------------------------------------------------------------------- SUBJECTS COVERED:- * DELAYING * SCREEN SAVING * SCREEN BLANKING * WAITING FOR A PARTICULAR KEY TO BE PRESSED * CHECKING FOR A KEYPRESS IN A BATCH FILE LOOP * CLEARING THE KEYBOARD BUFFER * STUFFING A KEY INTO THE KEYBOARD BUFFER * VIDEO MODE SETTING AND TESTING * SOUND EFFECTS * COLORED SCREENS AND LINE 24 * FINAL NOTE Note: The examples given in the text below are only suggestions, and in many cases not the only option available. Experiment !!! DELAYING DELAYING in batch files using A1 DOS Utilities. The following are shown for the most convenient way of causing a delay in the processing of a batch file. SHORT DELAYS For approx 1/18th second delay use PLAY /U0,1 1/2 second delay use PLAY /U0,9 ... etc. This is using the program normally meant for playing sounds. In this configuration the frequency is actually out of the range of human hearing (and PC speaker response)(>32KHz). The timing is controlled by the end figure, which represents the number of 'clicks'. There are approx. 18.2 clicks/second. MEDIUM DELAYS DELAY.COM is used for delays between 1 second and 255 seconds. eg. DELAY /S1 gives 1 second delay A1 /D1 gives 1 second delay DELAY /S99 gives 99 second delay A1 /D99 gives 99 second delay 10 HINTS AND EXAMPLES (continued) LONG DELAYS Once again, PLAY can be used for delays up to an hour (or more). Some examples:- PLAY /U0,5460 will give close to 5 minutes. PLAY /U0,10920 for 10 minutes delay. PLAY /U0,65535 will delay for close to one hour NOTE: this is the maximum time allowed. For two hours use:- PLAY /U0,65535 PLAY /U0,65535 ..how many hours do you want. NB.. It must be remembered that once a delay is initiated using the PLAY command, there is no escape (other than rebooting). DELAY 'TIL A PARTICULAR TIME WAITFOR.COM is used to delay a process until a particular time up to seven days ahead. Say, today is Monday and you want something to start on Friday at 10am, You could use this:- @ECHO OFF :START rem The following Excludes all days except Friday (day 6) WAITFOR /H10 /E123457 if errorlevel 2 goto START if errorlevel 1 goto END :PROCESS rem This is where you would put the command(s) for the rem process to begin on Friday at 10am. :END rem This is the normal finish and also the end if the "Q" rem key is pressed during the waiting time. REMEMBER: While this is in operation you can do nothing else with the PC. Ideal for ROBOT functions. Ensure a disk cache is running when excluding days, to prevent intense disk access. SCREEN SAVING and SCREEN BLANKING SCREEN SAVERS Some of the A1 DOS Utilities have an automatic or selectable screen saver option. These functions can be disabled if desired. Time before blanking is from 1 to 10 minutes. Those with automatic screen savers (default of 3 minutes) are:- HL.COM A1.COM when using the /P1 option PLAY.COM using the /K1 option 11 HINTS AND EXAMPLES (continued) PICKESC.COM has the option to enable a screen saver after one to ten minutes of keyboard inactivity. The option can be turned off completely if desired. All of the above screen savers return to the original screen when a key is pressed. There is no memory resident program running to enable these screen savers. The screen saving effect comes from within each program. No extra memory is used to save the screen; video paging is used for this effect. SCREEN BLANKING Other programs included in the A1 DOS Utilities can be used to blank the screen with all kinds of effects. In each case though, it must be remembered that the original screen display will be lost with the screen blanking effect. CLEAR.COM will erase the screen in a variety of ways:- To the right, to the left, from the centre out, from the border in and by random block delete. All of these effects can finish leaving the screen in any color, as it exits to DOS. BLANK.COM will clear the screen with a spiral out pattern then display a flashing diamond in the bottom right of the screen. The program then waits for a key stroke. BLANKS.COM will do the same as BLANK.COM, but finish with a scrolling message on the bottom of the screen. Waits for key. A1.COM can be used to clear the screen to a particular color before it does other functions as requested,eg:- A1 /C3 /Fx /Bx where the 'x' represents the colour number for the foreground (text color) and background. BOX.COM can be used to clear the screen to a particular color. eg. BOX /F14 /B1 /W78 /H23 /T0 will clear the screen to a blue background with yellow text color.(the box is the whole screen (with no border and no shadow)). The prompt will then appear at the bottom of the screen. 12 HINTS AND EXAMPLES (continued) WAITING FOR A PARTICULAR KEY TO BE PRESSED Yes, once again there are some alternatives for this in the A1 DOS Utilities. PICKESC.COM The easiest to use, if that's all you want to do, is the program PICKESC. Say you want to ask for a response, Yes or No .... Part of the batch file could look like that which is shown next:- ...[ONDISK] PDIR.BAT :- @ECHO OFF :START cls echo Would you like a DIR listing ? (Y)es or (N)o PICKESC yn if errorlevel 2 goto NO if errorlevel 1 goto YES if errorlevel 0 goto START :NO goto END :YES DIR :END The yn after the PICKESC command could have been YN, it doesn't matter. If a Y or y is pressed the batch file accesses the commands after the :YES label, because PICKESC exited with an errorlevel of 1. If an N or n is pressed the commands after the :NO label are processed, because an errorlevel 2 was output from PICKESC after the key was pressed. The ESC key causes the batch file to loop back to :START. The line "if errorlevel 0 goto START" could have read simply "goto START" as the batch file errorlevel testing simply falls off the bottom for errorlevel 0 automatically. In this case PICKESC waits for either a "Y" or "N", or ESC to be pressed. More alphanumeric characters can be added to the string after the PICKESC command, then the appropriate errorlevel testing done for the relative position of each character in the string. REMEMBER:- Errorlevel checking is always done from highest to lowest. 13 HINTS AND EXAMPLES (continued) A1.COM Another approach to the waiting for a key to be pressed is through the use of the A1.COM command. The beauty of using the A1 command is the fact that other things can also be done on the one command line. The next batch file (section) shows how to do the same process as above using the A1 command. [ON DISK] ADIR.BAT @ECHO OFF :START A1 "Would you like a DIR listing ? (Y)es or (N)o " /c1 /y11 /m1 /p1 if errorlevel 49 if not errorlevel 50 goto NO if errorlevel 21 if not errorlevel 22 goto YES goto START :NO A1 "\" /x0 goto END :YES DIR :END Not only does the A1 command shown here wait for a key, it clears the screen, repositions the cursor row, centres the text on that row, and initiates a screen saver (after 3 minutes). NOTE:- The errorlevel checking here is testing for particular key scan-codes (APPENDIX A) so must exclude other possible key presses. Any key other than:- n,N,y,Y would cause the line "goto START" to take effect. CHECKING FOR A KEYPRESS IN A BATCH FILE LOOP Once again the A1.COM program comes to the rescue. To exit a batch file loop normally, one would hit the key combination and then DOS would present the user with the frightening message:- Terminate batch job (Y/N)? (or something similar) Wouldn't it be nice to be able to exit nicely? Sample batch file (section) [ON DISK] KDIR.BAT:- @ECHO OFF :START rem Please note that the next line could do rem something a little more useful !!! DIR A1 "Press the 'Q' key to quit.\" /n80 /d101 A1 /k1 if errorlevel 16 if not errorlevel 17 goto QUIT goto START :QUIT 14 HINTS AND EXAMPLES (continued) NOTE: the /k1 switch could have been included in the line above it, but is separated here to show the simplicity of the function. This procedure will occur without interrupting the normal loop operation. The errorlevel check can be changed to match nearly any keyboard character, even function keys. (APPENDIX A) CLEARING THE KEYBOARD BUFFER Before you ask for a user to press a key, in a batch file you should always clear the keyboard buffer of any keys which may have been stored there from over typing. This is accomplished by using the A1.COM program. A1 /k1 (This may include other switches and "text" as well.) A1 /K1 "\Press any key" /P1 /M1 STUFFING A KEY INTO THE KEYBOARD BUFFER Why? ... What for? Well how many times have you started a program or game and have been asked to push a particular or 'any key' ? A1.COM has a function which can stuff (technical computer term - by the way) or push a keystroke into the IBM keyboard buffer. NOTE: This process is not successful if the program you are about to run, clears the keyboard buffer before it does anything else. Keep that in mind. Typical examples:- To stuff an [ENTER] A1 /S13,28 [SPACE] A1 /S32,57 [ ESC ] A1 /S27,1 [ F6 ] A1 /S0,64 [ Y ] A1 /S89,21 [ N ] A1 /S78,49 Taking the example of the 'Y', the 89 represents the ASCII code and the 21 is the SCAN code. The ASCII codes are available in DOS manuals, BASIC manuals, printer manuals and from the program ASCII.COM. The scan codes are in APPENDIX A of this HANDBOOK. For keys with no ASCII equiv. (like function keys) use 0 for the ASCII code. Separate each code with a comma but no spaces. For multiple key pushing use muliple A1 /Sxx,yy lines in the order the keys are required. The keyboard buffer will hold up to 16 keystrokes. 15 HINTS AND EXAMPLES (continued) STUFFING A KEY INTO THE KEYBOARD BUFFER (cont.) Use it in this way:- Say the game FLOPTOP required you to press either the Y or the N key from the first screen (to read instructions, yes or no), just enter this code into a batch file. A1 /S78,49 FLOPTOP The first screen then flashes past without you having to push any keys, bypassing the instructions. VIDEO MODE SETTING AND TESTING Setting the video mode can be accomplished with the following. To SET the video mode to Mode 7 (mono) use MODE7 or A1 /r7 To reset it to Mode 3 (standard color) use MODE3 or A1 /r3 To obtain 40 column (large) text use A1 /r0 or A1 /r1. To TEST which mode is currently operating, use A1 /e2 /v1. The mode number will be displayed on the screen as well as being the exit code (for errorlevel checking). WARNING: Attempting to switch to a video mode, which the system is not capable of, could cause the system to lock up. Eric Rodda-Software distribute a screen testing program called CARD, which will safely test the system to see which video modes are available as well as other things like test patterns, purity screens, dots and crosshatch etc. (Unregistered version $5.00, registered $25.00) SOUND EFFECTS Adding sounds to batch files can inform the user of an event which is about to occur, or has just occured. It can also be used to indicate to the user correct or incorrect keyboard response, etc. To attract someone's attention, a good sound to use is: PLAY /W10 ...a warble To indicate correct input you could use:- PLAY /p1 or PLAY /u600,1 800,1 or even A1 /n80 To indicate incorrect response use: PLAY /b2 or PLAY /u200,4 0,1 200,4 or A1 /n20 See the PLAY and A1 HELP sections of this HANDBOOK to obtain more information. Make your own sound combos... 16 HINTS AND EXAMPLES (continued) COLORED SCREENS AND LINE 24 What a strange section title! Yes, but a very valuable hint. When using A1 and other commands which change the color of the screen text, particularly background color, a strange thing may happen when the effect finally reaches the bottom screen line. This is line 24, the 25th line, ( remember:- 0 - 24 ) You may find that as the screen then scrolls up, the background of the whole screen follows that of your original line. This is not usually desired. How is it fixed? ....easy .....simply use an /Xn switch in the command line of that program which allows such swithes. eg /X1 puts the text just one position from the left. Use any 'n' value allowable other than the /X0 switch. Additional note regarding line 24 ... Normally try to stay clear of using line 24, when building a screen display, unless the next thing you do is to clear the screen, because of the scroll up of the screen display, which looks messy and unprofessional. FINAL NOTE You may have noticed that in nearly all instances, A1.COM can be used for each function. In some cases using another program which may have extended functions in it's specialised field may be better. You will have to examine the HELP sections for each program to determine which one is the best to use in each instance. 17 REGISTRATION ----------------------------------------------------------------------- This is a registered copy of the A1 DOS Utilities. The information below is for anyone else who may want to register. Registration benefits include free and automatic updates as they become available. Do not hesitate to contact Eric Rodda-Software with suggestions and comments, whether you have registered or not. Companies using the software on more than one PC should apply to Eric Rodda-Software with complete details (number of users etc.) for the cost of a site licence to cover multiple users. Registration Costs. (In Australia) Complete package:- A$20.00 (Outside Australia) Complete package:- A$24.00 All prices INCLUDE postage. If a shareware version is required. This may be obtained from many shareware distributors or direct from the author. The cost of this shareware version (from the author) is only A$5.00 in Australia or A$9.00 for those ordering from outside Australia. To order, send your request with your payment, to the address shown below. If you have purchased this registered software as a retail product please return the registration form with your proof of purchase/ receipt to Eric Rodda-Software to be registered. This will ensure you are included on the mailing list to receive all the advantages of a registered user. There is no charge for this, but please ensure that the proof of purchase/receipt shows clearly the name and address of the software dealer. Please note that all prices are in Australian dollars. Money sent should be in the form of International Money Order or Overseas Draft in Australian Dollars payable at an Australian Bank. Personal cheques will not be accepted from outside of Australia. (Vendors may have other registration options available. If this is the case, there will be text files on the distribution disk with full details.) All registrations and correspondance should be addressed to:- Eric Rodda-Software PO Box 434 Parkholme 5043 South Australia 18 REGISTRATION (continued For those who require it, please fill in a copy of the following Registration form and post this with your payment to this address. To:- Eric Rodda-Software * From:- _____________________________ PO Box 434 Parkholme 5043 _____________________________ South Australia _____________________________ * Please show whether the COMPANY or PERSONAL name is to go on the _____________________________ Registration Certificate.(Circle one) _____________________________ Please supply ____ copy(ies) of the A1 DOS Utilities package. A$ ____.00 NOTE: Disk media is 90mm (3.5"). This form may also be "PRINT SCREENed" from within the MANUAL.EXE program. 19 AUTHOR'S COMMENT ----------------------------------------------------------------------- I trust that this HANDBOOK will be of use to you in unleashing some of the many features of the A1 DOS Utilities - Series 2. Have you tried DEMO.BAT yet? From the previous topics you have been shown just some of the features of the powerful utility - A1.COM. This one single program can be made to to just about anything! What other utility can, on one command line, change the video mode, clear the screen, place colored text in the middle of the screen, hide the cursor then wait for a key-stroke ? Please don't stop experimenting, and don't forget to send me your comments and suggestions. The following sections of the HANDBOOK cover all of the HELP screens from all of the A1 utilities. PLEASE NOTE:- Even though all care has gone into the programing of these utilities, Eric Rodda-Software can accept no responsibility for any damage that may occur to any part of the computer system or data on which these utilities are being used. Eric Rodda 20 A1.COM ----------------------------------------------------------------------- INTRODUCTION ... Originally produced to enchance the DOS ECHO command. The main purpose was to allow you to put text on the screen anywhere, any color and either horizontally or vertically. This program allows many features for batch file processing. eg:- * CLEAR the screen (to a particular color):- A1 /Cx (/Fx /Bx) * PAUSE and wait for keystroke, exiting with errorlevel:- A1 /P1 * HIDE the cursor:- A1 /H1 * Clear KEYBOARD buffer:- A1 /K1 * VIDEO screen saver (in conjunction with PAUSE):- A1 /P1 /Vx * RESET video mode:- A1 /Rx * Move the cursor to a particular or random row (and/or column in a batch file):- A1 /Yx (/Xx) * Move the cursor to a relative row:- A1 "\\\" (moves down three rows). * DELAY (before/after message displayed) in x seconds:- A1 /Dx * Push (Stuff) a key into the keyboard buffer:- A1 /Sxxx,yyy * Make a sound(noise!) in the PC speaker of selected frequency:- A1 /Nx All of the above can be used in various combinations with or without "text". * Force ERRORLEVEL on output (Not to be used with any other option) Usage:- A1 "Text to display" [switch] ... [switch] [switch] The standard switches can be place anywhere on the command line, before or after the "text in quotes". An error on the command line will result in an error message being given. Command line switches ( NOTE:- All are optional! ):- /? The HELP system. /T0 - T1 Text type: /T0 gives horizontal text (default), /T1 vertical. /X0 - X79 (/X99) X Coord: Column number of the start of the text. Left column = 0 (RANDOM = /X99) (default=current col) /Y0 - Y24 (/Y99) Y Coord: Row number of the text. Top row = 0 (RANDOM = /Y99) (default=current row) /C0 - C3 Clear the screen (before displaying text). (default = 0 = NO) /C1 Clears the screen (white text on black background). /C2 Clears the screen with the color under cursor. /C3 Clears the screen under control of /Bx and /Fx. NOTE:- /Cx /Ox will change the screen bOrder colour(where /Ox values=/Fx values) 21 A1.COM (continued) /P0 - P1 Pause after displaying text and wait for keystroke. /P1 gives a pause. (default = 0 = no pause) Program exits with ERRORLEVEL set to SCAN-CODE of key press. (See Appendix A for SCAN-CODE Table) /F0 - F115 Text color (0=black, 1=blue, 2=green, 3=cyan 4=red, 5=magenta, 6=brown, 7=white, 8=gray, 9=bright blue 10=bright green, 11=b/cyan, 12=b/red 13=b/magenta 14=yellow, 15=b/white (default=current foreground color) (+100 for flashing foreground color) /B0 - B7 Background color (as per list for text, up to 7) (default = current background color) ***See ADITIONAL NOTES for background colors /B8 to 15. /M0 - M1 Centre (middle) the text on the screen on the row OR column (1=YES (default=NO=/M0) This will defeat the /Xx or /Yx setting respectively. /H0 - H2 Hide cursor (1=YES default = NO, 2=restore cursor(top left)) (/C1 returns the cursor and clears the screen(see above), (as does the DOS CLS command)). /D0 - D199 Delay in seconds before (or after +100) the text (if any) is displayed. (Time values 0-99 secs (default = 0 seconds)) /V0 - V10 Video screen saver when using /P option. /V0 = No screen saver, /V10 = 10 minutes (default = 3) /Sxxx,yyy Stuff key into keyboard buffer, where xxx = ASCII-CODE and yyy = SCAN-CODE of the character(key) in decimal format. eg. /S13,28 will simulate pressing the ENTER key. /S0,64 will simulate F6 key. /S89,21 simulates the "Y" key. ASCII values are available from the DOS, Printer or BASIC manuals. /R0 - R3, R7 Reset TEXT VIDEO MODE.(NOTE:-This will clear the screen) /R0 = 40 columns * 25 rows 16 colors (gray scaled on composite monitors) /R1 = 40 * 25 16 colors /R2 = 80 * 25 16 " (gray scaled on composite monitors) /R3 = 80 * 25 16 colors /R7 = 80 * 25 monochrome text mode /N4 - N255 This produces a sound(noise!) in the PC speaker. The number entered after the N is multiplied by the program to produce a frequency between 40Hz and 2550Hz, with a duration of approx. a quarter of a second. (If a value below N4 is given, a faint click sound will be heard from the speaker, (and a pause of approx. a quarter of a second will result). 22 A1.COM (continued) /K0 - K1 /K1 causes the keyboard buffer to be cleared as program begins. (default = /K0) If there was a key waiting in the keyboard buffer, the program exits with an ERRORLEVEL equal to the SCAN-CODE of the key. If more than one key was in the buffer, only the last is used to give the ERRORLEVEL. (This ERRORLEVEL feature is defeated if the /P1 option is used.) /I0 - I1 /I1 will enable /B8 to 15 for bright background colors, disabling flashing foreground colors. /I0 will disable bright background colors and enable flashing foreground colors. See the ADDITIONAL NOTES section for details in using this feature. ERRORLEVEL SETTING This section explains the special area of setting the ERRORLEVEL, displaying it (if required), and then EXITing the program. The ERRORLEVEL can be set to match any of the following "units", by using an additional switch or switches after the /Ex switch. NOTE: These additional switches may have the same letters as other standard switches for A1. /Ex cannot be used with other standard switches, so this is not a problem. All ERRORLEVEL requests (/Ex) must begin with either /E1 or /E2, where /E2 will show the ERRORLEVEL on screen on exit. Example syntax:- A1 /E1 /V1 to exit with video mode ERRORLEVEL Available switches:- /Ex /V1 Gives the current video mode. /Ex /C1 /X1 The current cursor X (column) position (0-79). /Ex /C1 /Y1 The current cursor Y (row) position (0-24). /Ex /Nx Forces an ERRORLEVEL as specified (x) in /Nx (0-255) /Ex /R1 [/Lx] [/Ux] Gives a random ERRORLEVEL, a lower (/Lx) and/or an upper (/Ux) limit can be set. (0-255) /Ex /S1 /F1 Gives foreground screen color (0-15) /Ex /S1 /B1 Gives background screen color (0-7) NOTE:- For both screen color options, output is for current cursor position only. COLORS:- 0 BLACK 8 DARK GRAY 1 BLUE 9 LIGHT BLUE 2 GREEN 10 LIGHT GREEN 3 CYAN 11 LIGHT CYAN 4 RED 12 LIGHT RED 5 MAGENTA 13 LIGHT MAGENTA 6 BROWN 14 YELLOW 7 LIGHT GRAY 15 BRIGHT WHITE (WHITE) 23 A1.COM (continued) ADDITIONAL NOTES for A1.COM... ANSI.SYS is not required for the effects of this program. It is better not use it. If ANSI is used, the color of the PROMPT will still be under the control of it. (Remove the line from CONFIG.SYS, then reboot.) If a carriage return/line feed(autoindent) is required use a \ character in between the quotes. eg. "Like this\". This feature disables the auto X re-positioning of long strings (if X value too large). If a \ or a [ character needs to be displayed, place a [ before it. If more than one switch with the same option letter is placed on the command line, only the first one will be used. A typical example of use:- A1 "Just Testing" /f14 /b3 /m1 /y21 This will put the text, Just Testing on line 21, in a yellow on cyan color in the middle of the line. Bright background colors. ------------------------- To enable /B8 to 15 you must include the /I1 switch (at least once). Note, when using the /I1 switch feature, this will affect the whole screen. Any text flashing will stop flashing and background colors may be brightened. To turn off bright background colors for the whole screen use the /I0 switch (re-enabling flashing text, if any). The screen may flash as the mode changes from bright background colors or flashing modes as the video card resets; this is normal. It is a good idea to leave your program (batch file) using /I0 switch to ensure the video card is left in the normal mode - for the next program. This feature is not available with CGA video cards. ANSICHK.COM ----------------------------------------------------------------------- This program will detect whether ANSI.SYS is loaded or not. If ANSI.SYS is loaded the program exits with errorlevel of 1 and 0 if not loaded. This program will only work for DOS versions of 4 and above. 24 ASCII.COM ----------------------------------------------------------------------- This program simply displays the ASCII characters and there equivalents in Decimal and Hexadecimal. The mode is toggled with the SPACE bar. Both standard and extended characters are shown. Even "characters" that are normally used for control functions are shown. If the screen is printed these control characters may upset the printing; just keep this in mind. BLANK.COM ----------------------------------------------------------------------- This program will clear the screen in a "spiral out" pattern then display a  (flashing) in the bottom right corner of the screen. A keystroke will then return control to DOS. Command-line switches:- /? the HELP screen. BLANKS.COM ----------------------------------------------------------------------- This program will clear the screen with a "spiral out" pattern then display a scrolling message on the bottom line of the screen. A keystroke will then exit the program. Command-line switches:- /? the HELP screen. 25 BOX.COM ----------------------------------------------------------------------- This program puts a box on the screen, one of four different types and of any color, in any position. Usage:- BOX switch [switch] ... [switch] [switch] Any switch value OUT OF RANGE will result in the HELP system appearing. Command-line switches :- /? The HELP system. /T0 - T3 Box type: T3 gives thick line box, T2 gives double line box. T1 gives single line box T0 gives a filled area of selected background color without a border. (default = 1) /X0 - X78 X Coord: Column number of the top left corner of box. Left column = 0 (default = 20) /Y0 - Y22 Y Coord: Row number of the top left corner of box. Top row = 0 (default = 6) /W1 - W78 Inside width of box.(default = 38) /H1 - H23 Inside height of box.(default = 10) /F0 - F15 Frame color (0=black, 1=blue, 2=green, 3=cyan 4=red, 5=magenta, 6=brown, 7=white, 8=gray, 9=bright blue 10=bright green, 11=b/cyan, 12=b/red 13=b/magenta 14=yellow, 15=b/white (default=7) /B0 - B7 Background color (as per list for frame, up to 7)(default=0) (B8 -B15 may be obtained if A1 /I1 has been used previously) /C0 - C7 Clear the screen with a particular color before displaying box, (as per list for frame, up to 7) NOTE:- There is no default. eg. /C0 = Black, or /C3 = Cyan ... etc. This is separate to the above settings for /Fx and /Bx If you do not want the screen to clear before box is displayed, leave this switch out. /S0 - S2 Place shadow behind box, 1=dark, 2=light, 0=none (Shadow has BLACK background, so do not use /C0). /I0 - I1 Interia of framed box filled (default = 1 = yes). /P1 Preset set of boxes (9) for use with the MC (Mouse Control) program. (Great for mouse controlled menus !) All switch labels can either be upper or lower case. 26 BOX.COM (continued) An example:- BOX /c3 /x0 /y0 /f14 /b1 /w10 /h5 /s1 This example clears the screen to cyan and puts a yellow box on a blue background, with shadow, in the top left of the screen. The box has an internal width of 10 characters and an internal height of 5 lines. NOTE:- If a box position is requested for a box size which would normally overlap the edge of the screen, the X,Y coords. will automatically be adjusted by the program. This ensures that "video wrap around" does not occur. 27 BUTTON.COM ----------------------------------------------------------------------- This program puts a button on the screen. Text may also be added on the same command line. Usage:- BUTTON ["Text string"] [switch] ... [switch] [switch] Any switch value OUT OF RANGE will result in this HELP system appearing. Command-line switches :- /? This HELP system. /X0 - X77 X Coord: Column number of the top left corner of button. Left column = 0 (default = current column) /Y0 - Y22 Y Coord: Row number of the top left corner of button. Top row = 0 (default = 6) /W1 - W78 Inside Width of button.(default = 1) This value is automatic if a "Text string" is included. (See notes on Text strings). /H1 - H23 Inside Height of the button. (default = 1) This value is completely automatic when using Text strings. (See notes on Text strings). The automatic value may be increased by adding a /H value. /F0 - F15 Text color (0=black, 1=blue, 2=green, 3=cyan 4=red, 5=magenta, 6=brown, 7=white, 8=gray, 9=bright blue 10=bright green, 11=b/cyan, 12=b/red 13=b/magenta 14=yellow, 15=b/white (default = current foreground color) /B0 - B7 Text Background color (as per list for text, up to 7) (default = current background color) NOTES:- The button color is made up of bright white for the top left corner and black for the bottom right corner. (If the current background color is black this corner will be dark grey instead. "Text strings" A single line Text string of up to 78 characters may put in between quotation marks. Spaces may me used to format the text. More than one line of text may be placed in the button by using the \ character in the text. Every time the program sees a \ it adds a new line and automatically updates the height of the button. When the \ character is included the automatic Width function is disabled and the /W with value will have to be used. 28 CLEAR.COM ----------------------------------------------------------------------- This program will clear the screen in a variety of ways. Command-line switches:- /O spiral Out clear /I spiral In clear /L clear from right to Left /R clear from left to Right /B clear by deleting "random" Blocks /? the HELP screen. Placing a number (0-7) after the letter of the switch, will clear the screen to that respective background color (default = black). eg. CLEAR /R4 clears to red. 0=black, 1=blue, 2=green, 3=cyan, 4=red, 5=magenta, 6=brown, 7=gray(white). (Be careful using 7, for this is the same as the text color.) 29 CLRLINE.DOC ----------------------------------------------------------------------- This program clears a selected number of lines to current or selected color attributes for foreground and background, then places the cursor (not the DOS prompt) on the (first) selected line; for batch files. Usage:- CLRLINE [switch] ... [switch] [switch] ... Any switch value OUT OF RANGE will result in the HELP system appearing. If no switches are present CLRLINE will simply clear the next row on the screen at DOS, or current line in a batch file. Command-line switches :- /? The HELP system. /N0 - N25 Number of lines to clear. (default = 1) /Y0 - Y22 Y Coord: ROW number to start CLRLINE. Top row = 0 (default = current) /F0 - F15 Foreground color (0=black, 1=blue, 2=green, 3=cyan 4=red, 5=magenta, 6=brown, 7=white, 8=gray, 9=bright blue 10=bright green, 11=b/cyan, 12=b/red 13=b/magenta 14=yellow, 15=b/white (default = current at selected ROW) /B0 - B7 Background color (as per list for foreground, only up to 7) (default = current at selected ROW) 30 COORD.COM ----------------------------------------------------------------------- This program gives a co-ordination display around the outside of the screen, leaving the rest of the screen alone. This is for the purpose of determining the X (across the horizontal) and the Y (vertical) position of an area on the screen. Usage:- COORD [switch] [switch] Any switch value OUT OF RANGE will result in the HELP system appearing. Command-line switches :- /? The HELP system. /T1 - T3 Type of coordination display, 1 = all around screen, 2 = top and bottom only, 3 = left and right only (default = 1) /Y1 - Y24 Y Coord: Row number of the prompt on exit. (default = 2) All switch labels can either be UPPER or lower case. An example:- COORD /T2 /Y6 This will produce top and bottom co-ordination bars, then place the prompt on line (row) 6. Note:- See MC /T1 for active coord. display. 31 DELAY.COM ----------------------------------------------------------------------- This program will cause delay in the batch file in which it is run. The delay is in seconds. (minimum for all options = 1 second) Command-line options:- /? or no arguments, the HELP screen. /Svalue Where value is from 1 to 255 seconds (4.25 minutes). /V1 Verbose:- to show delay value on screen. /K1 Allow any key (except P) to interrupt the delay, and exit. The P key will cause permanent delay until any key is pressed. The program then exits with an ERRORLEVEL equal to the SCAN-CODE of the key pressed. (See APPENDIX A for SCAN-CODE Table) By using: IF ERRORLEVEL (xx) IF NOT ERRORLEVEL (xx+1) GOTO .. testing, batch files can be constructed to allow choices during the timing (delay) period. ((xx) = errorlevel from 1 to 83) /C1 Clear the keyboard buffer as program begins. /D1 Display countdown in seconds remaining. As well as switches, text can be enclosed in quotes to be displayed on the screen. eg:- "Any message to display". (Using this will override the /V1 switch) Please note that this program is not meant to give precision timing. The processor speed will vary the timing slightly because of individual instruction speed. Errors of up to 10% have been found. The /S number can be adjusted while using a stopwatch or similar. An example of a simple delay timer is:- DELAY /S12 "Pausing for 12 seconds ..." This will give a delay of 12 seconds, and display a message on screen. 32 DOSVER.COM ----------------------------------------------------------------------- This program will detect the version of DOS running and exit with errorlevel indicating the Major Version number or exit with an indication that the DOS version is equal to or higher than that specified on the command-line. This program will work for DOS versions of 2 and above. Command-line switches:- /? this HELP screen. /Vx where x is the Major DOS Version number to compare actual DOS version with. If the actual DOS Version is equal to or higher than that specified the errorlevel will be 0. If not, the errorlevel will be 1. When no command-line switches are used the errorlevel will indicate the Major DOS version number. eg for DOS Ver 6.22 the Major Version number is 6. 33 DRIVECHK.COM ----------------------------------------------------------------------- This program tests whether a selected or current drive is ready. ie. for a floppy drive - this disk is in and the door is closed. Any valid hard drive or floppy drive can be tested in this way. If the drive is ready the program exits with an exit code (errorlevel) of 0, and if the drive is not ready it exits with exit code of 1. Switches available:- /? The HELP screen /D0 - D26 Drive number, where 0 is current drive and 1=A: 2=B: etc. /I0 - I1 Info about drive, (Default=0=no info). /X0 - X54 X Coord: Column number of start of message (Default=current) /Y0 - Y21 Y Coord: Row number of start of message (Default=current) /F0 - F15 Text color (0=black, 1=blue, 2=green, 3=cyan 4=red, 5=magenta, 6=brown, 7=white, 8=gray, 9=bright blue 10=bright green, 11=b/cyan, 12=b/red 13=b/magenta 14=yellow, 15=b/white (default=current foreground color) /B0 - B7 Background color (as per list for text, up to 7) (default = current background color) 34 FILL.COM ------------------------------------------------------------------------------ This program fills an area of the screen, with any character and of any color, in any position - FAST. Usage:- FILL switch [switch] ... [switch] [switch] Any switch value OUT OF RANGE will result in this HELP system appearing. Command-line switches :- /? The HELP system. /T0 - T255 Type of fill character - ASCII code (default = 176 ° ) (See printer, Basic or DOS manuals for ascii codes) /X0 - X79 X Coord: Column number of the top left corner of the area. Left column = 0 (default = 0) /Y0 - Y24 Y Coord: Row number of the top left corner of the area. Top row = 0 (default = 0) /W1 - W80 Width of area to fill.(default = 80 (one full line)) /H1 - H25 Height of the area filled.(default = 25) /F0 - F15 Foreground color (0=black, 1=blue, 2=green, 3=cyan 4=red, 5=magenta, 6=brown, 7=white, 8=gray, 9=bright blue 10=bright green, 11=b/cyan, 12=b/red 13=b/magenta 14=yellow, 15=b/white) /B0 - B7 Background color (as per list for foreground, only up to 7) /P1 - P10 Preset full screen fills of the character (176) ° each of a different colour combination. The foreground/background colors for each is as follows:- P1 7,0; P2 7,4; P3 14,1; P4 12,1; P5 5,2; P6 7,6; P7 1,6; P8 9,7; P9 7,1; P10 15,5. NOTE:- Any combination of the these switches (options) can be used. e.g. A preset may be used and then any other part modified with other switches. All switch labels can either be upper or lower case. An example:- FILL /T42 /F14 /B1 /W40 /H12 /X20 /Y6 This example puts a rectangle of yellow stars on a blue backgound in about the centre of the screen Another example:- FILL /P3 This example is a preset one, which fills the screen with a shaded character, yellow on blue. 35 HL.COM ----------------------------------------------------------------------- This program allows sophisticated control of highlighted bars for menus. The maximum number of bars is 25 and minimum number is 2 ! Control is with a) arrow keys, then enter (or ESC,(see below)), or b) with number keys (if enabled), or c) mouse movement then click mouse button. The use of optional "menu_options" is available. If these menu_options are NOT used, a screen must be displayed over which the highlight bars are superimposed. The program exits with errorlevel 1 - 25 depending on bar position. ESC exits with errorlevel of 0. The following describes all the functions and options of the program in detail. Command-line switches ( All are optional ):- /? The HELP system. /M0 - M1 Mouse is enabled (default=1) /M0 to disable. /N2 - N25 selects Number of bars on screen (default=9) /X0 - X79 X co-ord for left end of bar (default col=27) (Auto position for menu_option mode is default) /Y0 - Y24 Y co-ord for bar (default row=4) NOTE:- top row=0 and left column=0. /L0 - L80 Length of each bar (default=25) (Auto length in menu_option mode is default) /D0 - D5 exit Delay in seconds (default=1 sec) /S1 - S20 Separation between bars (default=2) /V0 - V10 Video screen saver (default=3 =3 minutes)(0=off) /E0 - E1 Erase on exit (0=no erase) (default=1) /A0 - A3 Arrow keys (left & right) (disable=0(default)) /A1=left only, /A2=right only, /A3=both Left arrow exits with errorlevel of 30. Right arrow exits with errorlevel of 40. This option allows access to the next menu selection list when using /E0 option 36 HL.COM (continued) COMPLETE COMMAND LINE MENU ENTRY (Menu_option mode) This explains how to use HL without having to display the menu screen before running HL (eg. text file or other screen display). By including the menu_options in quotes on the command line these will be displayed in the corresponding bar position. The number of bars will automatically be set by the number of menu_options and the length of the bars is automatically set. The menu_options can include any text and spaces for formatting. These EXTRA command-line switches are then available to use:- "Menu option 1""Menu option 2""etc" (max. of 25 strings) /F0 - F15 Foreground color (0=black, 1=blue, 2=green, 3=cyan 4=red, 5=magenta, 6=brown, 7=white, 8=gray, 9=bright blue 10=bright green, 11=b/cyan, 12=b/red 13=b/magenta 14=yellow, 15=b/white (default=14) /B0 - B7 Background color (as per list for foreground to 7)(default=1) /H0 - H5 menu Header (0=no header) H1 puts 'Select' in centre of bar(default), (H3 'Menu') H2 puts 'Select' at beginning of bar, (H4 'Menu') H5 My Menu Heading\ puts your own title on the menu, where the text:- My Menu Heading or whatever it is what you would like as the custom menu title. NOTE:- The custom title MUST end with a backslash (\) chararacter. /O0 - O3 Outline box (1=outline only) (2=screen border only) (3=outline and screen border = default) /U0 - U1 bUttons around each menu option (max 8) (defeats outline box) /K0 - K2 K1=Enable number keys(1-9),K2=add bar numbers,K=0=off(default) /I0 - I2 I0=Instruction line off. I2=no ESC message(default=1=on) This instruction line appears above the bottom screen line. NOTES FOR USING THE MOUSE ... The mouse driver must be loaded before the mouse will work in HL.COM This should be done either in AUTOEXEC.BAT (eg. mouse.com) or CONFIG.SYS (eg. mouse.sys). The mouse is normally enabled, but can be disabled with the /M0 switch. The mouse will emulate various keys as follows:- Move the mouse away from you = up arrow Move the mouse towards you = down arrow Left button = enter key Right button = ESC key 37 HL.COM (continued) FINALE This program has a huge number of options available. It must be understood that some combinations of the available options may cause some strange reactions. Some combinations are illegal and have not been allowed. ** Remember the maximum number of characters on a command line is 127.** EXAMPLE An example of a useful combination is:- HL "Option A""Option B""Option C" /f14 /b3 /k2 This will display yellow text on a cyan background, the 3 menu options surrounded with an outline and a screen border. The number keys have been enabled and each menu option has a bar number added to the beginning of it. The screen saver will blank the screen after 3 minutes. Now, to change the outline to individual buttons add:- /u1 38 JOYCHECK.COM ----------------------------------------------------------------------- This program will show the coordinates and button status for up to two joysticks connected to the joystick port. (A "Y" connector may be required.) Also up to four paddles, each with there own button, can be checked. This is accessed by simply entering the program name:- JOYCHECK To toggle the mode between JOYSTICK and PADDLE:- press the F5 key. Other options (switches):- JOYCHECK /? The help screen. 39 KEYCHECK.COM ----------------------------------------------------------------------- This program in the primary mode is a full screen display of keyboard SCAN CODES and ASCII CODES plus the LOCK key conditions are shown. This is accessed by simply entering the program name:- KEYCHECK Other options (switches):- KEYCHECK /? The help system. KEYCHECK can also be used in command line mode to set the state of CAPS LOCK, NUM LOCK, SCROLL LOCK and the INSERT key. This can be done individually or more on the one command line. A useful feature of this is to turn the NUM LOCK off in AUTOEXEC.BAT for those who want this disabled. /C0 - 1 1 turns CAPS LOCK on, 0 turns it off /N0 - 1 1 turns NUM LOCK on, 0 turns it off /S0 - 1 1 turns SCROLL LOCK on, 0 turns it off /I0 - 1 1 turns INSERT on, 0 turns it off Examples: To turn NUM LOCK off:- KEYCHECK /N0 To turn CAPS LOCK on and SCROLL LOCK off:- KEYCHECK /C1 /S0 Changing the setting of one does not affect any of the others. Just a quick note about INSERT:- If you have DOSKEY or similar command line editing program running (resident), then the /I0 or /I1 switches will have little or no effect. These programs take control over this function for themselves. If you disable DOSKEY or similar programs in AUTOEXEC.BAT you will then be able to see the effect of the KEYCHECK INSERT function While in the full screen mode, the INSERT key will toggle to check the action of the switch. While the program in running it has full control over this feature until control is handed back to DOS. 40 KEYCHECK.COM (continued) Monitoring of ALT, CTRL and SHIFT keys. KEYCHECK /A1 If the ALT key is held down the program exits with errorlevel of 8. If the CTRL key is held down the program exits with errorlevel of 4. If the L/SHIFT key is held down the program exits with errorlevel of 2. If the R/SHIFT key is held down the program exits with errorlevel of 1. A combination of the above keys gives an errorlevel equal to the addition of the appropriate errorlevels. ----------------------------------------------------------------------- See APPENDIX A for SCAN-CODE Reference Table ----------------------------------------------------------------------- Extended ASCII character set ... While in the full screen mode, the extended ASCII character set may be viewed by using the ALT [number key] combination. This is accomplished by holding down the ALT key while selecting various combinations from the numeric key pad (NOT the number keys above the QWERTY section). Then release the ALT key. Try:- ALT 176 which gives a shading character ° or any combination between ALT 179 and ALT 218 which are line drawing characters ³´µ¶·¸¹º»¼½ etc. Valid combinations which include the complete ASCII character set are from ALT 000 to ALT 255. ... Find the:- ¨ 41 KEYSPEED.COM ----------------------------------------------------------------------- This program will alter the Keyboard "Typematic" RATE and DELAY. The RATE is the speed at which the cursor moves across the screen, and DELAY is the time before the key repeats (if key is held down). Command-line switches:- /? The HELP screen. /M Monochrome display for FULL-SCREEN mode. /N normal setting:- RATE=10 chars/second, DELAY=500 milliseconds /F fast setting:- RATE=30 chars/second, DELAY=500 milliseconds /Rvalue for rate and /Dvalue for delay from lists below. VALUE TABLE /Rvalue (characters/second) /Dvalue (mSecs) 1 2 1 250 2 3 2 500 3 4 3 750 4 6 4 1000 5 10 6 15 7 20 8 24 9 30 For FULL-SCREEN mode, just enter the program name. eg. KEYSPEED 42 MC.COM ----------------------------------------------------------------------- This program allows the use of a mouse, to control the flow of a batch file by clicking on a selected area of the screen. I have called this action "AOP" or Area Oriented Program flow. The area can be as small as one character or as large as the whole screen. There can be up to 10 of these areas referenced on the command line as GROUPS of coordinates, ie. X1,Y1,X2,Y2 where X is the horizontal component and Y is the vertical component. X1,Y1 represents the top left corner of the area and X2,Y2 designates the bottom right corner of the area. Syntax:- MC /CX1,Y1,X2,Y2 X1,Y1,X2,Y2 X1,Y1,X2,Y2 (... etc) \_________/ \_________/ \_________/ Group 1 Group 2 Group 3 ... The program name "MC" has been kept short to allow up to 10 groups of coordinates on the command line (max 127 characters). The /C switch before Group 1 is required by the program to show the starting position of the coordinate groups. The idea is to present a text screen of some sort (boxes, colored text etc.) in the form of menus or other selection criteria, then use MC to match the required sensitive areas with groups of XY coordinates. When the mouse is clicked (LEFT button) while the mouse pointer is on a designated area, the program will exit with an errorlevel to match the relative group number. If the pointer is not over a designated area, no action occurs. If the ESC key is pressed, or the RIGHT button is clicked, the program will exit with an errorlevel of 0. X values must be between 0 and 79, and Y values between 0 and 24 (59). X2 must be equal to or greater than X1, and Y2 values equal to or greater than Y1. The areas can overlap, but remember to make the area which is on top, the higher group number. Ensure that the mouse driver is loaded in either AUTOEXEC.BAT or CONFIG.SYS before running MC, otherwise the mouse pointer will not appear. The keyboard cursor keys may be used to position the pointer, if required, and the ENTER key will act as the left mouse button as well. 43 MC.COM (continued) An optional switch is /P1 which will setup preset groups to match the boxes produced by BOX when using that program's /P1 switch. When using the /P1 switch do not use the /C switch and groups. Syntax:- MC /P1 Nine boxes are arranged in three rows of three and errorlevel on exit are as in diagram:- 1 2 3 4 5 6 7 8 9 Another optional switch to use is the Video Screen Saver value. This normally defaults to three minutes, but you can vary this with the /Vx switch, where V0 will turn the screen saver off and a number from 1 to 10 will give that time in minutes before the screen saver is enabled. Syntax:- MC /V1 /CX1,Y1,X2,Y2 etc or MC /V1 /P1 TEST MODE Syntax:- MC /T1 [/Xn] [/Yn] The TEST mode is accessed using the /T1 switch. The TEST mode is used to display the actual X,Y coordinates of the mouse pointer on the screen. This will assist in determining the X1,Y1,X2,Y2 values required. Move the mouse into the top/left corner of the area. This indicates the X1,Y1 values for the area required. Now move the mouse pointer to the bottom/right corner of the area. This then shows the X2,Y2 values. This mode is used, temporarily in place of the normal MC /CX1,Y1,X2,Y2 type line in the batch file. The mouse pointer and X,Y display (position may be controlled using the optional /Xn (n values 0 - 74), /Yn (n values 0 - 24 (59))) is overlayed on the previous screen. The values for each area can then be determined. Click the right mouse button to EXIT. 44 MC.COM (continued) DRIVER LOADED CHECK Syntax:- MC /L1 Use this to check to see if the mouse driver is Loaded. This could be done as a safety measure before using MC with groups to ensure your program will work. This check was left out of the main program to speed up the action. If the mouse driver is loaded, the program exits with an errorlevel of 0. If the driver is not loaded, the program exits with an errorlevel of 1. NOTES:- If used with a graphics screen (16 Color 640*480) instead of a text screen, the /G1 switch may be used to allow the Y (vertical) coordinate to extend to a maximum of 59. If the /G1 switch is used the Video Screen Saver (/V1) action is disabled. (This only works in text mode.) Any error on the command line will be accompanied by a corresponding error message on the screen. NOTE: as this program is command line active, the error message may occur after mouse click or key press; this is normal. An Example of use:- The command line entry for four areas might look like this:- MC /C8,4,20,6 8,10,20,12 28,4,40,6 28,10,40,12 For HELP on this command enter:- MC /? 45 MODE3.COM ----------------------------------------------------------------------- This program will reset the video mode to mode 3. Mode 3 is the standard IBM text mode for color monitor systems. In so doing the program also does the following:- - Sets the BLINK/INTENSIFY attribute to BLINK. - Sets the SCREEN COLOR to WHITE on BLACK. - Sets the border color to BLACK. - Sets the VIDEO PAGE to 0. - Sets the CURSOR to the standard position and shape. - Sets the CURSOR to the TOP of the screen. The only command line switch is:- /? The HELP screen. MODE7.COM ----------------------------------------------------------------------- This program will reset the video mode to mode 7. Mode 7 is the mono IBM text mode. In so doing the program also does the following:- - Sets the BLINK/INTENSIFY attribute to BLINK. - Sets the border color to BLACK. - Sets the VIDEO PAGE to 0. - Sets the CURSOR to the standard position and shape. - Sets the CURSOR to the TOP of the screen. The only command line switch is:- /? The HELP screen. 46 MOUSETST.COM ----------------------------------------------------------------------- This mouse test program will show details of the mouse driver if available. (Microsoft mouse - standard) ie. Driver version, IRQ Number and mouse type. It will test all buttons (up to three) and show X - Y coord. Motion Tests are included and instructions are "on screen". To EXIT press the ESC key on the keyboard or click the left mouse button on the word EXIT (top right of screen). Ensure a mouse driver or program is loaded ... Switches available:- /? The HELP screen 47 MPAUSE.COM ----------------------------------------------------------------------- This program emulates the PAUSE command which is normally an internal command in DOS. This program will also sense the presence of a mouse and then change the displayed message accordingly and then react either to a keypress or a mouse click. If the default message is not suitable, a substitute may be put inside double quotes, ie "Press or click to go on ...". This is to be placed after the program name, separated from it with a space. Switches available:- /? The HELP screen /X0 - X79 X Coord: Column number of start of message /Y0 - Y24 Y Coord: Row number of start of message /F0 - F15 Text color (0=black, 1=blue, 2=green, 3=cyan 4=red, 5=magenta, 6=brown, 7=white, 8=gray, 9=bright blue 10=bright green, 11=b/cyan, 12=b/red 13=b/magenta 14=yellow, 15=b/white (default=current foreground color) /B0 - B7 Background color (as per list for text, up to 7) (default = current background color) 48 PICKESC.COM ----------------------------------------------------------------------- Usage: PICKESC string [/S0 /Vx] ... where "string" is a string of characters which will set the errorlevel appropriate to its position in the string, on exit. Each character in the string represents the key which is pressed e.g. "A" will set errorlevel 1, "B" errorlevel 2, "C" errorlevel 3, "D" errorlevel 4, "E" errorlevel 5, "F" errorlevel 6, "G" errorlevel 7, etc. for the string:- "ABCDEFG" (double quotes are not to be used) The string must be alpha-mumeric, upper or lowercase. Pressing the ESCAPE key exits with errorlevel 0. Errorlevel checking is to be done from the highest to lowest. See your DOS manual for "if errorlevel" procedures. Options:- /? The HELP screen. /S0 = turn sound off, (default is on). /V1 - /V10 = Video screen saver (after 1 - 10 minutes) (the default is no screen saver action) 49 PLAY.COM ----------------------------------------------------------------------- This program uses the internal sound capabilities of the IBM PC/AT/386,etc. A sound card is not required. The PC speaker is used for the sound. There are four main option types:- 1) User defined music string format 2) Preset SOUNDS 3) Preset MELODIES 4) KEYBOARD INTERACTIVE mode The first three modes can be used in batch files to brighten up your DOS. USER DEFINED MUSIC STRING FORMAT. /Uxxxx,yy xxx,yyy xxxxx,y xxx,yy ... xxx signifies the frequency of the note and the yy represents the duration in "ticks". (There is approx 18 ticks/second.) The xx figure can be from 2 - 5 digits and the y figure from 1 - 5 digits in length. The frequency range is from 37 Hz (cycles/second) to 32767Hz. Note:- If a frequency value of 0 is used a period of silence is obtained (a "rest"). At the end of this HELP there is a list of frequencies of notes. The duration can be between 1 and 65535 ticks. The number of notes can vary from 1 to the number that will fit on the command line (127 characters). Each note must be separated from the last by a single space. Preset SOUNDS.. NOTE:- n is the number of repeats of the sound from 1 - 99 A keystroke will interrupt an extended (unwanted) sound. /Tn Telephone type sound /Wn Warble sound /Pn Pip sound /Bn Beep sound /Hn Hee-Haw sound /Sn Siren sound /Rn Random sound of any frequency between 100 Hz and 5000 Hz 50 PLAY.COM (continued) Preset MELODIES... /M1 "We wish you a merry Xmas..." /M2 "Happy birthday to you..." /M3 "Auld lang syne..." /M4 "Mary had a little lamb..." /M5 "Mozart - Sonata K.331 1st Movement" /M6 "...Waltzing Matilda" /M7 "London Bridge is falling down..." /M8 "Row, row, row your boat..." KEYBOARD INTERACTIVE mode (/K1 switch) eg. PLAY /K1 or PLAY /K1 /Vx where x is a value of 0 - 10 seconds for the screen saver (default value = 3 minutes)(0 turns screen saver off) In this mode the keyboard can be used as an equivalent of an organ! keyboard. Once in this mode the screen shows the key layout and key functions. The range of notes exceeds four octaves, by using the function keys F1 for bottom range, F3 for the high range and F2 (the default) for the mid range. The automatic screen saver comes into action after approx 3 minutes if no key is pressed. To resume simply press any key. Relationships of Notes and Frequencies (Rounded to whole numbers) Ú-----------------Â-----------------Â-----------------Â-----------------¿ ³ Note Frequency ³ Note Frequency ³ Note Frequency ³ Note Frequency ³ Ã-----------------Å-----------------Å-----------------Å-----------------´ ³ C 131 ³ C * 262 ³ C 523 ³ C 1047 ³ ³ D 147 ³ D 294 ³ D 587 ³ D 1174 ³ ³ E 165 ³ E 330 ³ E 659 ³ E 1319 ³ ³ F 175 ³ F 349 ³ F 698 ³ F 1397 ³ ³ G 196 ³ G 392 ³ G 784 ³ G 1568 ³ ³ A 220 ³ A 440 ³ A 880 ³ A 1760 ³ ³ B 247 ³ B 494 ³ B 988 ³ B 1976 ³ À-----------------Á-----------------Á-----------------Á-----------------Ù * Designates Middle C. Note:- All frequencies in Hz (Cycles/Second). Try:- PLAY /U400,2 500,2 600,2 51 PLAY.COM (continued) KEYBOARD INTERACTIVE mode "KEYBOARD" LAYOUT 2 3 5 6 7 Ú---¿Ú---¿ Ú---¿Ú---¿Ú---¿ Notes ³ C#³³ D#³ ³ F#³³ G#³³ A#³ U O --------- ³ ³³ ³ ³ ³³ ³³ ³ P C Press ESC to quit. À---ÙÀ---Ù À---ÙÀ---ÙÀ---Ù P T Ú---¿Ú---¿Ú---¿Ú---¿Ú---¿Ú---¿Ú---¿Ú---¿ E A * Denotes Middle C ³ C ³³ D ³³ E ³³ F ³³ G ³³ A ³³ B ³³ C ³ R V for MID Range. ³ ³³ ³³ ³³ ³³ ³³ ³³ ³³ ³ E À---ÙÀ---ÙÀ---ÙÀ---ÙÀ---ÙÀ---ÙÀ---ÙÀ---Ù To change the Range Q W E R T Y U I use: F3 HIGH ------------------------------------------------- F2 MID (default) S D G H J F1 BOTTOM Ú---¿Ú---¿ Ú---¿Ú---¿Ú---¿ ³ C#³³ D#³ ³ F#³³ G#³³ A#³ L O The both octaves are ³ ³³ ³ ³ ³³ ³³ ³ O C extended beyond "C" À---ÙÀ---Ù À---ÙÀ---ÙÀ---Ù W T to provide overlap Ú---¿Ú---¿Ú---¿Ú---¿Ú---¿Ú---¿Ú---¿Ú---¿ E A and extra range. ³ C ³³ D ³³ E ³³ F ³³ G ³³ A ³³ B ³³ C ³ R V ³ * ³³ ³³ ³³ ³³ ³³ ³³ ³³ ³ E À---ÙÀ---ÙÀ---ÙÀ---ÙÀ---ÙÀ---ÙÀ---ÙÀ---Ù Z X C V B N M , 52 READSCR.COM ----------------------------------------------------------------------- READSCR is designed to read a screen character and return an errorlevel which is equivalent to the ASCII (or attribute) value of the character. This errorlevel will be a decimal value between 0 and 255. READSCR will not work if direct screen memory writes are used. Command-line switches:- /X0 - 79 The horizontal coordinate of the screen character to read. /Y0 - 24 The vertical coordinate of the screen character to read. /A1 To obtain the attribute value of the character instead of the the ASCII value. /? This HELP screen. 53 TIMEMARK.COM ----------------------------------------------------------------------- Syntax:- TIMEMARK /Dn |/Tn |/Cn |/Q1 [/En] or... /? for the HELP screen. (where | means OR and [] means optional, (do not include these symbols)) This program allows the TIME and/or DATE to be displayed from the DOS prompt or from within batch files. The output can be redirected to a device (file or printer etc.) On exit from the program, the DOS errorlevel can be set to match one of the time/date units. The following list of command line switches show the vast number of options available. DATE FUNCTIONS As an example for this option, we use a date of the 28th of March 1994, at a time of 4:09pm. /Dn where n is a number from 0 to 6 0 gives no date display 1 results in:- Monday, March 28 1994 2 28-03-1994 3 03-28-1994 4 28 5 03 6 1994 7 19940328 TIME FUNCTIONS As an example for this option, we use a date of the 28th of March 1994, at a time of 4:09pm. /Tn where n is a number from 0 to 8 0 gives no time display 1 results in:- 4:09p 2 4:09:00p 3 4:09:00.00p 4 16:09 5 16:09:00 6 16:09:00.00 7 16 8 09 9 16090000 54 TIMEMARK.COM (continued) COMBINATION OF DATE AND TIME FUNCTIONS As an example for this option, we use a date of the 28th of March 1994, at a time of 4:09pm. /Cn where n is a number from 0 to 9 0 gives no time/date display 1 results in:- Monday, 4:09p 2 Monday, March 28 1994, 4:09p 3 Monday, March 28 1994, 16:09 4 28-03-1994, 4:09p 5 28-03-1994, 16:09 6 28-03-1994, 16:09:00.00 7 03-28-1994, 4:09p 8 03-28-1994, 16:09 9 03-28-1994, 16:09:00.00 10 1994032816090000 CUTE TIME DISPLAY Function If you like to be casual about the time, this is for you. /Q1 switch gives this function. (Q for cute ?!) A typical response is:- It's nearly five past seven or ... It's almost twenty-five to eleven. Have fun !!!. SETTING ERRORLEVEL TO MATCH TIME/DATE UNITS This is an OPTIONAL feature for exiting with an ERRORLEVEL, which can be then be checked from within a batch file. NOTE:- This must be used with either /Dn, /Tn, /Cn or /Q1. /En where n is a number from 1 to 9 1 exits with the MONTH number (1 - 12) as the ERRORLEVEL.. 2 DAY (1 - 28, or 29, or 30, or 31) 3 DAY OF WEEK (1 - 7, (Sunday = 1 etc.)) 4 HOUR (0 - 23) 5 MINUTE (0 - 59) 6 SECOND (0 - 59) 7 HUNDREDTH of second (0 - 99) 8 gives a 1 for MORNING, 2 for AFTERNOON or a 3 for EVENING 9 YEAR (eg. 94 for 1994, 6 for 2006) If using /E8, /Sn can be used where n is a number from 13 to 23, to vary the AFTERNOON/EVENING crossover point which defaults to 18 (6pm). 55 WAITFOR.COM ----------------------------------------------------------------------- Syntax:- WAITFOR /H{hour} [/M{minute}] [/E{exlude}] ["Event, whatever"] Time is in 24 hr mode. e.g. /H13 /M47 would mean:- 1:47pm or 1347 Options:- /? or no parameter gives the HELP screen. /M is optional minutes (defaults to 00) /En[nn..] Exclude particular days. 1=Sunday, 2=Monday etc. eg /E17 will exclude Sunday and Saturday. The program will exit with errorlevel of 2 if actual day matches one of the /E numbers. "Optional text in quotes" will display on screen with time information. (max no. of characters=50) This could indicate what event will take place when the time is up. To quit while timing press:- Q (exits with errorlevel of 1) 56 WIPELEFT.COM ----------------------------------------------------------------------- This program will clear the screen from the right to the left. The speed of the wipe is constant and not related to the CPU speed. Command-line switches:- /? the HELP screen. WIPERITE.COM ----------------------------------------------------------------------- This program will clear the screen from the left to the right. The speed of the wipe is constant and not related to the CPU speed. Command-line switches:- /? the HELP screen. 57 EL.BAT ----------------------------------------------------------------------- This batch file has been included in this set of utilities, because I have found this very useful in batch file programing in the past. The main purpose is to display the exit code of an executable program. This exit code becomes a useful errorlevel, which may be used in a batch file. To use it, enter EL then after a space, the program name and any command line options required. EL will then run the program and display the exit code (errorlevel). NOTE WELL:- This batch file will not work will all programs. Even many A1 DOS Utilities programs are senstive to command line details and do not respond well to EL.BAT. An example of use:- EL PICKESC abcd EL will wait for a keypress. If, for instance, a 'b' is pressed the program will exit showing an errorlevel of 2. A 'c' keypress would have given an errorlevel of 3, etc... 58 APPENDIX A ----------------------------------------------------------------------- SCAN CODE TABLE ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 1 59 60 61 62 63 64 65 66 67 68 133 134 ` 1 2 3 4 5 6 7 8 9 0 - = \ BS INS HOME PG/UP 41 2 3 4 5 6 7 8 9 10 11 12 13 43 14 82 71 73 TAB Q W E R T Y U I O P [ ] Enter DEL END PG/DN 15 16 17 18 19 20 21 22 23 24 25 26 27 28 83 79 81 A S D F G H J K L ; " Number Pad: * - + 30 31 32 33 34 35 36 37 38 39 40 55 74 78 Z X C V B N M , . / Cursor: up down left right 44 45 46 47 48 49 50 51 52 53 72 80 75 77 SPACE BAR 57 Note that the "upper" and "lower" case characters both have the same SCAN CODE. The SCAN CODE is for the actual key pressed not for the character given. The program KEYCHECK shows the relationship between SCAN CODE and ASCII code for each key being pressed. ASCII.COM gives an on screen display of all the hex and decimal ASCII values. 59 APPENDIX B ----------------------------------------------------------------------- COLOR NUMBER TABLE 0 BLACK 8 DARK GRAY 1 BLUE 9 LIGHT BLUE 2 GREEN 10 LIGHT GREEN 3 CYAN 11 LIGHT CYAN 4 RED 12 LIGHT RED 5 MAGENTA 13 LIGHT MAGENTA 6 BROWN 14 YELLOW 7 LIGHT GRAY 15 BRIGHT WHITE (STANDARD WHITE) NOTE:- Foreground colors are from 0 - 15. Background colors are from 0 - 7 only. (The color numbers 8 - 15 are the same as color numbers 0 - 7 with the intensity increased.) The standard DOS forground color is number 7 with a background color number of 0. Some A1 DOS utilities allow flashing colors by adding 100 to the foreground color value. This is not a DOS feature but special for the A1 DOS utilities. (The DOS function uses the background value with values greater than 7 to cause the foreground color to flash. This is confusing and has not been used in the A1 DOS Utilities.)