home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR3 / EXC27.ZIP / EXC.DOC next >
Text File  |  1993-08-15  |  69KB  |  1,570 lines

  1.                                EXC USER'S GUIDE
  2.  
  3.                      Copyright 1993 by Gary C. Crider and
  4.                                Parity Solutions
  5.                                
  6.  
  7.  
  8. TABLE OF CONTENTS:
  9.  
  10.         What is EXC? ..................................... 1.0
  11.         The EXC command line ............................. 2.0
  12.           Parameters that contain quotes ................. 2.1
  13.         Operational notes ................................ 3.0
  14.           General notes .................................. 3.1
  15.           Interrupt keys ................................. 3.2
  16.           Memory usage ................................... 3.3
  17.           Timing considerations .......................... 3.4
  18.           When EXC may not function or cause problems .... 3.5
  19.           Error handling ................................. 3.6
  20.         Scripts .......................................... 4.0
  21.           Script Commands ................................ 4.1
  22.             BEEP ......................................... 4.1.1
  23.             CASE ......................................... 4.1.2
  24.             CLEAR ........................................ 4.1.3
  25.             CURSOR ....................................... 4.1.4
  26.             DELAY ........................................ 4.1.5
  27.             GOTO ......................................... 4.1.6
  28.             HIDEWIN ...................................... 4.1.7
  29.             IFN .......................................... 4.1.8
  30.             IFY .......................................... 4.1.9
  31.             KEY .......................................... 4.1.10
  32.             LOCATE ....................................... 4.1.11
  33.             LOOK ......................................... 4.1.12
  34.             ON ........................................... 4.1.13
  35.             PAUSE ........................................ 4.1.14
  36.             QUIT ......................................... 4.1.15
  37.             READ ......................................... 4.1.16
  38.             SCRMAX ....................................... 4.1.17
  39.             SEARCH ....................................... 4.1.18
  40.             SETWAIT ...................................... 4.1.19
  41.             SHOW ......................................... 4.1.20
  42.             SHOWAT ....................................... 4.1.21
  43.             SHOWWIN ...................................... 4.1.22
  44.             TICK ......................................... 4.1.23
  45.             TIME ......................................... 4.1.24
  46.             TIMEOUT ...................................... 4.1.25
  47.             TYPE ......................................... 4.1.26
  48.             TYPFILE ...................................... 4.1.27
  49.             WAITFOR ...................................... 4.1.28
  50.             WAITSCR ...................................... 4.1.29
  51.             WINCOLS ...................................... 4.1.30
  52.             WINMAX ....................................... 4.1.31
  53.             WINROWS ...................................... 4.1.32
  54.           Labels ......................................... 4.2
  55.           Remarks ........................................ 4.3
  56.           Environment variable substitution .............. 4.4
  57.           Example script ................................. 4.5
  58.         Installation ..................................... Appendix A
  59.         Keycode table .................................... Appendix B
  60.         Disclaimer ....................................... Appendix C
  61.         Support .......................................... Appendix D
  62.         Registration ..................................... Appendix E
  63.  
  64.  
  65. 1.0 What Is EXC?
  66.  
  67.    As administrator of a large local area network, I believe whole-
  68. heartedly in automating every task that can be automated.  Even though 
  69. many tasks are computerized, that does not make them automated.  By
  70. automated I mean that you enter one command or batch file name on the
  71. DOS command line and forget about it until the task is performed.  Unfor-
  72. tunately many, if not most, programs require an operator to fill in blanks,
  73. select choices or otherwise interact with the PC to accomplish a task in
  74. which all of these parameters and choices were known to the user beforehand.
  75.  
  76.    I, for one, do not want to have to sit and watch my backups take place.
  77. In fact, I want them done while I am away from the office.  After backups, 
  78. what better time to defragment a hard disk?  Do I want to have to chase menus 
  79. to achieve this after the backup completes?  One of the worst offenders of 
  80. this I have seen is Stacker's SDEFRAG program.  You can automate just about 
  81. everything until the defrag has finished, then a stupid dialogue box pops up 
  82. and asks you if you want to exit the program.  No way to just move on back 
  83. to the batch file and begin defragmenting the next drive.
  84.  
  85.    I first experimented with various keyboard stuffers such as PC Magazine's
  86. KEY-FAKE by Charles Petzold and STACKEY by Barry Simon and Richard Wilson.
  87. These programs take pre-programmed key sequences and stuff them into the
  88. keyboard buffer as if you had typed them at the keyboard.  The trouble is
  89. that many programs rudely clear the keyboard buffer before requesting you to 
  90. enter something or they allow you to interrupt the processing by pressing any 
  91. key.  Since you have already simulated pressing the key, oops!.  In either 
  92. case, you can't simply preprogram your reply and go.  Stacker's SDEFRAG exit 
  93. prompt is an example.  
  94.  
  95.    Stuffers usually offer a way to get around this by programming a delay
  96. into the keystrokes that causes so many seconds to elapse before the key
  97. code is stuffed into the keyboard buffer.  This is a help, but what if the
  98. time for a task (backup and defrag, for example) to complete varies greatly
  99. from one execution to another?  You have to program for the longest possible 
  100. execution time and the task then takes way too long to run in most cases.
  101.  
  102.    Another problem I have with stuffers is that they are almost always 
  103. terminate-and-stay-resident (TSR) programs.  I hate to stuff another program
  104. in my 640k when I don't have to.  Although most allow you to unload them,
  105. you will forget more often than not.
  106.  
  107.    I then came across a program called AUTOMATE by Geoff Friesen that was
  108. a better approach.  You built a script, compiled it and executed it.  No
  109. TSR remained in memory.  The trouble is, the only commands in the script
  110. were execute a program, wait, and insert keys in the buffer.  Also, you
  111. couldn't pass parameters to the program.  AUTOMATE served as my inspiration 
  112. to take it further.
  113.  
  114.    What I wanted was a program that had the intelligence to monitor the 
  115. screen and detect when an event occurred that required me to insert more 
  116. keycodes in the buffer.  I would also like to see logical branching in the 
  117. script and the ability to plan for exception processing as well as when 
  118. everything performs normally.  I want to be able to enter keyboard input 
  119. when a certain string appears on the screen or when a string such as 
  120. "Please wait..." disappears from the screen.  There are times I just want 
  121. to wait until any change at all occurs on the screen.
  122.  
  123.    EXC then, is more than just a buffer stuffer.  It is a script (a.k.a. 
  124. macro) processor that has a very simple script language that allows very 
  125. complex scripts to execute much faster than you could execute them in attended 
  126. mode.  There are only slightly over thirty commands in the entire script 
  127. language!  Only about a dozen of these will be used often.  The script 
  128. language is interpretive, so no compile is needed.  It is not a TSR, so 
  129. nothing remains to eat up your precious RAM.
  130.  
  131.    EXC can even be used with your favorite DOS communications program to
  132. process online scripts.  Send Email, download files, etc.  EXC can even be
  133. used to automate mainframe tasks through your 3270 emulation gateway.
  134.  
  135.    You simply execute EXC specifying the script file to use and the program
  136. to be executed.  You include all command line parameters for the program
  137. as usual.  By combining EXC executions in batch files, extremely complex
  138. processing can be reduced to a single DOS command.  EXC even returns the
  139. same DOS ERRORLEVEL that your program returned upon completion.
  140.  
  141.    All you need to know now is the format of the EXC command line and how
  142. to write a script.
  143.  
  144.  
  145.  
  146. 2.0 The EXC Command Line
  147.  
  148.    Format: EXC [path]scriptfile [[path]program] [command-line parameters]
  149.  
  150.    The scriptfile is the filename of the script to be processed.  The 
  151. extension, if specified, must be .SCR, but is not required to be specified.
  152. the script file is assumed to be in the current directory if a path is
  153. not specified.
  154.  
  155.    The program does not require an extension, but it must be a .EXE or
  156. .COM executable program file.  .BAT files cannot be executed with EXC.  If
  157. the path is not specified, the environment PATH= directories are searched.
  158. If the program is omitted from the command line, COMMAND.COM is assumed.
  159.  
  160.    The command-line parameters are any parameters that you would specify
  161. on the DOS command line if you were executing the program external to EXC.
  162.  
  163.  
  164. 2.1 Parameters that contain quotes
  165.    
  166.    If you try to pass command-line parameters to the spawned program that 
  167. contain imbedded quotes, you must use \q in place of the quotes to be 
  168. imbedded within the parameter.
  169.  
  170.    Parameters that contain spaces, |, < or > must be enclosed in quotes in
  171. order to be treated as a single parameter.
  172.  
  173.    If you want the spawned program to receive a parameter that looks like:
  174.      Help "Me" Out,
  175.    you would include it on the EXC command line as 
  176.      "Help \qMe\q Out"
  177.  
  178.   Confusing?  You bet!  But I have to work within the rules of DOS and the
  179. parameter passing rules of different languages and compilers. Amazingly, they
  180. do not all handle quoted strings in the same manner.  I learned this the
  181. hard way by publishing a release (v2.2) that did not work when spawning most
  182. PASCAL and assembler programs.
  183.  
  184.  
  185.  
  186.  
  187. 3.0 Operational notes   
  188.  
  189. 3.1 General notes
  190.  
  191.    If you want EXC scripts to execute multiple programs and/or enter 
  192. intrinsic DOS commands on the DOS command line, omit the program from
  193. the EXC command line or specify COMMAND.COM which is the default.  Your
  194. script will begin executing on an empty DOS command line.  
  195. EXC automatically issues an EXIT if COMMAND.COM was invoked.  If you 
  196. terminate the script with LEFT SHIFT-RIGHT SHIFT, you need to type EXIT 
  197. at the DOS prompt to terminate the COMMAND.COM that you started and remove 
  198. EXC from memory.
  199.    
  200.    Don't get cute and try to execute EXC as the object program of an EXC
  201. command.  While it might logically work, I can see no possible need for
  202. such action and you and your system are at your own risk.
  203.  
  204.    EXC creates an extended keyboard buffer that will hold 256 keycodes.  The
  205. DOS keyboard buffer will hold 16 keycodes.  Thus you may stuff up to 272
  206. keycodes with TYPE and KEY before the program requests keyboard input.  If
  207. you overflow this buffer (very unlikely), a runtime error occurs and script
  208. processing is halted.
  209.  
  210.    EXC is written in Borland C++, a product of Borland International.
  211.  
  212.  
  213. 3.2 Interrupt keys
  214.  
  215.    You can pause execution of a script by pressing the Scroll Lock key.  If   
  216. your keyboard has a Scroll Lock indicator light, the light will be on while   
  217. the script is paused.  Pressing Scroll Lock again resumes execution of the
  218. script exactly where it left off.  Any unexpired wait time must elapse
  219. before another command is processed.
  220.  
  221.    You can terminate execution of a script by holding down both the LEFT
  222. and RIGHT SHIFT keys.  A beep will indicate that the script is being
  223. terminated.  Execution of any spawned program will continue.
  224.  
  225.    The Pause key on your keyboard pauses all execution at the time the next
  226. screen write occurs.  Timer interrupts continue.  EXC detects the pause
  227. state and suspends itself.  When you strike any key, both EXC and the
  228. spawned task will resume processing.  Any unexpired wait time must elapse
  229. before another command is processed.  While paused, the spawned program
  230. remains active.
  231.    
  232.    Since EXC is executing as a timer interrupt with your program operating
  233. as a spawned subtask, cycle-stealing multitasking is occurring.  This can 
  234. cause a few problems.  If you must interrupt execution of your program, your 
  235. best bet may actually be pressing CTRL-ALT-DEL to reboot the computer.  If 
  236. you hit CTRL-BREAK, you will normally interrupt just one task while the other
  237. continues.  Pressing CTRL-BREAK again then interrupts the remaining task.
  238. This can confuse the remaining task to no end and lead to a system lock-up
  239. or other undesirable result.  If you are lucky, you may actually get by with 
  240. it, but I don't recommend it.  Even if you terminate EXC with LEFT SHIFT-
  241. RIGHT SHIFT, the timer interrupt is still active until your program 
  242. terminates, so the same problem can occur.
  243.  
  244.  
  245. 3.3 Memory usage
  246.  
  247.    EXC requires approximately 40K of conventional memory overhead.  After
  248. loading, it then allocates a buffer to hold your script file and a buffer
  249. for reading the screen contents.  If your application program's requirements 
  250. are pushing the limits of available RAM, you may not be able to execute it 
  251. under EXC control.  If COMMAND.COM is spawned, an additional 3K (DOS 5) is 
  252. used.
  253.  
  254.    The screen buffer varies according to the screen size active at startup or
  255. the value specified in a SCRMAX command.  It will require one byte for every
  256. character position on the screen, plus 4 bytes.  Thus an 80 x 25 text mode 
  257. will require a buffer of 2004 bytes.  If SCRMAX is present, that buffer size
  258. is always allocated, regardless of the initial text mode.
  259.  
  260.    The script buffer is the size required to hold all script commands strung
  261. end-to-end with 1 byte between each command.  Leading and trailing spaces
  262. are not counted.  If you use TYPFILE, the contents of the specified file are
  263. added to the script buffer.  Thus, your script buffer will increase by the 
  264. size of all files specified in TYPFILE commands.  If you specify the same
  265. file in two different TYPFILE commands, the file will be loaded into memory 
  266. twice.  If the TYPFILE is executed multiple times within a loop, it only 
  267. requires buffer space for a single copy of the file.
  268.  
  269.    With 604k of available memory, I am able to load a simple script with
  270. 35,000 fairly short commands.  
  271.  
  272.    Versions prior to 2.0 were limited to a total memory allocation of 64k 
  273. for all buffers.
  274.  
  275.    If your script is too large, you may encounter an error allocating script
  276. memory, allocating screen buffer memory or you will encounter an error that
  277. says you do not have enough memory to spawn your program.
  278.    
  279.  
  280. 3.4 Timing considerations
  281.  
  282.    EXC installs itself as a timer interrupt that is invoked 18.2 times
  283. per second.  If it has no work to do, it simply executes the system timer
  284. interrupt and any other chained timer interrupts and returns.  During waits 
  285. (DELAY, WAITFOR, etc.) the frequency of invocation is reduced to twice per 
  286. second.  This minimizes the impact of the interrupt on the performance of 
  287. your program.  A half-second is forever to most computers.  This also means
  288. that if you are searching for a string with WAITFOR, and the string flashes 
  289. on the screen for less than 1/2 second, it will not be detected.
  290.  
  291.    Needless to say, EXC does not have but 1/18th of a second to retrieve and
  292. execute a command.  This is a long time in a fast computer and a short
  293. time to a slow system.  I try to break commands down into logical parts that
  294. are executed in consecutive interrupts.  Obviously, there are some commands
  295. that will probably take longer than 1/18th of a second, especially on slower
  296. systems.  EXC is a handler for interrupt 1C.  No new 1C interrupts are
  297. initiated by the system until the active one is complete.  While missing
  298. a few interrupts has minimal effect on EXC or DOS, it could effect a spawned 
  299. task or TSR that is also servicing 1C interrupts.
  300.  
  301.    Very slow CPUs (6 Mhz or slower) may experience problems getting some
  302. tasks to function properly.  Sometimes a few judiciously palced DELAY or
  303. TICK commands will help.  Sometimes you may have to break down very long
  304. typed strings into multiple TYPE commands.  Others just may not work at all 
  305. if they just cannot accomplish their tasks fast enough.  Most of the more
  306. commonly used commands should work fine.
  307.  
  308.  
  309. 3.5 When EXC may not function or cause problems
  310.  
  311.    GRAPHICS MODES do not store text characters in video memory, only pixels
  312. of differing colors.  EXC cannot interpret these pixels into characters, thus
  313. commands that are based on screen reads will not work in graphics modes.
  314.  
  315.    In order to execute screen reads an writes rapidly due to timing 
  316. restraints, EXC reads and writes (SHOW, SHOWIN, READ, WAITFOR, WAITSCR, etc.)
  317. directly to and from video memory at pages B000-B7FF.  If you use DESQVIEW
  318. or a special graphics mode that relocates the active video page outside
  319. this area, screen reads and writes will not function properly.  This also
  320. prevents these commands from working properly in CGA modes.  All VGA text
  321. modes and most SVGA text modes should work properly.  If you use programs
  322. that change to a different text resolution during processing, please be sure 
  323. to read about the SCRMAX command.
  324.  
  325.    If the program you are executing or a TSR that is loaded in memory moves
  326. or otherwise messes with the DOS keyboard buffer, it could cause EXC to
  327. malfunction.  The most likely symptom would be keys that you TYPE or KEY
  328. not showing up or not appearing to have been pressed.  EXC uses BIOS 
  329. interrupt 16h, service 5 to insert the keys into the keyboard buffer.  It
  330. does not reallocate or move the buffer.  It merely creates a new extended
  331. buffer that only EXC is aware of.  As the timer interrupts occur, EXC
  332. always checks to see if anything is in the extended buffer, if so it will
  333. move as many keycodes as the PC keyboard buffer will hold into the keyboard
  334. buffer, or until the extended buffer is empty.  BIOS interrupt 16h is not
  335. available until later XT BIOSes.  As a general rule, EXC should not be used
  336. except on AT models or later.
  337.  
  338.    Other factors that could cause EXC to malfunction include programs and
  339. TSRs that have timer and keyboard interrupt handlers.  Customary usage of
  340. these interrupts provides for allowing other installed handlers to perform
  341. their function, but you cannot count on all programmers to abide by these
  342. conventions.  Since even "behaved" handlers can do virtually anything within 
  343. these routines, EXC cannot be guarranteed to function on these programs.  
  344. Fortunately, they are very rare.  EXC will work with many of them (i.e. 
  345. QBASIC and EDIT from MS-DOS 5.0 up).
  346.  
  347.    If a TSR or spawned task is using timer interrupt 1C for timing (music,
  348. communications, etc.) the timing could be thrown off slightly by EXC, 
  349. especially in slower systems.  In most cases, the effect will be negligible.
  350.  
  351.  
  352.    If you spot another program, video mode or anything else that causes
  353. EXC to malfunction, send me a CIS mail or U.S. mail note and I will check
  354. it out if I can.  I will include a note in this section on those reported
  355. problems if they cannot be fixed.
  356.  
  357.  
  358. 3.6 Error handling
  359.  
  360.    If an error occurs that prevents EXC from initiating the program, a
  361. message will appear and a DOS ERRORLEVEL of 255 will be returned.  If
  362. the program is successfully initiated, EXC will return the DOS ERRORLEVEL
  363. that the program returned when it completed.  There is an RC = nnn message
  364. after EXC terminates that displays the DOS ERRORLEVEL returned by your
  365. program and by EXC.  When COMMAND.COM is executed, the ERRORLEVEL will
  366. not reflect what was returned from one of the programs you executed and
  367. will always be zero.
  368.  
  369.    If EXC encounters an error while processing the script (i.e. an invalid
  370. script statement) it will sound two short beeps on the PC speaker and
  371. terminate processing any more script commands.  When the spawned program
  372. completes or is exited, a message will appear specifying the error EXC 
  373. encountered.
  374.  
  375.    If the spawned program terminates before EXC has finished processing
  376. the script, all script processing terminates at that point.  Keycodes
  377. that have been stuffed into the buffer remain there.  This allows you
  378. to enter a new command on the DOS command line from within your script.
  379. You can actually chain EXC processing without the use of a batch file.
  380.  
  381.  
  382. 4.0 Scripts
  383.  
  384.   Scripts can be written with any ASCII text file editor.  There is one 
  385. command per line.  Leading and trailing blanks and tabs, lines beginning with 
  386. a semicolon (;) and blank lines are ignored by the script processor.  You may 
  387. have more than one blank between the command and its parameter(s).
  388.  
  389.   All window coordinates specified in some commands are based on the full 
  390. screen currently displayed.  The upper left corner is column 1, row 1.
  391.  
  392.   All "string" parameters can accept quotes within the string by placing
  393. the characters \q (lower case) in the string where you want a quote to
  394. occur.
  395.  
  396.  
  397. 4.1 Script Commands
  398.  
  399.  Note: Brackets ([]) indicate an optional parameter and should not be
  400.        included as part of the command.  Quotes (""), where specified, 
  401.        are required to be entered as part of the parameter.
  402.  
  403.  BEEP                   Sound a short beep on speaker. Useful in debugging
  404.                         scripts.
  405.  CASE ON                The CASE commands enable case-sensitive (ON) or case-
  406.  CASE OFF               insensitive (OFF) compares by WAITFOR and SEARCH.  The
  407.                         initial mode is CASE ON.
  408.  CLEAR                  Clear the screen.
  409.  CURSOR col row         Move the cursor to the specified coordinates.
  410.  DELAY n                Wait n seconds
  411.  GOTO label             Unconditional branch to label.
  412.  IFN label              If condition set to N, go to label.
  413.  IFY label              If condition set to Y, go to label.
  414.  HIDEWIN                Restore a window displayed with SHOWIN to it's 
  415.                         original color attributes.
  416.  KEY mnemonic [n]       Push the key onto the keyboard stack. 'n' is the
  417.                         number of times you want the keycode inserted.
  418.  LOCATE "string"        Reads the screen until the string appears, then moves 
  419.                         the cursor to the start of the string.
  420.  LOOK "string"          Test to see if the string was on the screen at the 
  421.                         time the screen was last read.  Screen reads occur
  422.                         during execution of READ, SEARCH, WAITSCR and WAITFOR 
  423.                         commands.  Sets "Y/N" condition.
  424.  ON n label             Command will do nothing n times and on pass n+1, it
  425.                         will branch to label.
  426.  PAUSE                  Causes the script to be paused as if Scroll Lock were
  427.                         pressed.
  428.  QUIT                   Halt processing the script file.
  429.                         End-of-file on the script file issues an automatic
  430.                         QUIT.
  431.  READ                   Read the current screen contents.
  432.  SCRMAX cols rows       Specifies the largest screen size that will be used
  433.                         during execution.  Used to allocate screen buffer.
  434.  SEARCH "string"        Read screen and test to see if the string is on the 
  435.                         screen. Sets "Y/N" condition.
  436.  SETWAIT nnn            Wait nnn seconds before a WAITFOR or WAITSCR times
  437.                         out.
  438.  SHOW attr "string"     Display the string using the specified attribute.
  439.                         Displays at the location specified in SHOWAT.
  440.  SHOWAT col row         Specifies location for subsequent SHOW command
  441.                         strings to be displayed.
  442.  SHOWIN attr            Rewrite the current window text in the specified
  443.                         attribute.
  444.  TICK n                 Same as DELAY except n represents 1/18th of a second
  445.                         instead of a second.
  446.  TIME hhmmss            Pause execution of subsequent commands until the
  447.                         specified time of day.
  448.  TIMEOUT label          Branch to label when the next WAITFOR or WAITSCR
  449.                         timeout occurs.
  450.  TYPE "string"          Type the ASCII string.
  451.  TYPFILE filespec [mnemonic]      
  452.                         Type the contents of the specified file.  Replace
  453.                         CR/LFs with specified mnemonic.
  454.  WAITFOR [NOT] "string" Wait until the string appears on the screen.  If NOT
  455.                         specified, wait until string is not on screen.
  456.  WAITSCR                Wait until anything changes on the screen.
  457.  WINCOLS start end      Limit screen reads and SHOWIN to the screen columns
  458.                         specified.
  459.  WINMAX                 Remove row and column restraints imposed by WINCOLS
  460.                         and WINROWS.  Subsequent reads read the full screen.
  461.  WINROWS start end      Limit screen reads and SHOWIN to the screen rows
  462.                         specified.
  463.  :label                 Define a label.
  464.  
  465.  
  466. 4.1.1 BEEP
  467.  
  468.  Sounds a short BEEP on the PC speaker.  Since there is no visual feedback
  469.  for many of the operations and branches performed while processing a script,
  470.  debugging a script can be tough if it is complex.  Inserting a BEEP at a
  471.  strategic location in the script will tell you if processing ever reached
  472.  that point in the script.
  473.  
  474.  NOTE: BEEP does not extend the duration of the timer interrupt.  It actually
  475.  is turned on, then turned off a few ticks later.
  476.  
  477.  
  478. 4.1.2 CASE ON / CASE OFF
  479.  
  480.  The CASE commands determine case sensitivity during SEARCH, LOOK and WAITFOR
  481.  string searches.  If CASE is ON, the search string and screen contents are 
  482.  unchanged during the search, and must match in upper and lower case.  If 
  483.  CASE is OFF, the search string and all characters read from the screen are 
  484.  converted to upper-case before the search begins so that case does not 
  485.  influence the result of the compare.
  486.  
  487.  The initial CASE mode is ON.
  488.  
  489.  NOTE - You must reread the screen after changing the CASE mode before the
  490.  new CASE mode will take effect.
  491.  
  492.  See TIMEOUT for example.
  493.  
  494.  
  495. 4.1.3 CLEAR
  496.  
  497.  The CLEAR command clears the entire screen, not just the active window. 
  498.  It also homes the cursor.  Use with caution, this could cause problems 
  499.  within many applications.
  500.  
  501.  
  502. 4.1.4 CURSOR col row
  503.  
  504.  The cursor is moved to the location on the screen (not just within the
  505.  active window) specified by col and row.  Col and row are the screen column
  506.  and row.
  507.  
  508.  CURSOR is designed primarily to be used in a full screen editor or similar
  509.  applications where the cursor can be moved with the arrow keys.  The 
  510.  destination must be in an area of the screen where the active application 
  511.  allows typing.
  512.  
  513.  In order for your application to recognize that the cursor has been moved,
  514.  a series of <LEFT> <RIGHT> <UP> and <DOWN> keys are stuffed into the
  515.  buffer and executed until the cursor is at the desired location.  If you
  516.  send the cursor to a location that is not in an acceptable input area of
  517.  the active application, the cursor will jump around the destination, but
  518.  never get there.  You will have to terminate the script with LEFT SHIFT-
  519.  RIGHT SHIFT.
  520.  
  521.  Example:
  522.  
  523.    CURSOR 17 41
  524.  
  525.  
  526. 4.1.5 DELAY n
  527.  
  528.  Pauses execution of subsequent script commands until the specified number
  529.  of seconds has elapsed.
  530.  
  531.  Example: DELAY 3
  532.  
  533.  
  534. 4.1.6 GOTO label
  535.  
  536.  Executes an unconditional branch to the command following the specified 
  537.  label. 
  538.  
  539.  See ON for example.
  540.  
  541.  
  542. 4.1.7 HIDEWIN
  543.  
  544.  Restore the active window to its original attributes after a SHOWIN command 
  545.  has be executed.  If no SHOWIN has been executed, the results will not be
  546.  pleasing to the eye.  Also, screen reading commands must not be executed
  547.  between a SHOWIN and its corresponding HIDEWIN.  See SHOWIN for reasons for
  548.  using SHOWIN and HIDEWIN.
  549.  
  550.  See SHOWIN for example.
  551.  
  552.  
  553. 4.1.8 IFN label
  554.  
  555.  This tests the results of a previous SEARCH or LOOK command.  If the search 
  556.  string was not located on the screen, processing resumes at the command 
  557.  following the specified label.  If the string was found on the screen, 
  558.  processing resumes with the next command after the IFY command.
  559.  
  560.  If no previous SEARCH or LOOK has been issued, processing continues after 
  561.  branching to the specified label.  Thus, without a preceding SEARCH or
  562.  LOOK command, the IFN command becomes an unconditional branch equivalent to 
  563.  a GOTO command.
  564.  
  565.  The IFN statement does not have to be the next command after the SEARCH or
  566.  LOOK.
  567.  
  568.  Example:
  569.  
  570.  :Loop
  571.    READ
  572.    LOOK "XYZ"
  573.    IFN LoopEnd
  574.    .
  575.    .
  576.    .
  577.    GOTO Loop
  578.  :LoopEnd
  579.    .
  580.    .
  581.    .
  582.  
  583.  
  584. 4.1.9 IFY label
  585.  
  586.  This tests the results of a previous SEARCH or LOOK command.  If the search 
  587.  string was located on the screen, processing resumes at the command 
  588.  following the specified label.  If the string was not found on the screen, 
  589.  processing resumes with the next command after the IFY command.
  590.  
  591.  If no previous SEARCH or LOOK has been issued, the result is negative and 
  592.  processing continues without branching.  Thus, without a preceding SEARCH 
  593.  or LOOK command, the IFY statement appears as a null or nonexistent command.
  594.  
  595.  The IFY statement does not have to be the next command after the SEARCH or 
  596.  LOOK.
  597.  
  598.  See ON for example.
  599.  
  600.  
  601. 4.1.10 KEY <mnemonic> [n]
  602.  
  603.  KEY is used to enter special keys that require mnemonics (special names
  604.  enclosed in <> that represent their function) in order to input them to
  605.  the keyboard buffer.
  606.  
  607.  If n is specified, it is the number of times <mnemonic> will be inserted 
  608.  into the keyboard buffer.  For instance, if you wanted three TABs, you would
  609.  type "KEY <TAB> 3".  If n is not specified, it is assumed to be 1.
  610.  
  611.  The following key mnemonics are recognized:
  612.  
  613.  Single keys mnemonics:
  614.  
  615.  <BKSP>          <DEL>            <DOWN>           <END>            <ENTER>
  616.  <F1>-<F12>      <ESC>            <HOME>           <INS>            <LEFT>
  617.  <PGDN>          <PGUP>           <PRTSC>          <RIGHT>          <TAB>
  618.  <UP>            <GRAY5>          <GRAY+>          <GRAY->          <GRAY*>
  619.  <x>             <SPACE>
  620.  
  621.  Two key mnemonics:
  622.  
  623.  Shift key combinations: <SHF+s> or <SHF+x>     
  624.  CTL key combinations:   <CTL+s> or <CTL+x>
  625.  ALT key combinations:   <ALT+s> or <ALT+x>
  626.  
  627.  x = any ASCII value that can be entered from the keyboard with a single
  628.      key, or SHIFT + a single key.
  629.  
  630.  s = any of the single key mnemonic keywords or character except <PRTSC>.
  631.  
  632.  NOTE: Some SHF, CTL and ALT key combinations are undefined.  See the
  633.        keycode table in Appendix A.  There are no mnemonics for entering 
  634.        3-or-more-key combinations.  To detect these, a program must 
  635.        interrogate the keyboard flags to see if CTL, ALT or SHIFT are being 
  636.        held down.  This can only be done in real time as the keys are being 
  637.        pressed, therefore they cannot be simulated by placing these non-
  638.        existent key codes into the keyboard buffer.
  639.  
  640.  Examples:
  641.  
  642.    KEY <ESC> 3
  643.    KEY <CTL+F10>
  644.    KEY <ENTER>
  645.  
  646.  
  647. 4.1.11 LOCATE "string"
  648.  
  649.  The LOCATE command is mostly a combination of WAITFOR and CURSOR.  You
  650.  provide a string.  Processing will be suspended until that string appears
  651.  in the active window or a timeout occurs.  Once the string is located,
  652.  the cursor is moved, via a sequence of arrow keys stuffed in the keyboard
  653.  buffer, to the location of the first character of the string.
  654.  
  655.  LOCATE is designed primarily to be used in a full screen editor or similar
  656.  application where the cursor can be moved with the arrow keys.  The located
  657.  string must be in an area of the screen where the active application allows
  658.  typing.
  659.  
  660.  
  661. 4.1.12 LOOK "string"
  662.  
  663.  Look at the last screen that was read to see if it contains the value in
  664.  "string".  The entire active window contents will be searched to see if 
  665.  "string" was being displayed when the last screen read occurred.   The 
  666.  string may be any valid screen characters.  There is no wait involved as 
  667.  with WAITFOR.
  668.  
  669.  The screen contents are read each time a READ, SEARCH, WAITSCR, WAITFOR or
  670.  LOCATE command is executed.  In the case of WAITFOR and WAITSCR, multiple 
  671.  reads occur until a search string or change is detected.  The contents of 
  672.  the screen buffer remain as they were when the last read was executed at the
  673.  time the search string or change was detected or a timeout occurred.
  674.  
  675.  Once it has been determined whether or not "string" was being displayed,
  676.  an internal variable is set to "Y" or "N".  IFY and IFN can then be used to
  677.  test the result of the search and then branch accordingly.
  678.  
  679.  
  680. 4.1.13 ON n label
  681.  
  682.  For the first n executions of the ON command, execution simply passes to the 
  683.  next command.  On the next pass through the ON command, a branch occurs to
  684.  label.  The value of n can range from 1 to 9999.
  685.  
  686.  Example:
  687.  
  688.      :LOOP
  689.        ON 5 ENDLOOP
  690.        SEARCH "ERROR:"
  691.        IFY EXIT
  692.        TYPE "xyz"      - These two instructions are executed five
  693.        KEY <DOWN>      - times unless an error message pops up.
  694.        GOTO LOOP       
  695.      :ENDLOOP
  696.        KEY <ENTER>
  697.      :EXIT
  698.        QUIT
  699.        
  700.  
  701. 4.1.14 PAUSE
  702.  
  703.  PAUSE simulates pressing the Scroll Lock key to pause the script execution.
  704.  See the section on interrupt keys for a description of pause processing.
  705.  
  706.  
  707. 4.1.15 QUIT [n]
  708.  
  709.  QUIT stops processing a script at the point where it is encountered during
  710.  script execution.  The same result is obtained when there are no more script
  711.  commands to process.
  712.  
  713.  Normally on exit, EXC returns the return code of the executed program.  If
  714.  a number (0-255) is specified with the QUIT command, that value is returned
  715.  as the DOS ERRORLEVEL return code instead of what was passed from the
  716.  spawned program.
  717.  
  718.  An example of why you would want to set a return code:
  719.  
  720.    I use EXC to control PROCOMM PLUS to execute a script that synchro-
  721.    nizes my clock with the Naval Observatory.  I need to know if it
  722.    fails.
  723.  
  724.    I can detect the error with my EXC script, but when I exit PCPLUS,
  725.    PCPLUS always returns a return code of 255.  Using the QUIT nn format,
  726.    I can set a return code of 1 on error and 0 when there is no error.
  727.  
  728.  If COMMAND.COM was invoked by the EXC command line, QUIT types EXIT and keys
  729.  <ENTER> in order for EXC to be able to complete.  If you issue the QUIT 
  730.  while another program is active, you will not obtain the desired results.
  731.  
  732.  See TIMEOUT for example.
  733.  
  734.  
  735. 4.1.16 READ
  736.  
  737.  Reads the active window for subsequent testing with the LOOK command.  Using 
  738.  a READ followed by several LOOKs that examine the same screen contents can
  739.  be much more efficient than issuing several SEARCHes, each of which reads
  740.  the entire screen contents.
  741.  
  742.  
  743. 4.1.17 SCRMAX cols rows
  744.  
  745.  I hate including technical parameters in my commands, but this one is a
  746.  must for successful operation of EXC in larger screen modes.
  747.  
  748.  Specify SCRMAX if you expect a spawned application to change to a text 
  749.  screen mode larger than the text mode in use when EXC is initiated.  For
  750.  instance, if you are in DOS with 25 rows of 80 column text and you initiate
  751.  an editor with EXC and the editor places the screen in 80x50 text mode,
  752.  specify "SCRMAX 80 50" in your script (no quotes).  Since this command is
  753.  processed when the script is being loaded into memory and not after the
  754.  script processing begins, it may be placed anywhere within your script.
  755.  Logically, it should occur at the start.  If multiple SCRMAX commands are
  756.  encountered, only the last one input will be used.  If your application will
  757.  use multiple screen sizes, specify the largest (in area: cols times rows)
  758.  that will be used.
  759.  
  760.  If you do not include SCRMAX in your script, it is assumed that the screen
  761.  size in effect when EXC is loaded and before the spawned program is loaded 
  762.  will be the maximum size needed.
  763.  
  764.  The range of text mode screen sizes supported by EXC includes from 40x20 to 
  765.  200x100 characters.
  766.  
  767.  SCRMAX can have a major impact in the amount of memory occupied by EXC.
  768.  It would seem that the logical thing for EXC to do would be to examine
  769.  the screen size before each read and allocate the screen memory buffer
  770.  accordingly at that time.  However, since EXC spawns another program which
  771.  can, and often does, allocate all of the remaining memory, EXC must pre-
  772.  allocate the largest buffer that will be required before spawning the 
  773.  program.  A screen buffer requires the same number of bytes as the rows 
  774.  times the columns, plus 4 bytes.  Thus, an 80x25 VGA text screen will 
  775.  require a 2,004 byte buffer.  I actually had a user contact me who uses a 
  776.  132x66 display (great eyes or a huge monitor!).  This would require 132 * 66 
  777.  or 8,712 bytes of memory.  
  778.  
  779.  If you do not specify SCRMAX and your program bumps up the screen size,
  780.  the effective area of the larger screen is the upper left quadrant
  781.  corresponding to the size of the screen when EXC was loaded.  This is
  782.  also true if you specify an SCRMAX smaller than the largest screen.  In
  783.  other words, if you specify SCRMAX 80 25 and your program changes to a
  784.  132x44 screen,  Only the first 80 columns and 25 rows are read by EXC's
  785.  READ, WAITFOR, WAITSCR, LOCATE and SEARCH commands.  If all of the strings
  786.  you search for and changes you wish to detect are in the upper left of
  787.  the screen, you can save memory by specifying a smaller SCRMAX size.  You 
  788.  would really have to be in a memory crunch to bother with this approach, 
  789.  I suspect.
  790.   
  791.  Examples:
  792.  
  793.    SCRMAX 80 50
  794.    SCRMAX 132 25
  795.  
  796.  
  797. 4.1.18 SEARCH "string"
  798.  
  799.  At any point in processing the script, you may check to see if certain
  800.  information is on the screen.  The entire active window will be read and 
  801.  searched to see if "string" is being displayed.   The string may be any 
  802.  valid screen characters.  There is no wait involved as with WAITFOR.
  803.  
  804.  Once it has been determined whether or not the string is being displayed,
  805.  an internal variable is set to "Y" or "N".  IFY and IFN can then be used to
  806.  test the result of the search and then branch accordingly.
  807.  
  808.  SEARCH is basically a READ followed immediately by a LOOK.
  809.  
  810.  See ON for example.
  811.  
  812.  
  813. 4.1.19 SETWAIT seconds
  814.  
  815.  This sets the timeout limit for WAITSCR, WAITFOR and LOCATE commands.  If 
  816.  processing is waiting after invoking any of these commands and the specified 
  817.  number of seconds elapses, TIMEOUT processing, described under TIMEOUT, will 
  818.  be invoked.
  819.  
  820.  You may change the SETWAIT timeout limit at any point while processing the 
  821.  script.
  822.  
  823.  If SETWAIT is set to zero, no timeout ever takes place and EXC will wait
  824.  indefinitely during WAITFOR, WAITSCR and LOCATE.  The initial value of the 
  825.  SETWAIT timer is zero. 
  826.  
  827.  See TIMEOUT for example.
  828.  
  829.  
  830. 4.1.20 SHOW attr "string"
  831.  
  832.   SHOW displays a string at a given location on the screen.  This command
  833.  is mostly useful for debugging scripts by displaying information about the
  834.  progress of the script during execution.  While mostly harmless, it can cause
  835.  problems if a spawned program reads screen memory.  Use it cautiously.
  836.   
  837.  The string is displayed at the location specified in the last executed
  838.  SHOWAT command.
  839.   
  840.  The screen attribute is the sum of a background value plus a foreground
  841.  value from the table below.  Add 128 if you want it to blink.
  842.  
  843.   Background colors:       Foreground colors:
  844.  
  845.     0 Black                 0 Black
  846.    16 Blue                  1 Blue
  847.    32 Green                 2 Green
  848.    48 Cyan                  3 Cyan
  849.    64 Red                   4 Red
  850.    80 Magenta               5 Magenta
  851.    96 Brown                 6 Brown
  852.   112 Light Gray            7 Light Gray
  853.                             8 Dark Gray
  854.                             9 Light Blue
  855.                            10 Light Green
  856.                            11 Light Cyan
  857.                            12 Light Red
  858.                            13 Light Magenta
  859.                            14 Yellow
  860.                            15 White
  861.  
  862.  See TIMEOUT for example. 
  863.  
  864.  
  865. 4.1.21 SHOWAT col row
  866.  
  867.  Specifies the location on the screen where subsequent SHOW commands will
  868.  display their strings.  The location does not have to be within the active
  869.  window set via WINROWS and WINCOLS.
  870.  
  871.  See TIMEOUT for example.
  872.  
  873.  
  874. 4.1.22 SHOWIN attr
  875.  
  876.  SHOWIN is designed as an aid to script writing.  Sometimes you will want to
  877.  restrict the active window to certain rows and columns, thus creating a
  878.  smaller active window for processing commands that read the screen.
  879.  
  880.  To make sure you have calculated the correct area for the active window, you
  881.  can use SHOWWIN to show you where the active window is located on the 
  882.  screen.  SHOWIN will change the attribute of all characters and spaces
  883.  within the active window to that specified.  See the SHOW command for
  884.  attribute values.
  885.  
  886.  HIDEWIN can then be used to restore the window to its normal attributes.
  887.  There must never be any screen reading commands (WAITFOR, WAITSCR, SEARCH,
  888.  READ and LOCATE) executed between the SHOWIN and its associated HIDEWIN.
  889.  
  890.  
  891.  Example:
  892.    
  893.     WINCOLS 10 30
  894.     WINROWS 12 22
  895.     SHOWIN
  896.     PAUSE
  897.     HIDEWIN
  898.  
  899.  
  900. 4.1.23 TICK n
  901.  
  902.  Pauses execution of subsequent script commands until the specified number
  903.  of system clock ticks (18.2 per second) have elapsed.
  904.  
  905.  Example: TICK 12
  906.  
  907.  
  908. 4.1.24 TIME hhmmss
  909.  
  910.  Pauses execution of subsequent script commands until the specified time of
  911.  day.  The time must be specified in 24-hour format.  If the time has
  912.  already passed when the TIME command is processed, processing is suspended
  913.  until the next time the specified time of day occurs.
  914.  
  915.  Leading zeros are required if the hour, minute or second is less that two 
  916.  digits.  For instance two minutes after one in the morning is entered as 
  917.  010200.
  918.  
  919.  Note- The real time clock (set by the DOS TIME command in AT and later 
  920.  machines using DOS 3.x or later) and the system timer (which EXC uses) are 
  921.  not always in synch to the second.  There may be a few seconds variation.
  922.  
  923.  Example: 
  924.  
  925.   ; At 1:15 PM, set off an alarm that can be shut off with LEFT SHIFT-RIGHT
  926.   ; SHIFT
  927.  
  928.     TIME 131500
  929.  
  930.   :Loop
  931.     BEEP
  932.     GOTO Loop
  933.  
  934.  
  935. 4.1.25 TIMEOUT label
  936.  
  937.  When the timeout limit specified by SETWAIT expires while waiting for a
  938.  WAITSCR, WAITFOR or LOCATE, TIMEOUT processing is invoked.  Timeout 
  939.  processing is as follows:
  940.  
  941.  If no TIMEOUT command has yet been issued in the script, processing of the 
  942.  script is halted at this point.  Otherwise, the control will pass to the 
  943.  command following the label specified in the last TIMEOUT command 
  944.  encountered.
  945.  
  946.  Example:
  947.  
  948.    SETWAIT 20
  949.    TIMEOUT TimedOut
  950.    SHOWAT 17 25
  951.    WINCOLS 20 40
  952.    WINROWS 15 22
  953.    CASE ON
  954.    
  955.    WAITFOR "XYZ"
  956.    SH0W 79 "Found XYZ in window."
  957.    QUIT
  958.  
  959. :TimedOut
  960.    SH0W 79 "Timed out waiting for XYZ to appear in window."
  961.    WINMAX
  962.    CASE OFF
  963.    .
  964.    .
  965.    .
  966.  
  967.  
  968. 4.1.26 TYPE "string"
  969.  
  970.  The string following the TYPE command contains ASCII characters to be placed
  971.  in the keyboard buffer.  ASCII character are those with a decimal equivalent
  972.  of 0-127.  Do not use high-bit characters (graphics characters, foreign
  973.  language characters and most symbols) that range from 128-255 in their
  974.  decimal equivalents.  These characters hove no valid keycode associated
  975.  with them.  To enter special keys such as function keys, ENTER, ESC, etc.,
  976.  use the KEY command followed by the required mnemonic.  You cannot enter
  977.  these mnemonics with the TYPE command.  The string must be enclosed in
  978.  quotes.
  979.  
  980.  See ON for example.
  981.  
  982.  
  983. 4.1.27 TYPFILE filespec [mnemonic]
  984.  
  985.  TYPFILE allows you to type the contents of a file into the keyboard buffer.
  986.  The filespec is the filename with optional path information.  
  987.  
  988.  A possible use for this would be to feed an electronic mail message to a 
  989.  communications program.  Each line of the file is entered as is (no 
  990.  deletion of leading or trailing spaces, conversion of quotes, etc.).  
  991.  
  992.  If no mnemonic is specified, the carriage return/line feed characters at 
  993.  the end of each line are ignored by EXC, and nothing is entered in their 
  994.  place.  If a mnemonic is specified, carriage return/line feed pairs are 
  995.  converted to the key mnemonic specified.  For instance, if the file is
  996.  being copied into a word processor or editor that uses the ENTER key to
  997.  move to the next line, you may want to convert CR/LFs to <ENTER>.  If you
  998.  want the word processor to split the lines according to its margins, you
  999.  would not specify a mnemonic or you would specify <SPACE>.
  1000.  
  1001.  Specifying <SPACE> for the mnemonic will keep the last word on a line from 
  1002.  running into the first word on the next line when the CR/LF is removed.
  1003.  
  1004.  All other key mnemonics are described under the KEY command.
  1005.  
  1006.  Since EXC only has a 256 byte extended keyboard buffer, it feeds a maximum 
  1007.  of 80 bytes every clock tick into the extended buffer.  This should give 
  1008.  time for the spawned program to read characters from the buffer and will 
  1009.  usually prevent the buffer from overflowing.
  1010.  
  1011.  Please see the notes in section 3 regarding memory usage to determine the
  1012.  effects on memory of using TYPFILE.
  1013.  
  1014.  
  1015. 4.1.28 WAITFOR [NOT] "string"
  1016.  
  1017.  No further script file command will be processed until "string" appears on
  1018.  the screen.  The entire screen will be searched for "string".  The string 
  1019.  may be any valid screen characters.  If the string does not appear before 
  1020.  the SETWAIT limit expires, TIMEOUT processing will be invoked. 
  1021.  
  1022.  If NOT is specified, processing will be halted until "string" is not on the
  1023.  screen.  This is handy for waiting on a "Please wait.." type message to
  1024.  disappear.
  1025.  
  1026.  Since WAITFOR reads the screen each 1/2 second, values that flash on the
  1027.  screen for less than 1/2 second may not be detected.
  1028.  
  1029.  See TIMEOUT for example.
  1030.  
  1031.  WAITFOR NOT example:
  1032.  
  1033.    WAITFOR NOT "XYZ"
  1034.  
  1035.  
  1036. 4.1.29 WAITSCR
  1037.  
  1038.  Wait until there is any change to the screen before executing the next
  1039.  script command.  If there is no screen change before the SETWAIT limit
  1040.  expires, TIMEOUT processing will be invoked.
  1041.  
  1042.  
  1043. 4.1.30 WINCOLS start end
  1044.  
  1045.  Sometimes you may want to restrict your screen searches to a certain area
  1046.  of the screen.  WINCOLS allows you to specify what columns (far left = 1)
  1047.  you want read by all commands that read the screen (READ, SEARCH, WAITFOR,
  1048.  WAITSCR and LOCATE).  Specify the starting and ending columns inclusively.
  1049.  
  1050.  By combining WINCOLS with WINROWS, you can restrict reads to a selected
  1051.  box within the screen.  This is referred to as the active window.  Use 
  1052.  WINMAX to return the active window to the full screen.
  1053.  
  1054.  See TIMEOUT and SHOWIN for examples.
  1055.  
  1056.  
  1057. 4.1.31 WINMAX
  1058.  
  1059.  If you have restricted the active window with WINCOLS and/or WINROWS, you
  1060.  can return the active window to the full screen area by issuing a WINMAX
  1061.  command.  The size of the new active window will be determined by the 
  1062.  currently displayed columns and rows, but never exceeding the values
  1063.  specified in SCRMAX.
  1064.  
  1065.  See TIMEOUT for example.
  1066.  
  1067.  
  1068. 4.1.32 WINROWS start end
  1069.  
  1070.  Sometimes you may want to restrict your screen searches to a certain area
  1071.  of the screen.  WINROWS allows you to specify what rows (top = 1) you want 
  1072.  read by all commands that read the screen (READ, SEARCH, WAITFOR, WAITSCR 
  1073.  and LOCATE).  Specify the starting and ending rows inclusively.
  1074.  
  1075.  By combining WINCOLS with WINROWS, you can restrict reads to a selected
  1076.  box within the screen.  This is referred to as the active window.  Use 
  1077.  WINMAX to return the active window to the full screen.
  1078.  
  1079.  See TIMEOUT and SHOWIN for examples.
  1080.  
  1081.  
  1082. 4.2 Labels
  1083.  
  1084.  Labels can be up to 15 characters long and may contain letters, numbers,
  1085.  special characters or spaces.  They are treated as upper case regardless of
  1086.  how they are coded.  Duplicate labels are not allowed in the same script.
  1087.  END, end and End would all be considered duplicate labels.  If duplicate
  1088.  labels exist, all branches to the duplicate labels will go to the first
  1089.  one in the script.
  1090.  
  1091.  Labels must be immediately preceded by a colon (:) and placed on a line 
  1092.  which does not contain any commands.  
  1093.  
  1094.  labels are used as destinations for branching commands (TIMEOUT, GOTO, ON,
  1095.  IFY and IFN).
  1096.  
  1097.  It doesn't hurt a thing if you want to use labels for comments, but the 
  1098.  semicolon (;) remark is a better approach since there is no length 
  1099.  limitation on remarks and they will not be confused with labels that are 
  1100.  actual destinations.
  1101.  
  1102.  See TIMEOUT and ON for examples.
  1103.  
  1104.  
  1105. 4.3 Remarks
  1106.  
  1107.  Anything on a line for which the first non-blank character is a semicolon 
  1108.  (;) is treated as a comment line and is ignored by the script processor.
  1109.  
  1110.  
  1111. 4.4 Environment variable substituion
  1112.  
  1113.  You may use envionment strings in any command parameter by typing %VAR%
  1114.  where you want the environment string labeled VAR to be substituted.  Here
  1115.  are some examples:
  1116.  
  1117.  Given these environment varables:
  1118.   SET ATTR=15
  1119.   SET ME=Gary
  1120.   SET LAST=Crider
  1121.   SET FULL="Gary Crider"
  1122.   SET FULL2=Gary Crider
  1123.  
  1124.   SHOW %ATTR% "I am %ME%"  would equate to  SHOW 15 "I am Gary"
  1125.   TYPE "%ME% %LAST%"       would equate to  TYPE "Gary Crider" 
  1126.   TYPE %FULL%              would equate to  TYPE "Gary Crider"
  1127.   TYPE "%FULL2%"           would equate to  TYPE "Gary Crider"
  1128.   DELAY %ATTR%             would equate to  DELAY 15
  1129.   SHOW %ATTR% "%FULL%"     would equate to  SHOW 15 "\qGary Crider\q"
  1130.   TYPE "%LAST%, %ME%"      would equate to  TYPE "Crider, Gary"
  1131.  
  1132.  The substitution is made before EXC begins to evaluate the parameters.
  1133.  
  1134.  This could be handy on networks where the values keyed or searched might 
  1135.  vary with the user's network ID, which could be stored in an environment
  1136.  variable.  Many other uses also come to mind.
  1137.  
  1138.  If you want to use a set a variables that are only used in the script and
  1139.  are not normally maintained in the environment, set up a batch file to
  1140.  set the variables, execute the script, and then delete the variables after
  1141.  the script has executed.  This frees up the environment space so that it
  1142.  can be reused.  An example of such a batch file would be:
  1143.  
  1144.  SET X1=abc
  1145.  SET X2=5
  1146.  SET X3=Gary Crider
  1147.  EXC MYSCRIPT 123
  1148.  SET X1=
  1149.  SET X2=
  1150.  SET X3=
  1151.  
  1152.  If you get a message from DOS that says "Out of enviroment space", you
  1153.  can increase the size of the environment region by placing the following 
  1154.  line in your CONFIG.SYS file and rebooting:
  1155.  
  1156.    SHELL=C:\COMMAND.COM /p /e:nnnn
  1157.  
  1158.  Replace nnnn with the number of bytes (160-32768) that you want used by the 
  1159.  environment region.  The default is 256.  The number should be divisible by
  1160.  16.  1024 is usually pretty good.  Note that each byte you increas the 
  1161.  region by will decrease the amount of free conventional memory used to
  1162.  run programs.  Each variable name, the equal sign, and the variable value
  1163.  are stored in your environment.  To see what is currently stored in your
  1164.  environment, type the word SET at the DOS prompt.  Your full PATH= state-
  1165.  ment is also stored there.
  1166.  
  1167.  If you use 4DOS or a different command interpreter, or locate it in another
  1168.  directory, adjust the SHELL= statement accordingly.
  1169.  
  1170. 4.5 Example Script
  1171.  
  1172.  The following example demonstrates the use of most of the more commonly used 
  1173.  commands.  Please note that the  QUIT statement after the End label is not 
  1174.  needed since the same action takes place when there are no more commands to 
  1175.  execute.
  1176.  
  1177.  Also please note that the SEARCH and IFN statements after the Loop label
  1178.  could more easily be accomplished with a WAITFOR command.  This just 
  1179.  demonstrates that looping logic is supported in scripts.
  1180.  
  1181.    SETWAIT 30
  1182.    TIMEOUT End
  1183.    CASE OFF
  1184.    WAITFOR "Entries"
  1185.    CASE ON
  1186.    TYPE "FO"
  1187.    WAITFOR "OPEN CATALOG"
  1188.    TYPE "E:\NOVLIB\"
  1189.    KEY <TAB>
  1190.    KEY <ESC>
  1191.    TYPE "NOVLIB.L11"
  1192.    KEY <CTL+ENTER>
  1193.    WAITSCR
  1194.  
  1195.  :Loop
  1196.    SEARCH "NOVLIB.L11"
  1197.    IFN Loop
  1198.  
  1199.    TYPE "SLADDNAEA"
  1200.    KEY <CTL+ENTER>
  1201.    DELAY 2;
  1202.    WAITFOR NOT "Sorting Index"
  1203.    TYPE "FS"
  1204.    KEY <CTL+ENTER>
  1205.    DELAY 2
  1206.    WAITFOR NOT "Please wait."
  1207.  
  1208.  :End   
  1209.    BEEP
  1210.    KEY <ALT+X>
  1211.    QUIT
  1212.  
  1213.  
  1214.  For a more comprehensive example, see the script file, TESTEXC.SCR.  Please
  1215.  read the comments before and after that script.
  1216.  
  1217.  
  1218.  
  1219. APPENDIX A
  1220.  
  1221. Installation
  1222.  
  1223.     EXC is distributed in a ZIP file called EXC.ZIP.  It contains the
  1224. following files:
  1225.  
  1226.         EXC.EXE         The executable file for EXC.
  1227.         EXC.DOC         The documentation file.
  1228.         HELP.TXT        Script command quick reference.  It is formatted as
  1229.                         script file comments so that it can be included in
  1230.                         you script for quick referencing.z
  1231.         TESTEXC.SCR     Example script used to test EXC functionality.
  1232.         TESTEXC.TXT     Text file for testing TYPFILE with TESTEXC.SCR.
  1233.         EXC.HST         Text description of past updates.
  1234.         EXC.Vnn         Text description of latest updates in version nn.
  1235.         PRODUCTS.DOC    Description of other Parity Solutions products.
  1236.  
  1237.     For best results, unzip the file into a directory on your PATH.  If you
  1238. don't use a directory in your path, you will have to designate the directory
  1239. containing EXC.EXE when executing the program.
  1240.  
  1241.     If you have a utility directory that is on your PATH, this is an excellent
  1242. location for EXC.  An example installation would be:
  1243.  
  1244.     C:
  1245.     CD \UNTIL
  1246.     COPY [path]EXC.ZIP
  1247.     PKUNZIP EXC
  1248.     DEL EXC.ZIP
  1249.  
  1250.     The PKUNZIP program is by PKWARE, Inc. and is available in many CompuServe
  1251. forums under the file name of PKZ110.EXE.  Since you are reading this doc
  1252. files, you have obviously already managed to unZIP the distribution file.  If 
  1253. it is not currently in your path, simply copy all of the files to a directory 
  1254. in your path.  Keep the EXC.ZIP file anywhere you like, but give plenty of
  1255. copies, as is, to your friends.  If you register EXC, you are not licensed
  1256. to give your serial number to anybody without first removing the serialization
  1257. from your copy.
  1258.  
  1259.  
  1260.  
  1261.  
  1262. APPENDIX B
  1263.  
  1264.  
  1265. Keycode Table
  1266.  
  1267. Although you do not need to know these codes to write EXC scripts, the
  1268. following table does show you which combinations are defined and available
  1269. by using the appropriate mnemonics.  Do not try to use combinations which
  1270. indicate N/A in the table.
  1271.  
  1272.  Key             Norm        Shift       Ctrl        Alt
  1273.  ----            ----        -----       ----        ---
  1274.  A               1E61        1E41        1E01        1E00
  1275.  B               3062        3042        3002        3000
  1276.  C               2E63        2E42        2E03        2E00
  1277.  D               2064        2044        2004        2000
  1278.  E               1265        1245        1205        1200
  1279.  F               2166        2146        2106        2100
  1280.  G               2267        2247        2207        2200
  1281.  H               2368        2348        2308        2300
  1282.  I               1769        1749        1709        1700
  1283.  J               246A        244A        240A        2400
  1284.  K               256B        254B        250B        2500
  1285.  L               266C        264C        260C        2600
  1286.  M               326D        324D        320D        3200
  1287.  N               316E        314E        310E        3100
  1288.  O               186F        184F        180F        1800
  1289.  P               1970        1950        1910        1900
  1290.  Q               1071        1051        1011        1000
  1291.  R               1372        1352        1312        1300
  1292.  S               1F73        1F53        1F13        1F00
  1293.  T               1474        1454        1414        1400
  1294.  U               1675        1655        1615        1600
  1295.  V               2F76        2F56        2F16        2F00
  1296.  W               1177        1157        1117        1100
  1297.  X               2D78        2D58        2D18        2D00
  1298.  Y               1579        1559        1519        1500
  1299.  Z               2C7A        2C5A        2C1A        2C00
  1300.  1               0231        0221        N/A         7800
  1301.  2               0332        0340        0300        7900
  1302.  3               0433        0423        N/A         7A00
  1303.  4               0534        0524        N/A         7B00
  1304.  5               0635        0625        N/A         7C00
  1305.  6               0736        075E        071E        7D00
  1306.  7               0837        0826        N/A         7E00
  1307.  8               0938        092A        N/A         7F00
  1308.  9               0A39        0A28        N/A         8000
  1309.  0               0B30        0B29        N/A         8100
  1310.  ,               332C        333C        N/A         N/A
  1311.  .               342E        343E        N/A         N/A
  1312.  /               352F        353F        N/A         N/A
  1313.  ;               273B        273A        N/A         N/A
  1314.  '               2827        2822        N/A         N/A
  1315.  [               1A5B        1A7B        1A1B        N/A
  1316.  ]               1B5D        1B7D        1B1D        N/A
  1317.  `               2960        297E        N/A         N/A
  1318.  -               0C2D        0C5F        0C1F        8200
  1319.  =               0D3D        0D2B        N/A         8300
  1320.  \               2B5C        2B7C        2B1C        N/A
  1321.  F1              3B00        5400        5E00        6800
  1322.  F2              3C00        5500        5F00        6900
  1323.  F3              3D00        5600        6000        6A00
  1324.  F4              3E00        5700        6100        6B00
  1325.  F5              3F00        5800        6200        6C00
  1326.  F6              4000        5900        6300        6D00
  1327.  F7              4100        5A00        6400        6E00
  1328.  F8              4200        5B00        6500        6F00
  1329.  F9              4300        5C00        6600        7000
  1330.  F10             4400        5D00        6700        7100
  1331.  Enter           1C0D        1C0D        1C0A        N/A
  1332.  Ins             5200        5230        N/A         N/A
  1333.  Del             5300        532E        N/A         N/A
  1334.  Esc             011B        011B        011B        N/A
  1335.  Home            4700        4737        7700        N/A
  1336.  End             4F00        4F31        7500        N/A
  1337.  PgUp            4900        4939        8400        N/A
  1338.  PgDn            5100        5133        7600        N/A
  1339.  <Tab>           0F09        0F00        N/A         N/A
  1340.  <BackSpace>     0E08        0E08        0E7F        N/A
  1341.  <LeftArrow>     4B00        4B34        7300        N/A
  1342.  <RightArrow>    4D00        4D36        7400        N/A
  1343.  <UpArrow>       4800        4838        N/A         N/A
  1344.  <DownArrow>     5000        5032        N/A         N/A
  1345.  <Gray 5>        N/A         4C35        N/A         N/A
  1346.  <Gray *>        372A        N/A         7200        N/A
  1347.  <Gray ->        4A2D        4A2D        N/A         N/A
  1348.  <Gray +>        4E2B        4E2B        N/A         N/A
  1349.  <Space>         3920        N/A         N/A         N/A
  1350.  <F11>           8500        8700        8900        8B00
  1351.  <F12>           8600        8800        8A00        8C00
  1352.  
  1353.  In addition, the <PRTSC> (print screen) mnemonic can be used in EXC to
  1354. cause a screen print.  The <PRTSC> cannot be placed in the keyboard buffer
  1355. since it does not have a key code.  KEY <PRTSC> is executed immediately.
  1356.  
  1357.  
  1358.  
  1359.  
  1360. APPENDIX C
  1361.  
  1362.  
  1363. Disclaimer
  1364.  
  1365. BECAUSE OF THE DIVERSE NATURE OF COMPUTER EQUIPMENT AND EXPERTISE OF USERS,
  1366. PARITY SOLUTIONS AND GARY C. CRIDER MAKE NO WARRANTY ON THE EXC PROGRAM
  1367. WHATSOEVER, EXPRESS OR IMPLIED.  THE USER ASSUMES ALL RISK OF DAMAGE TO
  1368. DATA OR EQUIPMENT RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OR MISUSE OF
  1369. THIS PROGRAM PRODUCT.
  1370.  
  1371. USERS ARE ADVISED TO TEST PROGRAMS AND SCRIPTS THOROUGHLY ON DATA FOR WHICH A
  1372. BACKUP EXITS.  ANY LIABILITY OF THE AUTHOR OR PARITY SOLUTIONS IS LIMITED TO
  1373. REPLACEMENT OR REFUND OF THE REGISTRATION FEE.
  1374.  
  1375.  
  1376.  
  1377.  
  1378. APPENDIX D
  1379.  
  1380.  
  1381. Support
  1382.  
  1383.     I have tried to test the program to the fullest, but I am limited as to
  1384. systems and configurations with which to test.  I have been programming for 18
  1385. years and the one thing I know for sure is that bug free programs are very few
  1386. and far between.  I can only promise to support the program to the best of my
  1387. ability and provide fixes as expeditiously as possible.
  1388.  
  1389.     Anyone can report problems and suggest changes.  Registered users get top
  1390. priority in resolving their problems.  There are three ways you can report
  1391. problems.  The preferred method is to contact me through CIS mail (not forum
  1392. messages).  My CIS ID is 71760,3413.  You can also write me at:
  1393.  
  1394.    Gary C. Crider
  1395.    Parity Solutions
  1396.    1105 Burgess Court
  1397.    Arlington, TX 76015
  1398.  
  1399.    After 10/31/93 we will move to:
  1400.  
  1401.    1903 Pavia Ct.
  1402.    Arlington, TX 76006
  1403.  
  1404.     The last method is to phone (817) 467-7818.  Since I am the sole technical
  1405. support and the line is also used for my network consulting business, it is
  1406. often hard to get through to me.  Please call and leave a message between 7:30
  1407. am and 5:30 pm Central time.
  1408.  
  1409.     No matter which method you use, please give a brief description of your
  1410. problem, your registration serial number if you are registered, and your phone
  1411. number.  If I need more information, I will contact you as soon as I can.
  1412. When I have a solution, I will contact you however you prefer.  Never post
  1413. your serial number on forum messages.  CIS mail is OK.  I seldom read forum
  1414. messages and they are not private.
  1415.  
  1416.     I work full time, have a consulting business to run in my spare time and
  1417. write programs instead of sleeping.  So please be a little patient with me.
  1418.  
  1419.     Program updates are available on CompuServe or can be requested from us 
  1420. for a $5 shipping and handling charge.  Add $1 for international shipping 
  1421. outside the North American continent.  A distribution disk of all Parity 
  1422. Solutions products will be sent to you.  Specify disk size and format.  You
  1423. may use the order form at the end of this document.
  1424.  
  1425.                  
  1426. APPENDIX E
  1427.  
  1428.  
  1429. Registration
  1430.  
  1431.  
  1432.     I begin with an apology.  I hate programs that in any way inhibit func-
  1433. tionality or performance for the shareware version.  But when it came down to
  1434. feeding the family and paying the bills, I had a change of heart and inserted
  1435. a pesky notice that pops up at the beginning and gets on your nerves.  I
  1436. chose this approach above that of limited functionality.  The program's full
  1437. capabilities are available for you to evaluate before you invest your hard-
  1438. earned money.
  1439.  
  1440.     Registered users will receive a unique serial number and instructions on
  1441. how to serialize the program.  Serialization can be re-applied to updated
  1442. versions and in no way hinders your use of the program.  You can compress or
  1443. decompress the program with no effect (LZEXE or PKLITE).  I use Fabrice
  1444. Bellard's LZEXE program on EXC.EXE before distribution.
  1445.  
  1446.     As a registered user, you will be able to update without re-registration
  1447. or additional fees.  You will also be kept on my PRIVATE mailing list to
  1448. receive additional information on other Parity Solutions products.  
  1449.  
  1450.     To register your copy, please use the order form below and send $24 US 
  1451. ($80 per file server on LANS) check or money order (sorry, no credit cards 
  1452. yet) to:
  1453.  
  1454.    Gary C. Crider
  1455.    Parity Solutions
  1456.    1105 Burgess Court
  1457.    Arlington, TX 76015
  1458.  
  1459.    After 10/31/93 use:
  1460.  
  1461.    1903 Pavia Ct.
  1462.    Arlington, TX 76006
  1463.  
  1464.     Or, you can register online quickly and simply in Compuserve.  Simply
  1465. GO SWREG and register ID #753.  Your registration will be added to your 
  1466. Compuserve bill.  International exchange was never easier and you save the
  1467. $1 international postage charge.
  1468.  
  1469.     If you send your CIS id or register via CIS:SWREG, your registration will 
  1470. be sent to you via CIS mail, along with instructions on how to serialize your 
  1471. copy of EXC.  This usually involves one day or less turnaround.
  1472.     
  1473.     Program diskettes are not normally shipped.  Normal distribution is via 
  1474. CompuServe.  If you need a diskette, please see the instructions under Support 
  1475. above, or use the order form below.  You will receive a serial number and 
  1476. instructions for serializing your copy of the program.
  1477.     
  1478.     Each license gives you or your company a single use permit for EXC.  It is 
  1479. not restricted to a single machine as long as no two users can be simul-
  1480. taneously using the program.  As Borland says, "treat it like a book."  As an 
  1481. example, if you register EXC for your home computer, but during the day you 
  1482. use a portable or a computer at work,  you may keep EXC on both machines as 
  1483. long as no one is at home using it on your home computer.
  1484.  
  1485.     LAN licenses grant rights to all workstations on the same physical LAN.  If 
  1486. internetworking, a license must exist for each file server that contains a 
  1487. copy of EXC.EXE.  If two or more file servers exist on a single LAN strictly 
  1488. for mirroring data and fault-tolerance, these will be counted as a single 
  1489. file server for licensing purposes.  If in doubt, contact me.  We can work 
  1490. out an agreement.
  1491.  
  1492.     Site licensing is also available on a negotiated price basis.  I guarantee
  1493. it will be an economical alternative to buying licenses for each user.
  1494.  
  1495.     You may freely distribute the original EXC.ZIP file in any way you see
  1496. fit other than selling it.  Users' groups and shareware distribution services
  1497. may charge a reasonable fee for the medium and duplication costs.  Bulletin 
  1498. boards may not charge additional fees for downloading this specific program, 
  1499. other than normal connect-time and/or membership charges.
  1500.  
  1501.     You are NOT licensed to give anyone your serial number unless you first
  1502. remove all serialization from your computer.  You may then no longer use that
  1503. serial number.  Only Parity Solutions has the authority to issue serial
  1504. numbers.
  1505.  
  1506.     Modification of EXC.EXE in any manner is prohibited and unlawful.
  1507.  
  1508. ==============================================================================
  1509.                 
  1510.                            ORDER FORM FOR EXC
  1511.  
  1512. Send checks payable to:
  1513.  
  1514.   Parity Solutions                 After 10/31/93, send to:
  1515.   1105 Burgess Court               1903 Pavia Court
  1516.   Arlington, TX 76015              Arlington, TX 76006
  1517.  
  1518.  
  1519.  
  1520. BILLING ADDRESS:                        SHIP TO (If different):
  1521.  
  1522. NAME:    _____________________________  NAME:      ___________________________
  1523.       
  1524. COMPANY: _____________________________  COMPANY: _____________________________
  1525.  
  1526. STREET:  _____________________________  STREET:  _____________________________
  1527.  
  1528.          _____________________________           _____________________________ 
  1529.         
  1530. CITY/ST: _____________________________  CITY/ST: _____________________________
  1531.  
  1532. ZIP/POSTAL CODE: _____________________  ZIP/POSTAL CODE: _____________________
  1533.  
  1534. COUNTRY: _____________________________  COUNTRY: _____________________________
  1535.  
  1536. PHONE:   _____________________________  PHONE:   _____________________________
  1537.  
  1538.  
  1539. CompuServe ID: _______________________(Optional)
  1540.  
  1541.  
  1542.    NOTE: Parity Solutions sends a serial number for each registration and 
  1543.          instructions for serializing your program.  A diskette containing
  1544.          the latest releases of all Parity Solutions shareware products is
  1545.          available for $5.00 U.S.  The current release of EXC is available
  1546.          for downloading on CompuServe in the IBMSYS forum.
  1547.  
  1548.  
  1549.    QTY   DESCRIPTION                             PRICE EA.   TOTAL PRICE
  1550.  
  1551.    ___   EXC license and registration              $30.00    ___________
  1552.  
  1553.    ___   EXC Network license and registration       45.00    ___________
  1554.  
  1555.    ___   Parity Solutions shareware diskette         5.00    ___________
  1556.  
  1557.          Postage for internationa orders outside     1.00    ___________
  1558.          the U.S., Canada and Mexico.
  1559.  
  1560.                              
  1561.                                           Total Enclosed:    ___________
  1562.  
  1563.  
  1564. Diskette size (if ordered): __ 5.25" 360k  __ 5.25" 1.2M  __ 3.5" 760k
  1565.  
  1566.  
  1567. Thank you for doing business with Parity Solutions.  (817) 467-7818
  1568. ==============================================================================
  1569.  
  1570.