home *** CD-ROM | disk | FTP | other *** search
-
- BATCH FILE COMMAND EXTENSIONS (c) 1992 Scott A. Armitage
- DOS VERSION 3.30 or greater recommended.
-
- Scott A. Armitage
- Done Office & Consulting Service
- Assembler specialists.
- 9250 Timber lane
- Peoria, Il 61615
-
-
- PCHAR.COM 1305 BYTES - DISPLAYS ENVIRONMENT VARIABLES OR TEXT CONSTANTS
- ON DISPLAY SCREEN WITH CURSOR ADVANCE AND LINE WRAP.
- COMMAND LINE OPTIONS:
-
- Var name = DISPLAY CONTENTS OF VAR AT CURRENT SCREEN POS.
- $ = CARRIAGE RETURN/LINE FEED.
- @ = USE NEXT BYTE AS ATTRIBUTE VALUE.
- ( = COLUMN VALUE FOLLOWS. (1-2 DIGITS. 0-79) *
- ) = ROW " " (1-2 DIGITS. 0-24) *
- / = USE FOLLOWING BYTE(S) AS CONSTANT UNTIL COMMA.
- CHAR IMMEDIATLY AFTER / MAY BE A COMMA.
-
- i.e. "/,," = 1 CHAR CONSTANT CONTAINING COMMA.
-
-
- If no attribute byte is on the PCHAR command line,
- the attribute at the current screen position will
- be used. If command is entered at DOS prompt this
- will be at column 0 one row below where you entered
- the command.
-
- Monochrome display users. 3 files are provided
- to allow you to read in attribute bytes into your
- editor.
- NV.ATR = ascii 7 for norm video.
- HV.ATR = ascii 15 for high video.
- RV.ATR = ascii 112 for reverse video.
-
- Color display users. The example batch files
- and all .COM files were written on a 1983 IBM P.C.
- with a MDA display. If you would like different
- color values, change the byte/character IMMEDIATLY
- following the @ operator in the batch files.
-
- If non-numeric or out of range values are used
- for ROW or COLUMN values, the current position will
- be used for next output.
-
-
- PCHAR Error codes:
-
- ERRORLEVEL 5 = BAD/MISSING command line.
- ERRORLEVEL 4 = BAD MCB chain/environment not found.
- ERRORLEVEL 3 = Variable not found. (op1)
-
-
- * MAX # OF ROWS & COLUMNS DEPENDENT ON VIDEO MODE
- STATUS INFO AT 0040:004AH & 0040:004CH.
-
-
-
-
- PCHAR2.COM 88 BYTES - DISPLAYS TEXT ON SCREEN IN TELETYPE MODE.
- NO OPTIONS.
- USE CR.COM OR LF.COM FOR LINE/CURSOR CONTROL.
- SEE SPIN.BAT & TUMBLE.BAT FOR EXAMPLES.
-
-
- KEYHIT.COM 17 BYTES - RETURNS ERRORLEVEL 1 IF KEYHIT ELSE ERRORLEVEL 0.
-
-
- GETKEY.COM 565 BYTES - WAITS FOR KEY. RETURNS KEYCODE IN ERRORLEVEL &
- ENVIRONMENT VAR "K". Installs "K=?" in environment
- if 5 or more bytes free. If space not available,
- only returns KEYCODE in ERRORLEVEL.
-
- OPTIONS: U/u FOR UPCASE OF KEY.
- E/e FOR ECHO OF CHAR.
-
-
-
-
- QPAUSE.COM 3613 BYTES - WAITS FOR KEY. RETURNS KEYCODE IN ERRORLEVEL &
- ENVIRONMENT VAR "K". Installs "K=?" in environment
- if 5 or more bytes free. If space not available,
- only returns KEYCODE in ERRORLEVEL.
- If key = < > | space or Return, K=ascii(255).
- Errorlevel will contain ascii code.
- GETK will return chars < > | space and Return in
- variable K.
-
- If Function or control key is pressed, ERRORLEVEL
- will return 0 and "K" will be ascii value of scan
- code.
-
-
- COMMAND LINE PARAMETERS:
- nn = ANY 1 TO 2 DIGIT NUMBER USED FOR SCROLL SPEED.
- RANGE 0-30. IF ABOVE 30, 30 USED.
- 0 = Fastest, 30 = slowest.
-
- A or a = ANINIMATE OFF, NO HORIZ OR VERT SCROLLING.
- B or b = BEEP. Will beep once for each occurence of B/b
- on the command line.
- D or d = NO SCREEN DISPLAY.
- F or f = Don't flush key buffer.
- S or s = ENABLE SNOW CHECKING (CGA cards only).
- This option will slow down display.
- Use a lower speed value.
- U or u = Return environment var K in upcase if in a-z.
- E or e = ECHO K value on screen.
- P or p = ECHO text string on screen.
- @c = Use ascii value of char IMMEDIATLY after @ as
- attribute byte for Frame OR text if Frame
- attribute already obtained.
- ' = Use text with Left/Right scroll. (28 chars max)
- " = Use text, no Left/Right scroll. (74 chars max)
-
- If ' or " options are used, they must be last on command line.
- ALL character following 1st occurence of ' or " will be used until
- end of command line encounterd or field full.
-
- If less than 26/72 chars are in text, it will be centered within 28/74
- char field. Pad out your text with blank spaces to disable centering.
-
- The other parameters may be placed on the command line in any order
- with or without any delimiters you choose. Invalid chars are ignored.
- Only the first 1 or 2 digit number found will be used for speed. Other
- digits/numbers on command line will be ignored.
-
- If the MCB chain or DOS's environment is corrupt, has an unknown format,
- or if there is no room to install K= in environment, ASCII Key code will
- only be returned in ERRORLEVEL.
-
-
-
-
- While QPAUSE is running: Press RIGHT SHIFT = speed up.
- " LEFT SHIFT = slow down.
- " CTRL+RIGHT SHIFT = TOGGLE DISPLAY ON/OFF
- " CTRL+LEFT SHIFT = TOGGLE ANIMATE ON/OFF
- " CTRL+ALT = TOGGLE SNOW CHECKING
- (CGA only.)
-
-
- QPAUSE DEFAULTS = ANIMATE ON, DISPLAY ON, NO BEEP, NO SNOW CHECKING
- SPEED = 8, TEXT = 'Press any key to continue...'
-
- FORMAT - QPAUSE ba "HERE IS SOME TEXT !
- = BEEP at start, no scrolling, show text until keyhit...
-
-
- NOTE - QPAUSE READS values from the ROM BIOS data area locations
- 0040:0017H (keyboard status) & 0040:006CH (master clock count)
- for use in the delay routine. If TSR programs are active which
- WRITE or MODIFIY either of these locations, QPAUSE may lock up.
-
-
-
-
-
-
-
-
- BVAR.COM 1819 BYTES - Provide access to DOS environment variables.
-
- FORMAT - BVAR [-] [op1] [func] [op2] [,] [op1] [func] [op2].....
-
- FUNCtion operators:
-
- NONE (op1[,]) = If no func for op1, 1st char of op1 is incremented
- by 1.
- - (before op1) = Decrement 1st char of op1 by 1.
- - (after op1) = Subtract 1st char of op2 from 1st char of op1,
- result in 1st char of op1.
- + " " = Add 1st char of op2 to 1st char of op1,
- result in 1st char of op1.
- = " " = Copy op2 into op1.
- $ " " = Process rest of command line if op1=op2.
- & " " = " " " " " op1<>op2.
- / " " = Use char(s) IMMEDIATELY after / as op1/op2 value.
- ~ " " = Append op1 to last environment variable SET.
- # NO OP1/OP2 = Remove 1 char from last environment variable.
- (Will not remove an equal sign. = )
- , after op1 or op2 = additional commands on command line.
- ; = Rest of command line is comment.
-
-
- Comma's should be used to seperate multiple commands on the command line.
- Blank spaces after commas are optional.
-
- NOTE - Blank spaces are valid characters in environment variable names
- except as the first character.
- The DOS SET command uses spaces as valid chars.
- i.e SET K = x and SET K=x result in 2 different variables.
-
- For all functions (except # and ~) op1 must be an existing environment
- variable name. Op2 may be a environment variable name or a
- character/string constant (/chars).
-
- Characters which indicate the end of a constant are: , ; or ~ AFTER the
- first character of the constant OR the end of the command line.
- Blank spaces will NOT terminate a constant.
-
- Constants may only be used as op1 with the append function operator (~).
-
-
-
-
- ** USE CAUTION WITH BATCH SUBSITUTE FUNCTION. %VAR%
-
- Make SURE that ANY command line in your batch file does not
- get larger than 128 chars when expanded by command.com.
- DOS will probably lock up if this occurs.
-
- See BVLEN.COM for example of determining length of variables.
-
- The REMOVE function (#) can set vars to a length of 0 (empty).
- References to an environment variable in this state in DOS/BATCH commands
- are not recommended. (via %var% subsitute function)
-
- The BVAR compare functions ($,&) will work on an
- empty variable. (It will be less than anything you compare it to.)
- Only 1 empty variable can be in the envrionment and it will be the last
- variable there.
-
- Op1 will only be appended if there is sufficient room in the current
- DOS environment. i.e. Free space available must be greater than
- length of op1+4. Free space is determined each time bvar loads
- BEFORE the command line is processed. Only ONE command that changes the
- number of chars used in the environment (# and ~) should be used in each
- call to bvar UNLESS steps are taken to insure that plenty of spare
- environment space is available. 4 append operations seems to be the
- max allowed. If more than 1 append function is placed on one command line,
- check that all desired commands are executed during testing.
- See MCCCOM.BAT for example.
-
-
- To load a secondary copy of COMMAND.COM with 32,000 bytes of
- environment space enter: COMMAND /E:32000
- at DOS prompt. Type EXIT to return to original copy of DOS.
- See your DOS manuals for more info on setting environment size.
-
- FOR LAST COMMAND ON COMMAND LINE - ERRORLEVEL RETURNS:
-
- ERRORLEVEL 5 = BAD/MISSING command line.
- ERRORLEVEL 4 = BAD MCB chain/environment not found.
- ERRORLEVEL 3 = Variable not found. (either op1 or op2)
- ERRORLEVEL 1 = CARRY/BORROW flag is set.
- Only for functions +- or none (inc op1).
- If inc or + indicates var's value went from
- ascii 255 to ascii 1.
- If dec or - indicates var's value went from
- ascii 1 to ascii 255.
- ERRORLEVEL 0 = Operation sucessful.
-
- For compare commands (op1 & op2 or op1 $ op2) RETURNS:
-
- ERRORLEVEL 2 = OP1>OP2
- ERRORLEVEL 1 = OP1<OP2 OR OP1>OP2
- ERRORLEVEL 0 = OP1=OP2
-
- For conditional process commands (op1 $ op2/op1 & op2) ERRORLEVEL
- will reflect result from last compare executed UNLESS a subsequent
- command on that command line results in a ERRORLEVEL value other than 0.
- (carry/borrow flag set OR variable not found).
-
-
-
-
-
- Valid char range = 1 to 255. If an environment variable is set to ascii 0,
- DOS losses everything which follows that variable.
- BVAR will not allow this.
-
- The = function will allow you to reset the value of an environment
- variable without using the DOS SET command. SET would move the variable
- to the end of the environment list.
-
- The = function will not change the length of op1.
-
- example:
-
- BVAR op1=op2 ;where op1=123 and op2=abcde
- results in op1=abc
-
- BVAR op1=op2 ;where op1=12345 and op2=abc
- results in op1=abc45
-
-
- BVAR will accept either upper or lower case for op1/op2.
- If op2 is to be a constant (/ function), it will not be converted to
- upper case.
-
-
-
-
- BVLEN.COM 766 BYTES - Return length of environment variables value.
-
- BVLEN op1
-
- Returns length of environment variable op1 in variable K.
- i.e. ascii value of K = length of op1.
-
- Error codes:
- ERRORLEVEL 5 = BAD/MISSING command line.
- ERRORLEVEL 4 = BAD MCB chain/environment not found.
- ERRORLEVEL 3 = Variable not found. (op1)
-
-
- GDENV.EXE 1814 BYTES - Environment status utility program.
-
- Use to determine space available and check if currently active DOS
- environment has been found.
-
- Lists contents of all environment blocks in MCB chain. ($ shown as space).
- Shows size and bytes free for all environments owned by DOS.
- Shows bytes free in DOS environment currently active.
-
- Will increment variable K= if found in environment. i.e. if K=A in
- DOS environment. Run GDENV at DOS prompt, type SET at DOS prompt,
- if K=B is shown, GDENV found the currently active DOS environment correctly.
- If variable K= is not in the current DOS environment, GDENV will install
- it, IF 5 or more bytes are free. Subtract 4 from the number of bytes
- GDENV reports as free if K= is installed by GDENV. (or run it again.)
-
-
-
-
-
-
- Example batch files:
-
- BVCMP.BAT - Compares 2 variables. Place names on BVCMP command line.
- 2nd parameter may be a BVAR constant. i.e /123
-
- BVCNT.BAT - Count from 0 to 999 and starts over. Press a key to quit.
-
- ELT.BAT - Use to test QPAUSE or GETK. Use QPAUSE or GETK command and
- command line to test as parameter to ELT.
- Shows use of ERRORLEVEL and result value of K= .
- Use to show results of Funtion/Ctrl/Alt key combos.
- i.e. C:\ELT getk u,e
- = Test getk with echo and uppercase conversion
- until ESC pressed.
-
- GRID.BAT - Displays row & column grid on screen.
-
- DEMO.BAT - Runs GRID.BAT, MCC.BAT and TUMBLE.BAT until keypress.
-
-
- The next 3 files have had the main loop compiled by
- BAT2EXEC Ver. 1.2 (c) 1990 Ziff C Co.
- This is the only batch file compiler tested with the
- bvars programs. Since COM files generated by BAT2EXEC
- only have access to the COM files copy of the environment
- and not the currently active DOS environment, all refrences
- to vars within the main loop must be from one of the bvars
- programs. Other batch compilers that support the SET
- command and allow access to the active DOS environment should
- compile the entire batch program.
-
-
- MCC.BAT - Displays all characters and attributes available valid
- for display in a batch file. (MCCCOM.BAT/COM)
-
-
- SPIN.BAT & TUMBLE.BAT - Demos of some character animation from batch.
- Change lines SPINCOM/TUMCOM to CALL SPINCOM/CALL TUMCOM to see
- how slow they are executed by command.com.
-
- Main loops for these are also compiled. See SPINCOM.BAT
- and TUMCOM.BAT for batch source.
-
-
-
- NOTE - If you abort one of these batch files (or any others) by pressing
- Control-Break, all environment variables set by the batch file
- will remain in your environment.
-
- For best results copy all *.com files to a RAMDISK and set your
- PATH so DOS looks there first.
-
-
- BVARS licence agreement.
-
- Single copy users $ 5.00
- (programs installed on 1 PC)
-
- Consultant/business users $ 10.00 1st copy.
- 2.00 each additional
- machine running
- BVARS programs.
-
- Please keep yours and your clients/employers systems from being
- in violation of FEDERAL LAW by registering this program if you
- find it to be useful.
-
- SUPPORT THE EFFORTS OF INDEPENDENT PROGRAMMERS !
-
-
- Send payments to:
- Scott A. Armitage
- 9250 Timber lane
- Peoria, Il 61615
-
- Cash, checks and money orders accepted.
-
-
- Your comments and suggestions for Ver. 2 are also welcome.
-
-
-