home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR4 / PTM229A.ZIP / PHANTOM.DOC < prev    next >
Text File  |  1993-11-23  |  134KB  |  4,464 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.                                 DOS Phantom
  26.  
  27.  
  28.  
  29.                                 Users Guide
  30.  
  31.  
  32.  
  33.                            DOS Phantom V2.9 Users Guide
  34.  
  35.  
  36.  
  37.  
  38.  
  39.            PUBLISHED BY
  40.  
  41.  
  42.            P2 Enterprises
  43.            P.O. Box 25
  44.            Ben Lomond CA 95005-0025
  45.  
  46.  
  47.  
  48.            Copyright (c) 1992 by P2 Enterprises.  All Rights Reserved.
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.                                          _______
  66.                                     ____|__     |               (tm)
  67.                                  --|       |    |-------------------
  68.                                    |   ____|__  |  Association of
  69.                                    |  |       |_|  Shareware
  70.                                    |__|   o   |    Professionals
  71.                                  -----|   |   |---------------------
  72.                                       |___|___|    MEMBER
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.                                     ii
  89.  
  90.  
  91.  
  92.                            DOS Phantom V2.9 Users Guide
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.                                  Contents
  103.  
  104.  
  105.  
  106.  
  107.         1. What Is DOS Phantom?..................................1
  108.         1.1. What is DOS Phantom Good For?.......................2
  109.         1.1.1. Recovery from Power Failures......................2
  110.         1.1.2. A Batch Substitute................................3
  111.         1.1.3. Keystroke Macros..................................3
  112.         1.1.4. Program Startup...................................3
  113.         1.1.5. Automatic Execution...............................3
  114.         1.1.6. Demos.............................................4
  115.         1.1.7. Software Testing..................................4
  116.         1.1.8. Applications Integration..........................4
  117.  
  118.         2. What is Shareware?....................................6
  119.  
  120.         3. Using DOS Phantom.....................................7
  121.         3.1. Before You Begin....................................7
  122.         3.2. The DOS Phantom Command Line........................8
  123.         3.2.1. Basic Command Switches............................8
  124.         3.2.2. Other Command Switches............................9
  125.         3.3. Recording and Playing Back.........................10
  126.         3.4. Pausing............................................11
  127.         3.5. Quick Playback - The /Q Switch.....................12
  128.         3.6. Looping Playback - The /L Switch...................12
  129.         3.7. The DOS Phantom Control Panel......................12
  130.         3.8. Changing The Hot Keys..............................14
  131.         3.9. Increasing Shell Environment Space - The /E Switch.16
  132.         3.10. Making DOS Phantom Memory Resident - The /I Switch16
  133.         3.11. Removing DOS Phantom From Memory - The /U Switch..16
  134.         3.12. Using The /O Switch...............................17
  135.         3.13. The Disk Write Trigger Value - The /T Switch......17
  136.         3.14. Autonomous Mode - the /N Switch...................18
  137.  
  138.         4. Using Hot Keys To Start Playbacks....................19
  139.  
  140.         5. Scheduling Recordings for Later Playback.............21
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.                                     iii
  148.  
  149.  
  150.  
  151.                            DOS Phantom V2.9 Users Guide
  152.  
  153.  
  154.  
  155.         6. Converting ASCII Text Files for Playback.............24
  156.  
  157.         7. The P2FLUSH Program..................................26
  158.  
  159.         8. Scraper..............................................27
  160.  
  161.         9. Editing DOS Phantom Recordings.......................30
  162.         9.1. Eliminating Help Text..............................34
  163.         9.2. DOS Phantom Directives.............................34
  164.         9.2.1. $PAUSE, $WAIT, and $SLEEP - Programmed Pauses....34
  165.         9.2.2. Ending Pauses - $ResumeKey.......................36
  166.         9.2.3. Substitution Parameters..........................36
  167.         9.2.4. Compressed Mode..................................37
  168.         9.2.5. Pop-Up Displays..................................38
  169.         9.2.6. Labels and the $GOTO Directive...................41
  170.         9.2.7. Pop-Up Menus.....................................41
  171.         9.2.8. The $IfKey Directive.............................45
  172.         9.2.9. Programmed Screen Capture........................47
  173.         9.2.10. Programmed Print Capture........................48
  174.         9.2.11. Pacing..........................................48
  175.         9.2.12. Matching Screen Text............................49
  176.         9.2.13. Waiting for Program Exit........................51
  177.         9.2.14. Detecting Exit Status...........................52
  178.         9.2.15. Disabling Keyboard Input - $DisableKybd.........53
  179.         9.2.16. Flushing the Typeahead Buffer - $FlushTypAhd....54
  180.         9.2.17. Disabling Ctl-Alt-Del...........................54
  181.         9.2.18. Programmed Reboots - $Reboot....................54
  182.         9.2.19. Retaining Keyboard Flags - $RetainKybdFlags.....54
  183.         9.2.20. Using the $SETMODE Directives...................55
  184.         9.2.21. String Variables................................56
  185.         9.2.22. Working with Files..............................57
  186.         9.2.23. Substrings - The $F Directives..................59
  187.         9.2.24. Iterated Looping - the $On Directive............61
  188.         9.2.25. Playing Music - The $Music Directive............62
  189.         9.3. Hints and Tips.....................................62
  190.         9.3.1. Interrupting Directive Execution.................62
  191.         9.3.2. Recovering Editing Sessions......................63
  192.         9.3.3. Using DOS Phantom in Batch Files.................63
  193.         9.3.4. Playback Chaining................................63
  194.         9.3.5. Don't Use the Mouse..............................63
  195.  
  196.         10. DOS Phantom Technical Information...................64
  197.         10.1. DOS Version Requirements..........................64
  198.         10.2. Memory Usage......................................64
  199.  
  200.         11. License, Warranty, Registration, and Support........65
  201.  
  202.  
  203.  
  204.  
  205.  
  206.                                     iv
  207.  
  208.  
  209.  
  210.                            DOS Phantom V2.9 Users Guide
  211.  
  212.  
  213.  
  214.         11.1. License...........................................65
  215.         11.2. Limited Warranty..................................66
  216.         11.2.1. Government Restricted Rights....................67
  217.         11.3. Registration......................................67
  218.         11.4. Support...........................................68
  219.         11.4.1. P2 Technical Support............................68
  220.         11.4.2. The P2 Enterprises Customer Service BBS.........68
  221.         11.4.3. The ASP Ombudsman...............................69
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.                                      v
  266.  
  267.  
  268.  
  269.                            DOS Phantom V2.9 Users Guide
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.                           1. What Is DOS Phantom?
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.            DOS Phantom is a full-featured task automator and application
  292.            integration tool which can perform a large  number of functions
  293.            to make life with your computer easier and more efficient.
  294.  
  295.            DOS Phantom can be used to make a group of separate application
  296.            programs work together to perform a task automatically.
  297.  
  298.            DOS Phantom does the following:
  299.  
  300.                   o  Records and plays back keystrokes either with the
  301.                      original delays between keystrokes or at high speed.
  302.  
  303.                   o  Provides unlimited recording length (actually limited
  304.                      by the amount of available disk space).
  305.  
  306.                   o  Allows the definition of up to 16 hot keys to start
  307.                      playback of specific recordings with a single
  308.                      keystroke.
  309.  
  310.                   o  Allows scheduling of playback on a daily, weekly, or
  311.                      once-only basis. Up to 32 different scheduled events
  312.                      may be defined.
  313.  
  314.                   o  Provides the ability to edit recordings,
  315.  
  316.                   o  Provides the ability to add pop-up displays and pop-
  317.                      up menus to recordings,
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                                      1
  325.  
  326.  
  327.  
  328.                            DOS Phantom V2.9 Users Guide
  329.  
  330.  
  331.  
  332.                   o  Provides the ability to wait during playback for a
  333.                      certain character sequence to appear on the screen,
  334.  
  335.                   o  Provides the ability to wait during playback for a
  336.                      program to exit and detect whether a success or error
  337.                      status was returned,
  338.  
  339.                   o  Captures the screen contents and writes it to a file
  340.                      at the press of a hot key or as directed by the
  341.                      contents of a recording file,
  342.  
  343.                   o  Captures output destined for the printer and writes
  344.                      it to a file (can be turned on and off from within a
  345.                      recording file),
  346.  
  347.                   o  Can read and write files from within a playback,
  348.  
  349.                   o  Can copy screen text and write it to a file,
  350.  
  351.                   o  Can copy screen text from one application and use it
  352.                      as keyboard input to another, and
  353.  
  354.                   o  Play music.
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.         1.1. What is DOS Phantom Good For?
  363.  
  364.  
  365.  
  366.         1.1.1. Recovery from Power Failures
  367.  
  368.            Because DOS Phantom writes your recorded keystrokes to the disk
  369.            after every 32 keystrokes, if you were recording when your
  370.            system failed, you can just playback the recording file,
  371.            recovering everything except perhaps the last 31 keystrokes.
  372.            This can be tremendously useful during long editing sessions,
  373.            eliminating the need to periodically save your work to avoid
  374.            losing it in a system crash.
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.                                      2
  384.  
  385.  
  386.  
  387.                            DOS Phantom V2.9 Users Guide
  388.  
  389.  
  390.  
  391.            You can even change the number of keystrokes which triggers the
  392.            write to the disk and set it as low as one keystroke, although
  393.            this can generate a inordinate amount of disk activity.
  394.  
  395.  
  396.  
  397.         1.1.2. A Batch Substitute
  398.  
  399.            DOS Phantom can be used in place of simple batch files,
  400.            eliminating the need to prepare the batch files with an editor
  401.            -- You just show DOS Phantom what you want done, and DOS
  402.            Phantom can do it for you after that. You can even edit your
  403.            DOS Phantom recordings if you make a mistake during the
  404.            recording. You can also perform parameter substitution similar
  405.            to that available with MS-DOS batch files.
  406.  
  407.  
  408.  
  409.         1.1.3. Keystroke Macros
  410.  
  411.            Using the HOTFILE program (included with DOS Phantom),
  412.            recording files can be assigned to hot keys, allowing the
  413.            entire recording to be played back with a single keystroke. Up
  414.            to 16 hotkeys can be defined. The hotkeys work even when you're
  415.            running a program.
  416.  
  417.  
  418.  
  419.         1.1.4. Program Startup
  420.  
  421.            DOS Phantom can be used to automatically supply input to
  422.            programs which expect to receive keyboard input (programs such
  423.            as spreadsheets and others). It can thus be used to perform a
  424.            sequence of "startup" commands which you would otherwise have
  425.            to type each time you run the program.
  426.  
  427.  
  428.  
  429.         1.1.5. Automatic Execution
  430.  
  431.            You might record the keystrokes to run your spreadsheet, load
  432.            current stock quotes, print a graph, and exit. You only have to
  433.            do it once; DOS Phantom can do it after that. And you can start
  434.            it all with a single keystroke!
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.                                      3
  443.  
  444.  
  445.  
  446.                            DOS Phantom V2.9 Users Guide
  447.  
  448.  
  449.  
  450.            DOS Phantom can be used to automate access to systems such as
  451.            Prodigy which normally require your presence at the keyboard.
  452.            Record the keystrokes that you use to dial Prodigy and print
  453.            headline news and current stock quotations. Then have your
  454.            computer wake up early and call Prodigy. You can have the
  455.            latest information printed and waiting for you to peruse with
  456.            your morning coffee.
  457.  
  458.  
  459.  
  460.         1.1.6. Demos
  461.  
  462.            DOS Phantom can be used to create a quick demonstration of a
  463.            program which can then be played back at will for prospective
  464.            users or customers. DOS Phantom can be paused automatically or
  465.            manually during playback for discussion or manual entry of data
  466.            to the program being demonstrated. In addition, pop-up windows
  467.            can be displayed to explain what is happening in the demo, and
  468.            menus can be presented to allow the user to guide the course of
  469.            the demo.  Automatic timeouts when user response is required
  470.            and a looping playback feature allow DOS Phantom-based demos to
  471.            run continuously and unattended and yet allow users to interact
  472.            with the demonstration if they wish.
  473.  
  474.  
  475.  
  476.         1.1.7. Software Testing
  477.  
  478.            DOS Phantom can be used to record tests of software which is
  479.            undergoing revision. Then, the tests can be run after the
  480.            revisions are complete to be sure what worked before the
  481.            revisions were done still works after the revisions. Screen
  482.            contents can be written to a file at strategic points during
  483.            the execution of the program and printer output can be captured
  484.            as well. This allows the output of the program to compared with
  485.            earlier test runs to detect differences.
  486.  
  487.  
  488.  
  489.         1.1.8. Applications Integration
  490.  
  491.            DOS Phantom can be used as the "glue" to marry a collection of
  492.            disparate programs into a complete package to solve a problem.
  493.            For example, the shareware product QuickPro Retriever uses DOS
  494.            Phantom to automatically update investment prices in Quicken (a
  495.            finance management program from Intuit) with information from
  496.  
  497.  
  498.  
  499.  
  500.  
  501.                                      4
  502.  
  503.  
  504.  
  505.                            DOS Phantom V2.9 Users Guide
  506.  
  507.  
  508.  
  509.            Prodigy's on-line stock market quote facility. DOS Phantom's
  510.            ability to search out text on the screen and verify termination
  511.            status of programs gives it a significant advantage over "blind
  512.            playback" utilities which blithely continue delivering
  513.            keystrokes even when the programs they are running have gone
  514.            awry.
  515.  
  516.            The Scraper TSR (supplied with DOS Phantom) works with DOS
  517.            Phantom to allow copying text displayed on the screen by one
  518.            program and supplying it later as input to another program. Up
  519.            to nine text strings can be be copied from the screen and
  520.            stored for later playback. Scraper allows you to select the
  521.            text and play it back while DOS Phantom is recording. Then,
  522.            when you play the Phantom recording back, Scraper goes through
  523.            the same motions. This eliminates the necessity of specifying
  524.            screen coordinates and lengths for the copy operation as is
  525.            required in some other packages.
  526.  
  527.            The strings copied from the screen by Scraper are also
  528.            available from within the Phantom playback file, so you can
  529.            write them to a file, compare them with other strings, extract
  530.            substrings from them and perform other programmatic operations
  531.            using DOS phantom's powerful script language.
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.                                      5
  561.  
  562.  
  563.  
  564.                            DOS Phantom V2.9 Users Guide
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.                            2. What is Shareware?
  579.  
  580.  
  581.  
  582.  
  583.  
  584.            Shareware distribution gives users a chance to try software
  585.            before buying it. If you try a shareware program and continue
  586.            using it, you are expected to register. Individual programs
  587.            differ on details -- some request registration while others
  588.            require it, some specify a maximum trial period. With
  589.            registration, you get anything from the simple right to
  590.            continue using the software to an updated program with printed
  591.            manual.
  592.  
  593.            Copyright laws apply to both Shareware and commercial software,
  594.            and the copyright holder retains all rights, with a few
  595.            specific exceptions as stated below. Shareware authors are
  596.            accomplished programmers, just like commercial authors, and the
  597.            programs are of comparable quality. (In both cases, there are
  598.            good programs and bad ones!) The main difference is in the
  599.            method of distribution. The author specifically grants the
  600.            right to copy and distribute the software, either to all and
  601.            sundry or to a specific group. For example, some authors
  602.            require written permission before a commercial disk vendor may
  603.            copy their Shareware.
  604.  
  605.            Shareware is a distribution method, not a type of software. You
  606.            should find software that suits your needs and pocketbook,
  607.            whether it's commercial or Shareware. The Shareware system
  608.            makes fitting your needs easier, because you can try before you
  609.            buy. And because the overhead is low, prices are low also.
  610.            Shareware has the ultimate money-back guarantee -- if you don't
  611.            use the product, you don't pay for it.
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.                                      6
  620.  
  621.  
  622.  
  623.                            DOS Phantom V2.9 Users Guide
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.                            3. Using DOS Phantom
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.         3.1. Before You Begin
  646.  
  647.            Before using DOS Phantom, we recommend that you create a
  648.            directory for your recording files and set the PHANTOMDIR
  649.            environment variable to point to it. Assuming that you want to
  650.            store your recording files in C:\PHANTOM, here is the command
  651.            to create the directory and set the PHANTOMDIR environment
  652.            variable appropriately:
  653.  
  654.  
  655.                    C:\> MKDIR PHANTOM
  656.                    C:\> SET PHANTOMDIR=C:\PHANTOM
  657.  
  658.  
  659.            You should place the second command above in your AUTOEXEC.BAT
  660.            file so that the PHANTOMDIR environment variable gets set each
  661.            time you boot your computer.
  662.  
  663.            The environment variable PHANTOMDIR is used by DOS Phantom to
  664.            determine where to place playback files and by the HOTFILE and
  665.            SCHEDULE programs to determine where to store their data files
  666.            and where to find playback files.
  667.  
  668.            Once PHANTOMDIR is defined, DOS Phantom expects to place all
  669.            recording files there. You should not include disk or directory
  670.            information in the filenames you supply DOS Phantom for
  671.            recording or playback.
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.                                      7
  679.  
  680.  
  681.  
  682.                            DOS Phantom V2.9 Users Guide
  683.  
  684.  
  685.  
  686.            You may wish to place the DOS Phantom executable files
  687.            (PHANTOM2.EXE, TXT2PTM.EXE, PTM2TXT.PTM, HOTFILE.EXE,
  688.            SCHEDULE.EXE, P2FLUSH.EXE, and SCRAPER.EXE in the same
  689.            directory. If you do this, add the PHANTOMDIR directory to the
  690.            PATH definition in your AUTOEXEC.BAT file. (You may change the
  691.            names of the .EXE files with the DOS REN command to eliminate
  692.            conflicts with names of other products' programs or just to
  693.            make them easier to type.)
  694.  
  695.            Here's how your PATH definition might appear before you add the
  696.            PHANTOM directory to it:
  697.  
  698.            PATH=C:\DOS;C:\WINDOWS;C:\
  699.  
  700.            The path consists of a list of DOS directories separated by
  701.            semicolons. When you type the name of a program at the DOS
  702.            prompt, if it can't find a file by that name in the current
  703.            directory, DOS searches the directories in the path in the
  704.            order they are listed.
  705.  
  706.            Here's how the example PATH statement above might be changed to
  707.            incorporate the PHANTOM directory:
  708.  
  709.            PATH=C:\DOS;C:\WINDOWS;C:\PHANTOM;C:\
  710.  
  711.  
  712.  
  713.         3.2. The DOS Phantom Command Line
  714.  
  715.  
  716.  
  717.         3.2.1. Basic Command Switches
  718.  
  719.            DOS Phantom accepts the following basic command line switches:
  720.  
  721.              /P      Playback
  722.  
  723.              /R      Record
  724.  
  725.              /Q      Quick Playback
  726.  
  727.              /L      Looping Playback
  728.  
  729.              /I      Install as a Memory Resident Program
  730.  
  731.              /U      Un-install DOS Phantom from memory
  732.  
  733.  
  734.  
  735.  
  736.  
  737.                                      8
  738.  
  739.  
  740.  
  741.                            DOS Phantom V2.9 Users Guide
  742.  
  743.  
  744.  
  745.            3.2.2. Other Command Switches
  746.  
  747.            In addition, the following command line switches are also
  748.            available:
  749.  
  750.              /K      Attention Hot Key Selection
  751.  
  752.              /A      Abort Hot Key Selection
  753.  
  754.              /D      Screen Capture Hot Key
  755.  
  756.              /S      Toggle Sounds
  757.  
  758.              /-S     Disable Sounds
  759.  
  760.              /M      Toggle Mode Display
  761.  
  762.              /-M     Disable Mode Display
  763.  
  764.              /C      Disable use of Color
  765.  
  766.              /O      Include Screen Output Records in Recordings
  767.  
  768.              /V      Print Capture File Specification
  769.  
  770.              /F      Screen Capture File Selection
  771.  
  772.              /E      Sets environment space in shells spawned by Phantom
  773.  
  774.              /Z      Suppresses all DOS Phantom-generated output 
  775.                      (copyright notices, etc.)
  776.  
  777.              /T      Set trigger count for disk writes when recording
  778.  
  779.              /B      Set Scraper hot key
  780.  
  781.              /N      Enable Autonomous Mode
  782.  
  783.  
  784.  
  785.            Here's an example of a DOS Phantom command to begin recording
  786.            and create the file RECORDNG.PTM:
  787.  
  788.                 PHANTOM2 /R RECORDNG.PTM
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.                                      9
  797.  
  798.  
  799.  
  800.                            DOS Phantom V2.9 Users Guide
  801.  
  802.  
  803.  
  804.            Here's the command to play back those keystrokes:
  805.  
  806.                 PHANTOM2 /P RECORDNG.PTM
  807.  
  808.  
  809.  
  810.            3.3. Recording and Playing Back
  811.  
  812.            DOS Phantom normally creates a new command shell when you start
  813.            recording. (The /I switch can be used to make DOS Phantom
  814.            install itself as a TSR instead.) DOS Phantom will record
  815.            everything you type until you exit the shell by typing EXIT at
  816.            the DOS command prompt. Here's an example of recording a DIR
  817.            command followed by a playback of the recording:
  818.  
  819.            Record the keystrokes:
  820.  
  821.  
  822.             C:\> PHANTOM2 /R RECORDNG.PTM
  823.             DOS Phantom V2.9 123456 Copyright (c) 1992...blah...blah...
  824.  
  825.             Press ALT-P to pause or resume recording.
  826.             Press ALT-P twice in succession to activate the control panel.
  827.             Type EXIT at the DOS prompt when done.
  828.  
  829.             C:\> DIR
  830.                   ...blah blah blah...
  831.             C:\> EXIT
  832.             DOS Phantom terminated.
  833.  
  834.  
  835.  
  836.            Now play them back:
  837.  
  838.  
  839.             C:\> PHANTOM2 /P RECORDING.PTM
  840.             DOS Phantom V2.9 123456 Copyright (c) 1992...blah...blah...
  841.  
  842.             Press ALT-P to pause or resume playback.
  843.             Press ALT-P twice in succession to activate the control panel.
  844.             Type EXIT at the DOS prompt when done.
  845.  
  846.             C:\> DIR
  847.                  ...blah blah blah...
  848.             C:\> EXIT
  849.             DOS Phantom terminated.
  850.  
  851.  
  852.  
  853.  
  854.  
  855.                                     10
  856.  
  857.  
  858.  
  859.                            DOS Phantom V2.9 Users Guide
  860.  
  861.  
  862.  
  863.  
  864.  
  865.            While DOS Phantom was running, it placed a small display in the
  866.            upper right corner of the screen showing what it was doing. In
  867.            the example above, the display showed either "Record" or
  868.            "Play". If you don't want the mode display, just include the /M
  869.            switch on the command line, like this:
  870.  
  871.                 C:\> PHANTOM2 /P /M RECORDNG.PTM
  872.  
  873.  
  874.  
  875.            Note that the /M switch is a "toggle", meaning that if the
  876.            feature is on it is turned off, and if it is off it is turned
  877.            on. To unconditionally set the mode display off, use /-M.
  878.  
  879.  
  880.  
  881.            3.4. Pausing
  882.  
  883.            If you press the hot key (ALT-P unless you change it with /K on
  884.            the command line) during record or playback, after a brief
  885.            delay, DOS Phantom will play a series of tones falling in pitch
  886.            to indicate its transition to PAUSE mode. The mode display, if
  887.            enabled, will change to "Pause". A second depression of the hot
  888.            key resumes the recording or playback, accompanied by a series
  889.            of rising tones indicating the transition out of PAUSE mode.
  890.  
  891.            If you are playing back, playback stops while you are in PAUSE
  892.            mode. If you are recording, the keys you press while paused are
  893.            not recorded, nor is the time which passes while in PAUSE mode
  894.            recorded.
  895.  
  896.            You can disable the sounds by including the /S switch on the
  897.            DOS Phantom command line, like this:
  898.  
  899.                 C:\> PHANTOM2 /R /S RECORDNG.PTM
  900.  
  901.  
  902.            Note that the /S switch is a "toggle", meaning that if the
  903.            feature is on it is turned off, and if it is off it is turned
  904.            on. To unconditionally set the sounds off, use /-S.
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.                                     11
  915.  
  916.  
  917.  
  918.                            DOS Phantom V2.9 Users Guide
  919.  
  920.  
  921.  
  922.            3.5. Quick Playback - The /Q Switch
  923.  
  924.            DOS Phantom normally plays back recordings at the same speed at
  925.            which they were recorded. The /Q switch forces DOS Phantom to
  926.            playback as quickly as possible. Note that some programs "eat"
  927.            characters if they are delivered too fast. DOS Phantom's
  928.            "demand playback" feature, introduced in V1.3, eliminates most
  929.            problems in this area, but some programs, notably Prodigy, may
  930.            still eat characters occasionally. For Prodigy and other
  931.            programs which still appear to eat characters, edit your
  932.            recording to use the $SetMode Func6 and $SetMode Normal
  933.            directives as described later in the section on editing DOS
  934.            Phantom recordings if you wish to use quick playback with those
  935.            programs.
  936.  
  937.            You can alter the intervals between individual keystrokes to
  938.            speed up some sections of a recording and slow down others by
  939.            editing the recording file. See the section later in this
  940.            document on editing DOS Phantom recordings for details.
  941.  
  942.  
  943.  
  944.            3.6. Looping Playback - The /L Switch
  945.  
  946.            If you supply the /L switch on the command line, DOS Phantom
  947.            will rewind when it reaches the end of the recording and play
  948.            the same recording file over and over until you pause it by
  949.            pressing the attention hot key. If DOS Phantom is memory-
  950.            resident (see below), you must close the recording file to
  951.            avoid the continuation of looping when you press the hot key
  952.            again. If DOS Phantom is not memory-resident, then you must
  953.            type EXIT at the DOS prompt.
  954.  
  955.            Looping can be a valuable tool in continuously-running
  956.            demonstrations or in stress-testing software systems. Not that
  957.            looping playback may also be accomplished using the $Goto and
  958.            $On directives in the recording file. See the section on
  959.            editing recording files for more information.
  960.  
  961.  
  962.  
  963.            3.7. The DOS Phantom Control Panel
  964.  
  965.            If you hit the hot key twice within about a half second, the
  966.            pop-up control panel is triggered, and is displayed over
  967.            whatever was already on the screen.
  968.  
  969.  
  970.  
  971.  
  972.  
  973.                                     12
  974.  
  975.  
  976.  
  977.                            DOS Phantom V2.9 Users Guide
  978.  
  979.  
  980.  
  981.            To remove the control panel without taking any action, press
  982.            the Esc key.
  983.  
  984.            Note that if your screen is in graphics mode, the screen may
  985.            not be restored to its original condition when you leave the
  986.            control panel, or the control panel may not appear at all.
  987.  
  988.            Here is what the control panel looks like:
  989.  
  990.  
  991.             +----------------------------------------------------+
  992.             |                    DOS Phantom                 V2.9|
  993.             +----------------------------------------------------+
  994.             |                                                    |
  995.             |  +---------+ +---------+ +---------+ +--------+    |
  996.             |  |         | |         | |         | |        |    |
  997.             |  | PLAY    | | QPLAY   | | RECORD  | | CLOSE  |    |
  998.             |  |         | |         | |         | |        |    |
  999.             |  +---------+ +---------+ +---------+ +--------+    |
  1000.             |                                                    |
  1001.             |  Sound On   Mode Display On  Loop Mode Off         |
  1002.             |                                                    |
  1003.             |  Filename: RECORDNG.PTM                            |
  1004.             |                                                    |
  1005.             +----------------------------------------------------+
  1006.  
  1007.  
  1008.  
  1009.            You can highlight the selection of your choice using the arrow,
  1010.            tab, or spacebar keys and press RETURN to execute it or you can
  1011.            press the key corresponding to the first letter of your
  1012.            selection.
  1013.  
  1014.            If you press R, P, or Q, the menu is immediately erased, and
  1015.            DOS Phantom begins executing your command. CLOSE closes an open
  1016.            recording file. This is the only way to close a recording file
  1017.            during recording or playback when DOS Phantom is memory-
  1018.            resident (i.e., installed with the /I command line switch). The
  1019.            Sound, Mode Display, and Loop Mode selections toggle the
  1020.            sounds, mode display, and looping on and off.
  1021.  
  1022.            Selecting Filename allows you to change the recording filename.
  1023.            When you have finished entering the filename, press RETURN. To
  1024.            change an existing filename, just type over it and overwrite
  1025.            any unwanted characters with the space bar.
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.                                     13
  1033.  
  1034.  
  1035.  
  1036.                            DOS Phantom V2.9 Users Guide
  1037.  
  1038.  
  1039.  
  1040.            Pressing the ESC key erases the menu without starting a
  1041.            recording or playback session.
  1042.  
  1043.  
  1044.  
  1045.         3.8. Changing The Hot Keys
  1046.  
  1047.            There are four hot keys used by DOS Phantom. By default, two of
  1048.            them are disabled (set to the key NONE). The four hot keys are:
  1049.  
  1050.                   o  The attention hot key - This is by default set to
  1051.                      Alt-P and is used to pause and resume recordings, and
  1052.                      to cause display of the DOS Phantom control panel as
  1053.                      described earlier. The /K command line switch is used
  1054.                      to change the attention hot key to another key or to
  1055.                      disable it.
  1056.  
  1057.                   o  The screen capture hot key - This key is by default
  1058.                      disabled. When it is defined with the /D command,
  1059.                      pressing it at any time causes DOS Phantom to write a
  1060.                      copy of the screen to the file specified with the /F
  1061.                      command line switch. If no file was specified with
  1062.                      /F, the default file SCREEN.TXT is used.
  1063.  
  1064.                   o  The abort hot key - The abort hot key, when defined
  1065.                      with the /A command line switch, causes immediate
  1066.                      termination of playback. In addition, the abort key
  1067.                      is passed on to the program which is running (or the
  1068.                      DOS command processor if no program is running). This
  1069.                      is not true of the other hot keys -- they are "eaten"
  1070.                      by DOS Phantom. The most common abort hot key is
  1071.                      Ctrl-C. This allows a single keystroke to both
  1072.                      terminate playback and the program running.
  1073.  
  1074.                   o  The Scraper hot key - The Scraper hot key (by default
  1075.                      Alt-S) activates the Scraper program. See the section
  1076.                      on Scraper for information about the Scraper program.
  1077.                      The Scraper hot key is automatically disabled
  1078.                      whenever Scraper is not installed. The Scraper hot
  1079.                      key is set with the /B command line switch.
  1080.  
  1081.  
  1082.  
  1083.            Here's how you would change the attention hot key to F10:
  1084.  
  1085.                 C:\> PHANTOM2 /K=F10 /R RECORDNG.PTM
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.                                     14
  1092.  
  1093.  
  1094.  
  1095.                            DOS Phantom V2.9 Users Guide
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.            Here is a list of all the acceptable hot keys which you can
  1102.            specify with /K, /D, /A, and /B:
  1103.  
  1104.  
  1105.             SHFT-TAB    ALT-Q      ALT-W      ALT-E
  1106.             ALT-R       ALT-T      ALT-Y      ALT-U
  1107.             ALT-I       ALT-O      ALT-P      ALT-A
  1108.             ALT-S       ALT-D      ALT-F      ALT-G
  1109.             ALT-H       ALT-J      ALT-K      ALT-L
  1110.             ALT-Z       ALT-X      ALT-C      ALT-V
  1111.             ALT-B       ALT-N      ALT-M      F1
  1112.             F2          F3         F4         F5
  1113.             F6          F7         F8         F9
  1114.             F10         HOME       UP         PGUP
  1115.             LEFT        RIGHT      END        DOWN
  1116.             GDWN        INSERT     DELETE     SHFT-F1
  1117.             SHFT-F2     SHFT-F3    SHFT-F4    SHFT-F5
  1118.             SHFT-F6     SHFT-F7    SHFT-F8    SHFT-F9
  1119.             SHFT-F10    CTRL-F1    CTRL-F2    CTRL-F3
  1120.             CTRL-F4     CTRL-F5    CTRL-F6    CTRL-F7
  1121.             CTRL-F8     CTRL-F9    CTRL-F10   ALT-F1
  1122.             ALT-F2      ALT-F3     ALT-F4     ALT-F5
  1123.             ALT-F6      ALT-F7     ALT-F8     ALT-F9
  1124.             ALT-F10     CTRL-LEFT  CTRL-RIGHT CTRL-END
  1125.             CTRL-PGDWN  CTRL-HOME  ALT-1      ALT-2
  1126.             ALT-3       ALT-4      ALT-5      ALT-6
  1127.             ALT-7       ALT-8      ALT-9      ALT-0
  1128.             ALT--       ALT-=      CTRL-PGUP  CTRL-A
  1129.             CTRL-B      CTRL-C     CTRL-D     CTRL-E
  1130.             CTRL-F      CTRL-G     CTRL-H     CTRL-I
  1131.             CTRL-J      CTRL-K     CTRL-L     CTRL-M
  1132.             CTRL-N      CTRL-O     CTRL-P     CTRL-Q
  1133.             CTRL-R      CTRL-S     CTRL-T     CTRL-U
  1134.             CTRL-V      CTRL-W     CTRL-X     CTRL-Y
  1135.             CTRL-Z      ESC        F11        F12
  1136.             SHFT-F11    SHFT-F12   CTRL-F11   CTRL-F12
  1137.             ALT-F11     ALT-F12    NONE
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.                                     15
  1151.  
  1152.  
  1153.  
  1154.                            DOS Phantom V2.9 Users Guide
  1155.  
  1156.  
  1157.  
  1158.            3.9. Increasing Shell Environment Space - The /E Switch
  1159.  
  1160.            The /E command line switch is used to increase the environment
  1161.            space for the command shell spawned when DOS Phantom is not
  1162.            executed as a TSR. For example, to set the environment space to
  1163.            4096 bytes for playback of the file RECORDNG.PTM, you would use
  1164.            the following command:
  1165.  
  1166.                 PHANTOM2 /E=4096 /P RECORDNG.PTM
  1167.  
  1168.  
  1169.  
  1170.            3.10. Making DOS Phantom Memory Resident - The /I Switch
  1171.  
  1172.            If you include the /I switch on the command line, DOS Phantom
  1173.            installs itself as a TSR (Terminate and Stay Resident) program
  1174.            in memory. This method of using DOS Phantom has a number of
  1175.            benefits. Among them are lower memory utilization because no
  1176.            command shell is invoked, faster execution because no loading
  1177.            of the DOS Phantom program is required, and the ability to
  1178.            begin and end recording and playback sessions while executing
  1179.            another program.
  1180.  
  1181.            Once resident, you access DOS Phantom by pressing the hot key
  1182.            twice in succession to trigger the pop-up menu, or by issuing
  1183.            DOS Phantom commands at the DOS prompt.  If DOS Phantom is
  1184.            resident, executing Phantom commands at the DOS prompt does not
  1185.            load another copy of Phantom, even if you include the /I switch
  1186.            on the command line.
  1187.  
  1188.            You can install DOS Phantom in your AUTOEXEC.BAT file by
  1189.            including this command (assuming the directory containing
  1190.            PHANTOM2.EXE is in your PATH):
  1191.  
  1192.  
  1193.                 C:\> PHANTOM2 /I
  1194.  
  1195.  
  1196.  
  1197.  
  1198.            3.11. Removing DOS Phantom From Memory - The /U Switch
  1199.  
  1200.            The /U switch un-installs DOS Phantom from memory. When you
  1201.            execute the PHANTOM2/U command, one of two responses will be
  1202.            displayed:
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.                                     16
  1210.  
  1211.  
  1212.  
  1213.                            DOS Phantom V2.9 Users Guide
  1214.  
  1215.  
  1216.  
  1217.                   o   DOS Phantom un-installed. - This means that DOS
  1218.                       Phantom was successfully un-installed and no trace
  1219.                       of its presence remains.
  1220.  
  1221.                   o   DOS Phantom disabled. Memory not reclaimed. - This
  1222.                       means that DOS Phantom was only disabled, and is
  1223.                       dormant in memory. This is almost certainly because
  1224.                       another TSR was loaded after DOS Phantom which
  1225.                       intercepts some of the same interrupts used by DOS
  1226.                       Phantom. To remove DOS Phantom, first remove any
  1227.                       TSR's loaded after DOS Phantom, and then re-issue
  1228.                       the /U command.  In some cases, a reboot of your
  1229.                       computer may be required to remove a dormant DOS
  1230.                       Phantom.
  1231.  
  1232.  
  1233.  
  1234.            3.12. Using The /O Switch
  1235.  
  1236.            The /O command line switch causes DOS Phantom to include
  1237.            snippets of screen output in the recording file as comments.
  1238.            This is provided to aid users of the $MatchWait directive in
  1239.            creating "interactive" recordings. The use of /O significantly
  1240.            increases the size of the recording file and causes many more
  1241.            disk writes to occur during recording. Its use is discouraged
  1242.            except when you are creating a recording which you intend to
  1243.            edit to include $MatchWait directives. The only way to disable
  1244.            /O is to uninstall DOS Phantom with the /U switch if it was
  1245.            installed as a TSR or the DOS EXIT command if it wasn't.
  1246.  
  1247.            See the chapter on editing DOS Phantom recordings for
  1248.            information on the $MatchWait and related directives.
  1249.  
  1250.  
  1251.  
  1252.         3.13. The Disk Write Trigger Value - The /T Switch
  1253.  
  1254.            The command line switch /T allows you to specify a "trigger"
  1255.            value for recording file writes. Normally, DOS Phantom writes
  1256.            to the recording file after every 32 keystrokes. Using /T, you
  1257.            can specify any number of characters between 1 and 32 after
  1258.            which writes are to occur. For example, to cause the recording
  1259.            file to be updated after every character, you would include
  1260.            /T=1 on the DOS Phantom command line. Small trigger values may
  1261.            result in an undesirably large amount of disk activity.
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.                                     17
  1269.  
  1270.  
  1271.  
  1272.                            DOS Phantom V2.9 Users Guide
  1273.  
  1274.  
  1275.  
  1276.         3.14. Autonomous Mode - the /N Switch
  1277.  
  1278.            The command line switch /N places DOS Phantom in autonomous
  1279.            mode. When in autonomous mode, DOS Phantom ignores commands
  1280.            issued using the PHANTOM2.EXE program and hot keys defined
  1281.            using HOTFILE. Scheduled playbacks defined with SCHEDULE are
  1282.            honored if recording or playback is not in progress at the
  1283.            scheduled time.
  1284.  
  1285.            The following command line installs DOS Phantom in memory,
  1286.            disables the attention hot key, the mode display, and sounds,
  1287.            begins recording into the file KEYSTROK.LOG, and places DOS
  1288.            Phantom in autonomous mode. Once this is done, DOS Phantom may
  1289.            not be removed from memory using PHANTOM2 and recording cannot
  1290.            be stopped. In addition, there is no visible or audible
  1291.            indication that DOS Phantom is resident and active.
  1292.  
  1293.  
  1294.                C:\> PHANTOM2 /R/N/S/M/K=NONE/I KEYSTROK.LOG
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.                                     18
  1328.  
  1329.  
  1330.  
  1331.                            DOS Phantom V2.9 Users Guide
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.                    4. Using Hot Keys To Start Playbacks
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.            You can assign hot keys to recording files using the HOTFILE
  1352.            program. Once a hot key is assigned to a recording file,
  1353.            pressing the hot key starts playback of the file, even if you
  1354.            are running another program at the time. Of course, DOS Phantom
  1355.            must be installed at the time you press the hot key.
  1356.  
  1357.            The HOTFILE program accepts four commands: ASSIGN, LIST,
  1358.            DELETE, and KEYS.
  1359.  
  1360.            The ASSIGN command lets you assign a hot key to a file. The
  1361.            file must reside in the directory defined by the environment
  1362.            variable PHANTOMDIR. Here's an example assigning the hot key
  1363.            CTRL-B to the recording file BACKUP.PTM:
  1364.  
  1365.  
  1366.             C:\> HOTFILE ASSIGN CTRL-B BACKUP.PTM
  1367.  
  1368.  
  1369.            The LIST command displays a list of the currently defined hot
  1370.            keys and their associated playback files. Here's an example of
  1371.            the LIST command:
  1372.  
  1373.             C:\> HOTFILE LIST
  1374.             HOTFILE V2.9 123456 Copyright (c) blah, blah, blah...
  1375.  
  1376.             No  Hotkey    Playback file
  1377.             --------------------------------
  1378.              1  ALT-F10   MAIL.PTM
  1379.              2  CTRL-B    BACKUP.PTM
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.                                     19
  1387.  
  1388.  
  1389.  
  1390.                            DOS Phantom V2.9 Users Guide
  1391.  
  1392.  
  1393.  
  1394.            You can delete a hot key assignment with the DELETE command
  1395.            like this:
  1396.  
  1397.             C:\> HOTFILE DELETE CTRL-B
  1398.             HOTFILE V2.9 123456 Copyright (c) blah, blah, blah...
  1399.  
  1400.             Delete assignment of CTRL-B to file BACKUP.PTM (Y)? y
  1401.             C:\>
  1402.  
  1403.  
  1404.            The KEYS command displays a list of the hot keys you can use
  1405.            with HOTFILE. If you type HOTFILE without a command, a help
  1406.            screen is displayed.
  1407.  
  1408.            After you make changes to the hot key assignments, you do not
  1409.            need to unload and reload DOS Phantom in order for the hot keys
  1410.            to become usable. If DOS Phantom is already installed in memory
  1411.            when HOTFILE is run, HOTFILE communicates the changes to DOS
  1412.            Phantom automatically.
  1413.  
  1414.            A maximum of 16 hot key assignments may be made.
  1415.  
  1416.            All of the commands may be abbreviated to a single character.
  1417.  
  1418.            The hot key assignments are stored in a file called HOTKEYS.DAT
  1419.            in the PHANTOMDIR directory. You should not attempt to modify
  1420.            this file using any program other than HOTFILE. If you delete
  1421.            this file, all your hot key assignments will be lost.
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.                                     20
  1446.  
  1447.  
  1448.  
  1449.                            DOS Phantom V2.9 Users Guide
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.                 5. Scheduling Recordings for Later Playback
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.            The SCHEDULE program allows you to maintain a schedule of
  1470.            playbacks. Up to 32 schedule items may be created. Playbacks
  1471.            may be scheduled on a daily, weekly, or once-only basis. The
  1472.            SCHEDULE program accepts commands similar to those of the
  1473.            HOTFILE program: ASSIGN, LIST, and DELETE.
  1474.  
  1475.            The ASSIGN command assigns a playback time to a playback file.
  1476.            (The file must be present in the directory defined by the
  1477.            environment variable PHANTOMDIR.) Here are some examples of the
  1478.            ASSIGN command:
  1479.  
  1480.            Play REMINDER.PTM every day at 11:30 am:
  1481.  
  1482.             C:\> SCHEDULE ASSIGN 11:30 REMINDER.PTM
  1483.  
  1484.  
  1485.  
  1486.            Play WKLYBKUP.PTM every Friday at 10:00 pm:
  1487.  
  1488.             C:\> SCHEDULE ASSIGN Fri-22:00 WKLYBKUP.PTM
  1489.  
  1490.  
  1491.  
  1492.            Play GETMAIL.PTM at 3:00 pm on September 20, 1993:
  1493.  
  1494.  
  1495.             C:\> SCHEDULE ASSIGN 9/20/93-15:00 GETMAIL.PTM
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.                                     21
  1505.  
  1506.  
  1507.  
  1508.                            DOS Phantom V2.9 Users Guide
  1509.  
  1510.  
  1511.  
  1512.            Note that the times use a 24-hour clock and that the dash is
  1513.            required between the day of the week or the date and the time.
  1514.            Here are the abbreviations for the days of the week which
  1515.            SCHEDULE recognizes:
  1516.  
  1517.  
  1518.  
  1519.                 Sun Mon Tue Wed Thu Fri Sat
  1520.  
  1521.  
  1522.  
  1523.            Here are the pm hours of the 24-hour clock:
  1524.  
  1525.             noon 12    3pm 15    6pm 18    9pm  21    midnight 00
  1526.             1pm  13    4pm 16    7pm 19    10pm 22    1am       1
  1527.             2pm  14    5pm 17    8pm 20    11pm 23    2am       2
  1528.  
  1529.  
  1530.  
  1531.            The LIST command displays a list of the current schedule. Here
  1532.            is an example of the LIST command:
  1533.  
  1534.  
  1535.             C:\> SCHEDULE LIST
  1536.             SCHEDULE V2.9 922300 Copyright (c) 1992 blah, blah, blah...
  1537.  
  1538.             No  When           Playback file
  1539.             ------------------------------------
  1540.              1  11:30          REMINDER.PTM
  1541.              2  Fri-22:00      WKLYBKUP.PTM
  1542.              3  9/20/93-15:00  GETMAIL.PTM
  1543.  
  1544.  
  1545.  
  1546.            To remove an item from the schedule, use SCHEDULE's DELETE
  1547.            command,  specifying the date and time of the item to remove,
  1548.            like this:
  1549.  
  1550.  
  1551.                 C:\> SCHEDULE DELETE Fri-22:00
  1552.  
  1553.  
  1554.            After you make changes to the schedule, you do not need to
  1555.            unload and reload DOS Phantom in order for the changes to
  1556.            become effective. If DOS Phantom is already installed in memory
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.                                     22
  1564.  
  1565.  
  1566.  
  1567.                            DOS Phantom V2.9 Users Guide
  1568.  
  1569.  
  1570.  
  1571.            when SCHEDULE is run, SCHEDULE communicates the changes to DOS
  1572.            Phantom automatically.
  1573.  
  1574.            All of the commands may be abbreviated to a single character.
  1575.  
  1576.            The schedule information is stored in a file called
  1577.            SCHEDULE.DAT in the PHANTOMDIR directory. You should not
  1578.            attempt to modify this file using any program other than
  1579.            SCHEDULE. If you delete this file, the entire schedule will be
  1580.            lost.
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.                                     23
  1623.  
  1624.  
  1625.  
  1626.                            DOS Phantom V2.9 Users Guide
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.                 6. Converting ASCII Text Files for Playback
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.            The program MAKEPTM accepts as input any ASCII text file and
  1647.            produces as output a DOS Phantom recording file which, when
  1648.            played back, makes it appear as if the contents of the ASCII
  1649.            text file were being typed in at the keyboard.
  1650.  
  1651.            MAKEPTM allows you to specify the delay in milliseconds between
  1652.            successive characters and the delay in seconds between
  1653.            successive lines of text. If you leave off the delay times,
  1654.            delays of zero are used.
  1655.  
  1656.            Here are some examples of MAKEPTM:
  1657.  
  1658.            Convert LETTER.TXT to LETTER.PTM:
  1659.  
  1660.  
  1661.                    C:\> MAKEPTM LETTER.TXT LETTER.PTM
  1662.  
  1663.  
  1664.  
  1665.            Convert LETTER.TXT to LETTER.PTM with 100 ms delay between
  1666.            characters:
  1667.  
  1668.  
  1669.                 C:\>MAKEPTM LETTER.TXT LETTER.PTM 100
  1670.  
  1671.  
  1672.  
  1673.            Convert LETTER.TXT to LETTER.PTM with 100 ms delay between
  1674.            characters and 2 seconds between lines:
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.                                     24
  1682.  
  1683.  
  1684.  
  1685.                            DOS Phantom V2.9 Users Guide
  1686.  
  1687.  
  1688.  
  1689.                 C:\>MAKEPTM LETTER.TXT LETTER.PTM 100 2
  1690.  
  1691.  
  1692.            Convert LETTER.TXT to LETTER.PTM with no delay between
  1693.            characters, but a 2 second delay between lines:
  1694.  
  1695.                 C:\>MAKEPTM LETTER.TXT LETTER.PTM 0 2
  1696.  
  1697.  
  1698.  
  1699.            The output file can be played back like any DOS Phantom
  1700.            recording.
  1701.  
  1702.                 NOTE: When a character delay has been specified, it is not
  1703.                 possible to interrupt playback with the attention hot key.
  1704.  
  1705.            MAKEPTM places its output file in the directory designated by
  1706.            the DOS environment variable PHANTOMDIR if it has been defined.
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.                                     25
  1741.  
  1742.  
  1743.  
  1744.                            DOS Phantom V2.9 Users Guide
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.                           7. The P2FLUSH Program
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.            The P2FLUSH program, when executed, causes DOS Phantom to flush
  1765.            the record buffer to disk, even if the number of characters
  1766.            which would normally trigger a disk write has not yet been
  1767.            accumulated. P2FLUSH is effective even when DOS Phantom is
  1768.            operating in autonomous mode.
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.  
  1794.  
  1795.  
  1796.  
  1797.  
  1798.  
  1799.                                     26
  1800.  
  1801.  
  1802.  
  1803.                            DOS Phantom V2.9 Users Guide
  1804.  
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814.  
  1815.  
  1816.  
  1817.                                 8. Scraper
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.            V2.9 includes the SCRAPER utility which allows you to copy text
  1824.            displayed by a program into Phantom's string variables and play
  1825.            the stored text back later as if it were keyboard input.
  1826.            Scraper actions can be recorded with DOS Phantom and played
  1827.            back later for automatic movement of data from one program into
  1828.            another. This capability dramatically increases DOS Phantom's
  1829.            usefulness for application integration.
  1830.  
  1831.            Scraper is activated with the hot key specified using DOS
  1832.            Phantom's /B command line switch. The default Scraper
  1833.            activation hot key is ALT-S. Here is the command to install DOS
  1834.            Phantom and set the Scraper hot key to F12:
  1835.  
  1836.                 C:\> PHANTOM2 /I /B=F12
  1837.  
  1838.  
  1839.  
  1840.            Scraper is named as it is for the slang term "screen scraping"
  1841.            commonly used to describe Scraper's function of "scraping" the
  1842.            text from the screen for later use.
  1843.  
  1844.            Install Scraper by typing
  1845.  
  1846.  
  1847.                 SCRAPER /I
  1848.  
  1849.  
  1850.            at the DOS command line. DOS Phantom must be installed before
  1851.            Scraper can be installed.
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.                                     27
  1859.  
  1860.  
  1861.  
  1862.                            DOS Phantom V2.9 Users Guide
  1863.  
  1864.  
  1865.  
  1866.            Activate Scraper using the hot key (default ALT-S). A pop-up
  1867.            help window is displayed which tells you to move the cursor
  1868.            using the arrow keys to the upper left corner of the text you
  1869.            wish to select and then to press Enter. As soon as you press an
  1870.            arrow key, the help window disappears.
  1871.  
  1872.            When you press Enter after moving the cursor to the desired
  1873.            location, a second pop-up help window appears, telling you to
  1874.            move the cursor to the lower right of the text you wish to
  1875.            select and then to press the number key (1-9) where you want to
  1876.            begin storing the selected text. The text will be stored in the
  1877.            DOS Phantom string variables beginning with that number.
  1878.  
  1879.            If only one line of text was selected, only the one string
  1880.            variable will be used.  If, for example, you selected three
  1881.            lines of text and pressed the number 4, the string variables 4,
  1882.            5, and 6 would receive the first, second, and third lines of
  1883.            selected text, respectively. The contents of the string
  1884.            variables, if any, are overwritten. (There are a total of nine
  1885.            Phantom string variables numbered 1-9.)
  1886.  
  1887.            To play back the contents of a string variable, invoke Scraper
  1888.            using the hot key and press the number key (1-9) of the string
  1889.            variable whose contents you wish to play.
  1890.  
  1891.            You can play back the contents of string variables which
  1892.            received their contents in ways other than via Scraper as well.
  1893.            For example, a playback file might load the string variables
  1894.            with data for later insertion into a program through the manual
  1895.            use of Scraper.  Also, you can use the contents of string
  1896.            variables loaded with Scraper in your Phantom scripts. (See the
  1897.            section on string variables in the chapter on editing Phantom
  1898.            recordings for more information.)
  1899.  
  1900.            To disable the pop-up help windows, install Scraper with the /H
  1901.            switch like this:
  1902.  
  1903.                 C:\> SCRAPER/H/I
  1904.  
  1905.  
  1906.            You may un-install scraper using the /U switch. Also, when you
  1907.            un-install DOS Phantom, Scraper will be automatically
  1908.            uninstalled.
  1909.  
  1910.            The /Z switch will cause Scraper to install and uninstall
  1911.            "quietly" without displaying its copyright notice.
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.                                     28
  1918.  
  1919.  
  1920.  
  1921.                            DOS Phantom V2.9 Users Guide
  1922.  
  1923.  
  1924.  
  1925.            If you record your use of Scraper with DOS Phantom, it will be
  1926.            played back correctly, allowing you to automate the movement of
  1927.            data from one program into another (or even back into the same
  1928.            program).
  1929.  
  1930.            Scraper uses about 6K bytes of memory with help enabled, and
  1931.            about 3K bytes with help disabled.
  1932.  
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.                                     29
  1977.  
  1978.  
  1979.  
  1980.                            DOS Phantom V2.9 Users Guide
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.  
  1991.  
  1992.  
  1993.  
  1994.                      9. Editing DOS Phantom Recordings
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.            The program PTM2TXT extracts information from a DOS Phantom
  2001.            recording and places it in a text file for editing. Here is an
  2002.            example of PTM2TXT:
  2003.  
  2004.                 C:\>PTM2TXT RECORDNG.PTM RECORDNG.TXT
  2005.  
  2006.  
  2007.  
  2008.            The output text file contains a header with a summary of DOS
  2009.            Phantom script language syntax and directives.  It looks like
  2010.            this:
  2011.  
  2012.  
  2013.   !============================================================================
  2014.   ! DOS Phantom V2.9
  2015.   !
  2016.   ! Text translation of recording file hotmenu.
  2017.   ! Translated by PTM2TXT V2.9 #EVAL00.
  2018.   !
  2019.   ! Line format:
  2020.   !     mm:ss.ttt keystroke   eeaa ff
  2021.   !
  2022.   !     mm:ss:ttt = time interval between the previous keystroke and
  2023.   !                 this one.
  2024.   !         mm    = minutes
  2025.   !         ss    = seconds
  2026.   !         ttt   = thousandths of seconds
  2027.   !     ee        = extended keycode       (optional)
  2028.   !     aa        = ASCII code             (optional)
  2029.   !     ff        = keyboard status flags  (optional)
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.                                     30
  2036.  
  2037.  
  2038.  
  2039.                            DOS Phantom V2.9 Users Guide
  2040.  
  2041.  
  2042.  
  2043.   !
  2044.   !     The optional fields need not be entered when editing this file.
  2045.   !     Values appropriate for most circumstances will be provided for
  2046.   !     you by TXT2PTM.  If you include values for the optional fields,
  2047.   !     Your values will override those which TXT2PTM would provide.
  2048.   !     You should delete the optional fields when changing the keystroke.
  2049.   !
  2050.   !     Comment lines (lines beginning with !) and empty lines are ignored
  2051.   !     by the TXT2PTM translator.
  2052.   !
  2053.   !     Lines beginning with an asterisk (*) are processed by TXT2PTM
  2054.   !     without timing information.  This allows you to place entire
  2055.   !     commands on one line rather than one character per line. A
  2056.   !     carriage return is automatically placed at the end of * lines
  2057.   !     by TXT2PTM unless the last character on the line is a dollar
  2058.   !     sign.  Special character expressions (e.g., <Ctrl-K>) are
  2059.   !     delimited with angle brackets (<,>).
  2060.   !
  2061.   !     DOS Phantom directives begin with a dollar sign ($).
  2062.   !     Directives supported by DOS Phantom V2.9 are:
  2063.   !
  2064.   !       $n                     Input parameters (n=1-9)
  2065.   !       $Sn                    String varaibles (n=1-9)
  2066.   !       $Pause [n]             n=secs, default is no auto resume
  2067.   !       $Wait mm:ss.ttt        mm=min, ss=secs, ttt=ms
  2068.   !       $Sleep [n]             n=secs, default is no auto resume
  2069.   !       $ResumeKey [key]...    Key to resume Paused condition
  2070.   !       $IfKey <label> <key>   If last key was <key>, branch to <label>
  2071.   !
  2072.   !       $BeginDisplay row col attr timo S|R
  2073.   !       $Title text            Display title (optional)
  2074.   !       <text>                 Text for pop-up display
  2075.   !       <text>                 More text lines...
  2076.   !       $EndDisplay            Display text between Begin and EndDisplay
  2077.   !
  2078.   !       $BeginMenu row col attr timo S|R incr
  2079.   !       $Title text            Menu title (optional)
  2080.   !       <lines of text>        Static (non-selectable) menu text
  2081.   !       $<label> itemtext      Go to <label> when item is selected.
  2082.   !       $<label> itemtext      More menu items...
  2083.   !       $EndMenu               Ends a menu definition
  2084.   !
  2085.   !       $Goto <label>          Continue execution at <label>
  2086.   !       $<label>:              Goto, Menu, or If target
  2087.   !       $ExitWait [n]          Wait n secs for program exit
  2088.   !       $IfSuccess <label>     Go to <label> if exit status = 0
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.                                     31
  2095.  
  2096.  
  2097.  
  2098.                            DOS Phantom V2.9 Users Guide
  2099.  
  2100.  
  2101.  
  2102.   !       $IfError               Go to <label> if exit status <> 0
  2103.   !       $IfExitCode n <label>  Go to <label> if exit status = n
  2104.   !       $MatchWait n text      Wait n secs for text to appear on screen
  2105.   !       $MatchAt r,c n text    Wait n secs for text at position r,c
  2106.   !       $MatchFrom r,c n text  Wait n secs for text after position r,c
  2107.   !       $MatchTo r,c n text    Wait n secs for text before position r,c
  2108.   !       $IfMatch <label>       Go to <label> if match found
  2109.   !       $IfTimeout <label>     Go to <label> if no match found
  2110.   !       $Screen "text" [file]  Write screen to file prefixed with text
  2111.   !       $Printer C [file]      Capture printer output in file
  2112.   !       $Printer N             Return to normal printer output
  2113.   !       $RetainKybdFlags       Restore Insert, NumLock, ScrollLock, CapsLock
  2114.   !       $DisableCtrlAltDel     Ignore reboot requests from the keyboard
  2115.   !       $EnableCtrlAltDel      Honor reboot requests from the keyboard
  2116.   !       $Reboot                Reboot the computer
  2117.   !       $DisableKybd           Ignore keyboard input
  2118.   !       $EnableKybd            Stop ignoring keyboard input
  2119.   !       $FlushTypAhd           Clear keyboard typeahead buffer
  2120.   !       $Assign Sn text        Assign text to variable
  2121.   !       $Get Sn r,c len        Read text from screen into variable
  2122.   !       $IfEqual label Sn text Branch if Sn equal to text
  2123.   !       $IfEmpty label Sn      Branch if variable Sn is empty
  2124.   !       $Clear Sn              Clear variable Sn
  2125.   !       $FirstFile Sn text     Find first file matching text
  2126.   !       $NextFile Sn           Find next file matching FirstFile text
  2127.   !       $On count label        Branch to label the count'th time
  2128.   !       $Read file Sn          Read one line from file into Sn
  2129.   !       $Write file text[$]    Write text to file, $=no newline
  2130.   !       $Close                 Close file open for reading
  2131.   !       $IfClosed label        Branch if read file is closed
  2132.   !       $FSubStr(Sn,start,end) Return substring
  2133.   !       $FBefore(Sn,char)      Return substring before char
  2134.   !       $FAfter(Sn,char)       Return substring after char
  2135.   !       $Music note/dur...     Play note for duration dur
  2136.   !       $Scraper               Invoke Scraper
  2137.   !
  2138.   !     See the DOS Phantom Users Guide for details on using these directives.
  2139.   !
  2140.   !     The special characters $, <, and > must be preceeded by a
  2141.   !     dollar sign ($) when they are present in an asterisk line.
  2142.   !     Otherwise TXT2PTM will attempt to perform special processing
  2143.   !     erroneously.
  2144.   !
  2145.   !============================================================================
  2146.  
  2147.   00:06.050 D            2044 60
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.                                     32
  2154.  
  2155.  
  2156.  
  2157.                            DOS Phantom V2.9 Users Guide
  2158.  
  2159.  
  2160.  
  2161.   00:00.165 I            1749 60
  2162.   00:00.220 R            1352 60
  2163.   00:00.770 /            352f 60
  2164.   00:00.330 W            1157 60
  2165.   00:00.440 <SP>         3920 60
  2166.   $1
  2167.   00:01.210 <CR>         1c0d 60
  2168.   00:01.210 <CR>         1c0d 60
  2169.   $Pause
  2170.   00:01.760 E            1245 60
  2171.   00:00.275 X            2d58 60
  2172.   00:00.440 I            1749 60
  2173.   00:00.330 T            1454 60
  2174.   00:00.330 <CR>         1c0d 60
  2175.  
  2176.            The above file depicts a recording of the commands "DIR/W" and
  2177.            "EXIT". As you can see, the carriage return character is
  2178.            translated to <CR> in the file. Spaces are translated as <SP>.
  2179.            Non-printing and special characters such as CTRL-K are all
  2180.            translated in this manner. If you are not sure what the
  2181.            translation of a character might be, it is best to make a
  2182.            recording containing the character and then translate the
  2183.            recording with PTM2TXT to find out what the correct translation
  2184.            is.
  2185.  
  2186.            The line format is as described in the output file shown above.
  2187.  
  2188.            IMPORTANT: If you change a line in the file, it is best, unless
  2189.            you clearly understand the BIOS extended keycodes and keyboard
  2190.            status flags, to remove the eeaa and ff fields. TXT2PTM will
  2191.            supply appropriate values when you leave them out.
  2192.  
  2193.            Note that if you edit a translated DOS Phantom recording file
  2194.            and insert comments and labels, then translate the text file to
  2195.            a recording file and back into a text file, the comments and
  2196.            labels will be lost. PTM2TXT will create labels required by the
  2197.            menu and goto directives in the recording, but they will not be
  2198.            the labels from your original edited text file. Goto and menu
  2199.            directives are discussed below.
  2200.  
  2201.            When you have finished editing, you can create a recording file
  2202.            using the TXT2PTM program like this:
  2203.  
  2204.  
  2205.                 C:\> TXT2PTM RECORDNG.TXT RECORDNG.PTM
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.                                     33
  2213.  
  2214.  
  2215.  
  2216.                            DOS Phantom V2.9 Users Guide
  2217.  
  2218.  
  2219.  
  2220.            9.1. Eliminating Help Text
  2221.  
  2222.            If you don't want the detailed help header in the PTM2TXT
  2223.            output file, you can specify the /H switch on the command line.
  2224.            This will cause a brief header to be prefixed to the
  2225.            translation rather than the detailed help text shown in the
  2226.            above example. For example:
  2227.  
  2228.                 C:\>PTM2TXT /H RECORDNG.PTM RECORDNG.TXT
  2229.  
  2230.  
  2231.  
  2232.            Note that the switches to the PTM2TXT command must be separated
  2233.            from the PTM2TXT command and other switches by spaces.
  2234.  
  2235.  
  2236.  
  2237.         9.2. DOS Phantom Directives
  2238.  
  2239.            DOS Phantom directives are directions to DOS Phantom that you
  2240.            insert into a recording to have DOS Phantom perform some action
  2241.            during playback. All directives begin with a $. With the
  2242.            exception of the $1-$9, $S1-$S9, and the $F directives, all
  2243.            directives must be the first non-blank word on a line. Each
  2244.            directive is discussed in detail below.
  2245.  
  2246.  
  2247.  
  2248.            9.2.1. $PAUSE, $WAIT, and $SLEEP - Programmed Pauses
  2249.  
  2250.            The example above contains a programmed pause directive after
  2251.            the second <CR>. Note that programmed pauses (i.e., pauses
  2252.            which occur automatically at predetermined points during
  2253.            playback) may only be created by preparing an input file for
  2254.            TXT2PTM such as that shown above. There is no way to create
  2255.            programmed pauses while recording. The pause directive may be
  2256.            followed by a timeout value expressed in seconds (up to 3600
  2257.            seconds). If the timeout period passes without a key being
  2258.            depressed, the pause is ended and playback resumes. Each time a
  2259.            key is pressed during the pause, the pause timer is restarted.
  2260.  
  2261.            The $Sleep directive behaves much as the $Pause directive in
  2262.            that playback is suspended for the period of seconds supplied
  2263.            as a parameter to $Sleep.  The difference is that the timer
  2264.            used by $Sleep is not reset on each keystroke, so when the
  2265.  
  2266.  
  2267.  
  2268.  
  2269.  
  2270.  
  2271.                                     34
  2272.  
  2273.  
  2274.  
  2275.                            DOS Phantom V2.9 Users Guide
  2276.  
  2277.  
  2278.  
  2279.            timeout period has elapsed, playback continues regardless of
  2280.            whether a key has been pressed in the meantime.
  2281.  
  2282.            The number of seconds to pause is a required parameter of
  2283.            $Sleep and it must be in the range of 1 to 3600 (1 hour).  If
  2284.            you wish to pause indefinitely, you must use $Pause.
  2285.  
  2286.            As is the case with $Pause, if you need a $Sleep timeout of
  2287.            greater then 3600 seconds, you can place a series of $Sleep
  2288.            statements in your Phantom script which add up to the total
  2289.            time required.
  2290.  
  2291.            The $Wait directive is also available. $Wait accepts the time
  2292.            to wait in mm:ss.ttt format instead of in seconds like $Pause.
  2293.            $Wait cannot be terminated by pressing a key as can $Pause, and
  2294.            unlike $Pause the playback clock continues to run during a
  2295.            $Wait. This can cause the characters following a $Wait to be
  2296.            played back as fast as possible until the playback catches up
  2297.            (makes up for the time lost in the $Wait). $Wait directives are
  2298.            most useful in recordings which are meant to be played back at
  2299.            high speed (e.g., files prepared in compressed mode, described
  2300.            later), but where pauses without allowing keyboard input are
  2301.            required.
  2302.  
  2303.            To create the effect of a $Wait in a file with timed keystrokes
  2304.            without losing time during the wait, just add time to the
  2305.            keystroke which follows the wait.
  2306.  
  2307.            Here is a $Wait which will cause a wait of 3 minutes and 10
  2308.            seconds (this will cause timed keystrokes following to be
  2309.            played back at high speed until the 3 minutes and 10 seconds
  2310.            are made up for):
  2311.  
  2312.  
  2313.                 $Wait 03:10.000
  2314.  
  2315.  
  2316.  
  2317.            Here is a keystroke which will not be played back until 3
  2318.            minutes and 10 seconds have passed (no speedup of succeeding
  2319.            keystrokes occurs):
  2320.  
  2321.                 03:10.000 <CR>
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.                                     35
  2331.  
  2332.  
  2333.  
  2334.                            DOS Phantom V2.9 Users Guide
  2335.  
  2336.  
  2337.  
  2338.            In general, you use $Pause to pause for keyboard input, and
  2339.            $Wait in compressed recordings to stall without keyboard input.
  2340.  
  2341.  
  2342.  
  2343.            9.2.2. Ending Pauses - $ResumeKey
  2344.  
  2345.            Normally, $Pause and $Sleep are terminated only when the
  2346.            timeout period has expired or when you use the attention key.
  2347.            The $ResumeKey directive allows you to specify other keys which
  2348.            can be used to end the pause and resume playback.  Here is an
  2349.            example of $ResumeKey being used to allow the F12, Alt-F12, or
  2350.            Ctrl-F12 keys to end the pause:
  2351.  
  2352.                 $ResumeKey <F12> <Alt-F12> <Ctrl-F12>
  2353.                 $Pause
  2354.  
  2355.            The key list contains the names of keys separated with a single
  2356.            space.  These "resume keys" remain in effect until you change
  2357.            them with another $ResumeKey directive or until you cancel them
  2358.            using a $ResumeKey directive with no arguments.
  2359.  
  2360.            The special "$ResumeKey Any" directive can be used to allow any
  2361.            keystroke to end the pause.  Unlike other resume key
  2362.            assignments, the $ResumeKey Any is cancelled automatically as
  2363.            soon as it is used to terminate a $Pause or $Sleep.
  2364.  
  2365.            See the description of the $IfKey directive for information on
  2366.            how to determine which resume key was used to end a pause.
  2367.  
  2368.  
  2369.  
  2370.            9.2.3. Substitution Parameters
  2371.  
  2372.            The example also contains a substitution parameter directive:
  2373.            $1. This directive causes the first parameter entered on the
  2374.            DOS Phantom command line after the filename to be substituted
  2375.            for the $1 during playback. Up to nine substitution parameters
  2376.            ($1, $2, $3, ..., $9) may be used. If a corresponding command
  2377.            line parameter is not supplied for playback, the parameter used
  2378.            on the previous playback is used. If no parameter was used on
  2379.            the previous playback, or if this is the first playback of this
  2380.            DOS Phantom session, nothing is substituted for the
  2381.            substitution parameter (i.e., it is as if it was not there).
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.                                     36
  2390.  
  2391.  
  2392.  
  2393.                            DOS Phantom V2.9 Users Guide
  2394.  
  2395.  
  2396.  
  2397.            Multiple substitution parameter directives may be placed in an
  2398.            asterisk line. Otherwise, only a single directive is allowed
  2399.            per line. Asterisk lines and compressed mode are discussed in
  2400.            the next section.
  2401.  
  2402.            If you have placed substitution parameter directives in your
  2403.            recording file you may pass the values to be substituted for
  2404.            them on the command line after the filename. Here is an example
  2405.            passing the parameters A:, XYZ, and BOOBOO:
  2406.  
  2407.  
  2408.                 C:\>PHANTOM2/Q/I/K=F1 RECORDNG.PTM A: XYZ BOOBOO
  2409.  
  2410.  
  2411.            A: is substituted for $1, XYZ for $2, and BOOBOO for $3.
  2412.  
  2413.  
  2414.  
  2415.            9.2.4. Compressed Mode
  2416.  
  2417.            You may avoid typing in the time fields (mm:ss.ttt) by starting
  2418.            lines with an asterisk. Lines starting with an asterisk are
  2419.            referred to as being in "compressed" mode. When TXT2PTM
  2420.            processes lines beginning with an asterisk, it behaves as if
  2421.            each character was on a separate line and preceded with
  2422.            "00:00.000". TXT2PTM automatically inserts a <CR> at the end of
  2423.            each * line. You can suppress the automatically added <CR> by
  2424.            ending the asterisk line with a $.
  2425.  
  2426.            Here is the previous example created using this technique:
  2427.  
  2428.  
  2429.              !
  2430.              ! Example of the use of * lines.
  2431.              !
  2432.  
  2433.              * DIR/W $1
  2434.              *
  2435.              $Pause
  2436.              * EXIT
  2437.  
  2438.              !
  2439.              ! End of example
  2440.              !
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.                                     37
  2449.  
  2450.  
  2451.  
  2452.                            DOS Phantom V2.9 Users Guide
  2453.  
  2454.  
  2455.  
  2456.            You can place substitution parameter directives anywhere in a
  2457.            asterisk line. The characters "<", ">", and "$" must be
  2458.            preceded with a $ if you don't want DOS Phantom to handle them
  2459.            specially. For example, if I wanted DOS Phantom to play "Hello,
  2460.            World" followed by an Alt-F5 and then "The amount <is> $2.00."
  2461.            without a carriage return at the end, I would use the following
  2462.            asterisk line:
  2463.  
  2464.  
  2465.              * Hello, World<Alt-F5>The amount $<is$> $$2.00.$
  2466.  
  2467.  
  2468.  
  2469.            You can mix compressed and non-compressed modes in the same
  2470.            text file.
  2471.  
  2472.            You can cause PTM2TXT to produce compressed mode output from
  2473.            your recordings by including the /C switch on the command line
  2474.            like this:
  2475.  
  2476.  
  2477.                 C:\> PTM2TXT /C RECORDNG.PTM RECORDNG.TXT
  2478.  
  2479.  
  2480.  
  2481.            Note that the switches to the PTM2TXT command must be separated
  2482.            from the PTM2TXT command and other switches by spaces.
  2483.  
  2484.  
  2485.  
  2486.            9.2.5. Pop-Up Displays
  2487.  
  2488.            You can cause windows containing text you provide to pop up
  2489.            during playbacks of DOS Phantom recordings. These pop-up
  2490.            displays can contain text explaining what the user is seeing in
  2491.            a demonstration, announce a that a certain operation is about
  2492.            to take place, or instruct the user to perform some action.
  2493.  
  2494.            When a pop-up display is displayed, playback is halted until
  2495.            the user presses any key or until a timeout period which you
  2496.            specify has elapsed.
  2497.  
  2498.            The text which you wish to appear in a pop-up display is placed
  2499.            between two DOS Phantom directives: $BeginDisplay and
  2500.            $EndDisplay. If you want a title to appear in the upper left
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.                                     38
  2508.  
  2509.  
  2510.  
  2511.                            DOS Phantom V2.9 Users Guide
  2512.  
  2513.  
  2514.  
  2515.            border of the pop-up display, you may include a $Title
  2516.            directive on the line following the $BeginDisplay directive.
  2517.  
  2518.            The $BeginDisplay directive takes the following form:
  2519.  
  2520.  
  2521.                  $BeginDisplay row col attr timo sr
  2522.  
  2523.  
  2524.  
  2525.            The parameters following the directive are interpreted as
  2526.            follows:
  2527.  
  2528.            o  row - the screen row on which the top pop-up display is to
  2529.               be written.
  2530.  
  2531.            o  col - the screen column on which the left edge of the pop-
  2532.               up display is to be written.
  2533.  
  2534.            o  attr - The display attributes to be used for display of
  2535.               your text:
  2536.  
  2537.  
  2538.                 Attribute      Mono Display        Color Display
  2539.                 ---------      --------------      -----------------------
  2540.                 0              Normal              Gray on Blue
  2541.                 1              Bold                White on Blue
  2542.                 2              Reverse Video       Dark Gray on Light Gray
  2543.                 3              Reverse Bold        Black on Light Gray
  2544.                 8              Normal              Normal
  2545.                 9              Bold                Bold
  2546.  
  2547.  
  2548.  
  2549.            o  timo - A timeout value in seconds. If the timeout period
  2550.               passes without keyboard input, the display is erased and
  2551.               playback resumes. The maximum timeout value is 3600 seconds
  2552.               (1 hour).
  2553.  
  2554.            o  sr - The character S or R indicating whether you wish other
  2555.               DOS Phantom displays and menus which may be present on the
  2556.               screen to be erased before this window is displayed. R
  2557.               restores the screen to what it was before any DOS Phantom
  2558.               displays or menus were popped-up. S saves the screen as it
  2559.               is and causes the new display to be painted over anything
  2560.               currently shown on the screen.
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.                                     39
  2567.  
  2568.  
  2569.  
  2570.                            DOS Phantom V2.9 Users Guide
  2571.  
  2572.  
  2573.  
  2574.            DOS Phantom pop-up displays are automatically erased when
  2575.            playback is resumed.
  2576.  
  2577.            The text you wish to appear in the pop-up display is placed
  2578.            between the $BeginDisplay and $EndDisplay directives.Here is an
  2579.            example of the directives used to create a pop-up display:
  2580.  
  2581.  
  2582.              !
  2583.              ! Create a display at row 5, column 20, reverse video,
  2584.              ! 2-minute timeout and erase any currently displayed pop-ups.
  2585.              !
  2586.              $BeginDisplay 5 20 2 120 R
  2587.              $Title Sample Pop-Up Display
  2588.  
  2589.              This is just a simple example of a
  2590.              DOS Phantom pop-up display.
  2591.  
  2592.              (Press any key to continue.)
  2593.              $EndDisplay
  2594.  
  2595.  
  2596.  
  2597.            Here's how the above pop-up display would appear on the screen
  2598.            (at row 5, column 20):
  2599.  
  2600.  
  2601.                   +--Sample Pop-Up Display---------------+
  2602.                   |                                      |
  2603.                   | This is just a simple example of a   |
  2604.                   |    DOS Phantom pop-up display.       |
  2605.                   |                                      |
  2606.                   |   (Press any key to continue.        |
  2607.                   +--------------------------------------+
  2608.  
  2609.  
  2610.  
  2611.            Note that when you specify the row and column for the display
  2612.            you should take into account that DOS Phantom will add 3
  2613.            columns-worth of border to each line and an extra row at the
  2614.            top and bottom for the border.
  2615.  
  2616.  
  2617.  
  2618.  
  2619.  
  2620.  
  2621.  
  2622.  
  2623.  
  2624.  
  2625.                                     40
  2626.  
  2627.  
  2628.  
  2629.                            DOS Phantom V2.9 Users Guide
  2630.  
  2631.  
  2632.  
  2633.            9.2.6. Labels and the $GOTO Directive
  2634.  
  2635.            You can cause playback to transfer from one place in a
  2636.            recording file to another by using the $Goto directive. The
  2637.            $Goto directive has a single parameter: the label of the
  2638.            location from which playback is to continue. Labels in DOS
  2639.            Phantom recording files take the form
  2640.  
  2641.  
  2642.                 $<text>:
  2643.  
  2644.  
  2645.  
  2646.            where <test> is any printable text string not starting with a
  2647.            digit and not containing spaces or tabs. Here is an example of
  2648.            a recording which continually clears the screen and the
  2649.            displays the current directory:
  2650.  
  2651.              !
  2652.              ! Endless loop directory
  2653.              !
  2654.              $Loop:
  2655.              * CLS
  2656.              * DIR /W
  2657.              $Goto Loop
  2658.  
  2659.  
  2660.  
  2661.            Note that the colon following the label is not included when
  2662.            the label is the parameter of the $Goto directive.
  2663.  
  2664.            The $Goto is most useful for returning to a pop-up menu after
  2665.            the actions requested by the user have been carried out. (Pop-
  2666.            up menus are described in the next section.)
  2667.  
  2668.  
  2669.  
  2670.            9.2.7. Pop-Up Menus
  2671.  
  2672.            You can cause menus to pop up during playbacks of DOS Phantom
  2673.            recordings. These pop-up menus can contain text and items from
  2674.            which the user may choose. Once an item is selected, playback
  2675.            resumes at the place in the recording file which is associated
  2676.            with that menu selection.
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.                                     41
  2685.  
  2686.  
  2687.  
  2688.                            DOS Phantom V2.9 Users Guide
  2689.  
  2690.  
  2691.  
  2692.            When a pop-up menu is displayed, playback is halted until the
  2693.            user selects an item or until a timeout period which you
  2694.            specify has elapsed.
  2695.  
  2696.            The text and selection items which you wish to appear in a pop-
  2697.            up menu are placed between two DOS Phantom directives:
  2698.            $BeginMenu and $EndMenu. If you want a title to appear in the
  2699.            upper left border of the pop-up menu, you may include a $Title
  2700.            directive on the line following the $BeginMenu directive.
  2701.  
  2702.            The $BeginMenu directive takes the following form:
  2703.  
  2704.  
  2705.                 $BeginMenu row col attr timo sr incr
  2706.  
  2707.  
  2708.  
  2709.            The parameters following the directive are interpreted as
  2710.            follows:
  2711.  
  2712.              row - the screen row on which the top pop-up menu is to be
  2713.              written.
  2714.  
  2715.              col - the screen column on which the left edge of the pop-up
  2716.              menu is to be written.
  2717.  
  2718.              attr - The display attributes to be used for display of your
  2719.              text:
  2720.  
  2721.  
  2722.                 Attribute      Mono Display        Color Display
  2723.                 ---------      --------------      -----------------------
  2724.                 0              Normal              Gray on Blue
  2725.                 1              Bold                White on Blue
  2726.                 2              Reverse Video       Dark Gray on Light Gray
  2727.                 3              Reverse Bold        Black on Light Gray
  2728.                 8              Normal              Normal
  2729.                 9              Bold                Bold
  2730.  
  2731.              timo - A timeout value in seconds. If the timeout period
  2732.              passes without keyboard input, the display is erased and
  2733.              playback resumes. The maximum timeout value is 3600 seconds
  2734.              (1 hour).
  2735.  
  2736.              sr - The character S or R indicating whether you wish other
  2737.              DOS Phantom displays and menus which may be present on the
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.                                     42
  2744.  
  2745.  
  2746.  
  2747.                            DOS Phantom V2.9 Users Guide
  2748.  
  2749.  
  2750.  
  2751.              screen to be erased before this window is displayed. R
  2752.              restores the screen to what it was before any DOS Phantom
  2753.              displays or menus were popped-up. S saves the screen as it
  2754.              is and causes the new display to be painted over anything
  2755.              currently shown on the screen.
  2756.  
  2757.              incr - if specified as 1, the auto-incrementing feature of
  2758.              the menu is disabled, and each time the menu is encountered,
  2759.              the first item will be highlighted.  If left off, or
  2760.              specified as zero, each time the menu is encountered, the
  2761.              selected item is incremented. The auto-incrementng feature
  2762.              makes possible unattended demos which cycle through all the
  2763.              menu selections.
  2764.  
  2765.            DOS Phantom pop-up menus are automatically erased when playback
  2766.            is resumed.
  2767.  
  2768.            Menu selection items are placed after the $BeginMenu and the
  2769.            optional $Title directives and after any introductory text you
  2770.            wish to appear above the selection items in the menu window.
  2771.            Menu selection items are prefixed by $<label> where <label> is
  2772.            the label at which playback is to be resumed (or at which
  2773.            another display or menu is defined) if that menu item is
  2774.            chosen. Labels are described in the section on the $Goto
  2775.            directive.
  2776.  
  2777.            Here is an example of the directives used to create a pop-up
  2778.            menu:
  2779.  
  2780.              !
  2781.              ! Create a menu at row 5, column 20, reverse video, 10-second
  2782.              ! timeout and retain any currently displayed pop-ups.
  2783.              !
  2784.              $START:
  2785.  
  2786.              $BeginMenu 5 20 2 10 S
  2787.              $Title Sample Pop-Up Menu
  2788.  
  2789.              Choose one of the items below
  2790.              by moving the highlight bar
  2791.              with the arrow keys and pressing
  2792.              RETURN when the item you want
  2793.              is highlighted.
  2794.  
  2795.              $DIR Directory
  2796.              $CLEAR Clear Screen
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.                                     43
  2803.  
  2804.  
  2805.  
  2806.                            DOS Phantom V2.9 Users Guide
  2807.  
  2808.  
  2809.  
  2810.              $QUIT Quit
  2811.              $EndMenu
  2812.  
  2813.              $DIR:
  2814.              * dir/w
  2815.              $Goto start
  2816.  
  2817.              $CLEAR:
  2818.              * cls
  2819.              $Goto start
  2820.  
  2821.              $QUIT:
  2822.              * exit
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.            Here's how the above pop-up menu would appear on the screen (at
  2829.            row 5, column 20):
  2830.  
  2831.  
  2832.                   +--Sample Pop-Up Menu----------------+
  2833.                   |                                    |
  2834.                   | Choose one of the items below      |
  2835.                   | by moving the highlight bar        |
  2836.                   | with the arrow keys and pressing   |
  2837.                   | RETURN when the item you want      |
  2838.                   | is highlighted.                    |
  2839.                   |                                    |
  2840.                   | Directory                          |
  2841.                   | Clear Screen                       |
  2842.                   | Quit                               |
  2843.                   +------------------------------------+
  2844.  
  2845.            Note that when you specify the row and column for the menu you
  2846.            should take into account that DOS Phantom will add 3 columns-
  2847.            worth of border to each line and an extra row at the top and
  2848.            bottom for the border.
  2849.  
  2850.  
  2851.  
  2852.  
  2853.  
  2854.  
  2855.  
  2856.  
  2857.  
  2858.  
  2859.  
  2860.  
  2861.                                     44
  2862.  
  2863.  
  2864.  
  2865.                            DOS Phantom V2.9 Users Guide
  2866.  
  2867.  
  2868.  
  2869.            9.2.8. The $IfKey Directive
  2870.  
  2871.            The $IfKey directive can be used to determine what key was used
  2872.            to terminate a $Begin/EndDisplay, a $Pause, or a $Sleep
  2873.            condition. The $IfKey directive takes to following form:
  2874.  
  2875.                 $IfKey <label> <key>
  2876.  
  2877.            A branch is taken to the label specified if the key specified
  2878.            was the last key entered at the keyboard.
  2879.  
  2880.            $IfKey is most useful immediately following a pop-up display or
  2881.            $Pause.  A series of $IfKey directives can be used to dispatch
  2882.            to another part of the playback script based on which key was
  2883.            pressed.
  2884.  
  2885.            $IfKey can be used in conjunction with $ResumeKey to create the
  2886.            effect of "hot keys" during a Phantom playback. You set up a
  2887.            number of keys to end a $Pause with $ResumeKey and then, when
  2888.            the playback is resumed after the pause, use $IfKey to
  2889.            determine which key was used to resume playback.
  2890.  
  2891.            Here is a phantom playback script containing several uses of
  2892.            $IfKey along with $ResumeKey, $Begin/EndDisplay, and $Pause:
  2893.  
  2894.  
  2895.             !
  2896.             ! HOTMENU - An example of the use of $ResumeKey and $IfKey
  2897.             ! to implement pop-up display-based menus and playback hot keys.
  2898.             !
  2899.             !
  2900.             $Loop:
  2901.             $BeginDisplay 4 15 1 30 R
  2902.             $Title HotMenu
  2903.  
  2904.                 Select one of the options below
  2905.                 by typing the letter preceeding
  2906.                 the option name.
  2907.  
  2908.                 A  Directory of .EXE files
  2909.                 B  Directory of .COM files
  2910.                 C  Directory of .BAT files
  2911.                 X  Exit
  2912.  
  2913.             $EndDisplay
  2914.  
  2915.  
  2916.  
  2917.  
  2918.  
  2919.  
  2920.                                     45
  2921.  
  2922.  
  2923.  
  2924.                            DOS Phantom V2.9 Users Guide
  2925.  
  2926.  
  2927.  
  2928.             !
  2929.             ! See if they pressed one of the special keys
  2930.             !
  2931.             $IfKey DIREXE A
  2932.             $IfKey DIREXE a
  2933.  
  2934.             $IfKey DIRCOM B
  2935.             $IfKey DIRCOM b
  2936.  
  2937.             $IfKey DIRBAT C
  2938.             $IfKey DIRBAT c
  2939.  
  2940.             $IfKey EXIT X
  2941.             $IfKey EXIT x
  2942.  
  2943.             !
  2944.             ! They didn't press a special key.  re-display the "menu"
  2945.             !
  2946.             $Goto Loop
  2947.  
  2948.             !
  2949.             ! Handle the "menu" options.  After executing the command,
  2950.             ! wait 10 seconds or for any keystroke before re-displaying the
  2951.             ! "menu".
  2952.             !
  2953.             $DIREXE:
  2954.             * CLS
  2955.             * DIR *.EXE
  2956.             $ResumeKey Any
  2957.             $Pause 10
  2958.             $Goto Loop
  2959.  
  2960.             $DIRCOM:
  2961.             * CLS
  2962.             * DIR *.COM
  2963.             $ResumeKey Any
  2964.             $Pause 10
  2965.             $Goto Loop
  2966.  
  2967.             $DIRBAT:
  2968.             * CLS
  2969.             * DIR *.BAT
  2970.             $ResumeKey Any
  2971.             $Pause 10
  2972.             $Goto Loop
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.                                     46
  2980.  
  2981.  
  2982.  
  2983.                            DOS Phantom V2.9 Users Guide
  2984.  
  2985.  
  2986.  
  2987.             !
  2988.             ! Take them to DOS.  Wait for F12 to re-display the "menu", or
  2989.             ! Alt-F12 to exit the playback.
  2990.             !
  2991.             $EXIT:
  2992.             * cls
  2993.             * Rem  **** Use F12 to return to the menu. ****
  2994.             $ResumeKey <F12> <Alt-F12>
  2995.             $Pause
  2996.             $IfKey END <Alt-F12>
  2997.             $Goto Loop
  2998.  
  2999.             $END:
  3000.             $Music C4/5 R/5 C4/5
  3001.  
  3002.  
  3003.  
  3004.  
  3005.            9.2.9. Programmed Screen Capture
  3006.  
  3007.            The $Screen directive can be included in a recording file to
  3008.            cause the contents of the screen to be written to a file. You
  3009.            may specify a line of text to appear before each screen in the
  3010.            file, and the name of the file.
  3011.  
  3012.            The $Screen directive takes the following form:
  3013.  
  3014.  
  3015.                 $Screen "text" file
  3016.  
  3017.  
  3018.  
  3019.            The text must be placed between quotation marks. It is used to
  3020.            separate a series of screens written to the same file. The file
  3021.            parameter is optional. If it is not present, the file
  3022.            SCREEN.TXT in the current directory is used. If the file,
  3023.            whether specified or defaulted, is not present, it is created.
  3024.            If it is present, the current contents of the screen are
  3025.            appended to the file prefixed by the specified text line.
  3026.  
  3027.            Note that screen capture can also be controlled using the /D
  3028.            and /F command line switches described earlier.
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.                                     47
  3039.  
  3040.  
  3041.  
  3042.                            DOS Phantom V2.9 Users Guide
  3043.  
  3044.  
  3045.  
  3046.            9.2.10. Programmed Print Capture
  3047.  
  3048.            The $Printer directive allows you to direct output which would
  3049.            normally go to a printer to a file. You can turn the print
  3050.            capture on and off and specify the file to which printer output
  3051.            is to be directed.
  3052.  
  3053.            The $Printer directive takes the following form:
  3054.  
  3055.  
  3056.                 $Printer C file
  3057.  
  3058.             or
  3059.  
  3060.                 $Printer N
  3061.  
  3062.  
  3063.  
  3064.            The $Printer C (for Capture) directive enables print capture.
  3065.            If a file is specified, printer output is directed to that
  3066.            file. If no file is specified, the default is PRINTER.TXT. The
  3067.            $Printer N (for Normal) command disables print capture and
  3068.            printer output once again is sent to the printer.
  3069.  
  3070.            Print capture can also be enabled with the /V command line
  3071.            switch.
  3072.  
  3073.            Note:
  3074.            Be sure not to return the printer to normal too soon. The MS-
  3075.            DOS PRINT program (as well as other print spooling TSR's) goes
  3076.            on sending characters to the printer even after control has
  3077.            returned to the command line. If you issue a $Printer N command
  3078.            before PRINT has finished, the remainder of your output may be
  3079.            sent to the printer.
  3080.  
  3081.  
  3082.  
  3083.            9.2.11. Pacing
  3084.  
  3085.            The $SetPace directive allows you to specify the number of
  3086.            milliseconds which are to elapse between successive keystrokes
  3087.            during playback. This can be useful if you find a compressed or
  3088.            /Q-invoked playback is overrunning a program's capability of
  3089.            accepting input.
  3090.  
  3091.            The $SetPace directive takes the following form:
  3092.  
  3093.  
  3094.  
  3095.  
  3096.  
  3097.                                     48
  3098.  
  3099.  
  3100.  
  3101.                            DOS Phantom V2.9 Users Guide
  3102.  
  3103.  
  3104.  
  3105.  
  3106.                 $SetPace ms
  3107.  
  3108.  
  3109.  
  3110.            Where ms is the number of milliseconds between keystrokes. The
  3111.            actual delay is rounded to the nearest 55-millisecond boundary
  3112.            as that is the default resolution of the PC's clock. You can
  3113.            disable pacing with
  3114.  
  3115.  
  3116.                 $SetPace 0.
  3117.  
  3118.  
  3119.            Note:
  3120.            A playback can not be interrupted using the attention hot
  3121.            key when a $SetPace directive is in effect. Once started,
  3122.            the paced section must play to completion.
  3123.  
  3124.  
  3125.  
  3126.            9.2.12. Matching Screen Text
  3127.  
  3128.            The directives $MatchWait, $MatchAt, $MatchTo, and $MatchFrom
  3129.            are used to cause a playback to pause until a text string you
  3130.            specify appears on the screen or until a timeout period you
  3131.            specify has passed. The $IfMatch and $IfTimeout directives
  3132.            allow you to determine whether a preceding $MatchWait directive
  3133.            ended with a timeout or a match and goto a label in your
  3134.            recording file depending on which occurred.
  3135.  
  3136.            The $MatchWait directives takes the following forms:
  3137.  
  3138.  
  3139.                 $MatchWait timo text
  3140.                 $MatchAt r,c timo text
  3141.                 $MatchTo r,c timo text
  3142.                 $MatchFrom r,c timo text
  3143.  
  3144.  
  3145.  
  3146.            Where timo is the timeout period in seconds, r,c is the screen
  3147.            row and column (1,1 is the upper left corner of the screen) and
  3148.            text is the text string to look for on the screen. The text
  3149.            string may contain spaces, and the special characters <, >, and
  3150.  
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.                                     49
  3157.  
  3158.  
  3159.  
  3160.                            DOS Phantom V2.9 Users Guide
  3161.  
  3162.  
  3163.  
  3164.            $ need not be prefixed with a $ as is the case elsewhere in
  3165.            recording files.
  3166.  
  3167.            $MatchWait searches for a match anywhere on the screen.
  3168.            $MatchAt searches for a match at the row and column specified
  3169.            only. $MatchTo searches for a match in the portion of the
  3170.            screen before the row and column specified, and $MatchFrom
  3171.            searches for a match in the portion of the screen after the row
  3172.            and column specified.
  3173.  
  3174.            A timeout value of zero disables the timeout, and the $Match
  3175.            directive will wait forever for the text to appear on the
  3176.            screen.
  3177.  
  3178.            $MatchAt can accept a special timeout value: -1. This results
  3179.            in a single test of the screen contents (effectively a timeout
  3180.            of zero). -1 may not be used with the other $Match directives.
  3181.  
  3182.            The $IfMatch and $IfTimeout take a single parameter: the label
  3183.            to go to if a match or timeout occurred, respectively.
  3184.  
  3185.            Here is an example of a recording file segment which executes a
  3186.            DOS DIR command and then waits 10 seconds for the DOS prompt to
  3187.            appear before continuing and issuing an EXIT command.
  3188.  
  3189.              * DIR
  3190.              $MatchWait 10 C:\>
  3191.              * EXIT
  3192.  
  3193.  
  3194.            Here is a more complex example using $IfTimeout. This example
  3195.            issues <CR> characters until the word "Username:" appears on
  3196.            the screen. It then issues the name BILLSMITH and waits for the
  3197.            word "Password:" to appear. If "Password:" does not appear
  3198.            within 5 seconds, it goes back to sending <CR>'s and waiting
  3199.            for "Username:"
  3200.  
  3201.  
  3202.              $LOOP:
  3203.              * <CR>$
  3204.  
  3205.              $MatchWait 3 Username:
  3206.              $IfMatch CONTINUE
  3207.              $Goto LOOP
  3208.  
  3209.              $CONTINUE:
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.                                     50
  3216.  
  3217.  
  3218.  
  3219.                            DOS Phantom V2.9 Users Guide
  3220.  
  3221.  
  3222.  
  3223.              * BILLSMITH
  3224.              $MatchWait 5 Password:
  3225.              $IfTimeout LOOP
  3226.  
  3227.            The above is overly complex -- in particular, the $IfMatch
  3228.            followed by the $Goto and the CONTINUE label could all be
  3229.            replaced with just $IfTimeout LOOP. It is shown the way it is
  3230.            so that all the directives described in this section could be
  3231.            used.
  3232.  
  3233.            Note that $MatchWait searches the entire screen for a match,
  3234.            not just what was output since the last keystroke. You need to
  3235.            make sure that the text string you are waiting for isn't
  3236.            already on the screen, or your $MatchWait will appear to
  3237.            terminate prematurely.
  3238.  
  3239.            Also note that the $Match directives are case-sensitive. That
  3240.            is, they do not treat "Username" and "username" as a match. The
  3241.            letters must the same case (upper or lower) for a match to
  3242.            occur.
  3243.  
  3244.            The /O switch is provided to assist you in creating recording
  3245.            files using the $Match directives. /O causes recent screen
  3246.            output to be included in recording files as comments. You can
  3247.            edit these comments into $Match directives without having to
  3248.            remember what was on the screen when you recorded the session.
  3249.            The /O-captured output is far from perfect, and frequently may
  3250.            not be what is really needed in the $Match diectives.
  3251.            Alternatively, you can use the /D command line switch to enable
  3252.            a screen capture hot key and capture the important screens
  3253.            during recording and then refer to them when inserting your
  3254.            $MatchWait directives. Remember that the /O switch creates
  3255.            significant overhead and should only be used when needed.
  3256.  
  3257.  
  3258.  
  3259.            9.2.13. Waiting for Program Exit
  3260.  
  3261.            The $ExitWait directive causes a playback to pause until the
  3262.            next DOS program exits. This allows you to run a program, turn
  3263.            control over to the keyboard, and resume playback as soon as
  3264.            the program ends. An optional timeout value allows you to
  3265.            resume playback after a number of seconds without keystrokes
  3266.            has passed.
  3267.  
  3268.            The form of the $ExitWait directive is as follows:
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.                                     51
  3275.  
  3276.  
  3277.  
  3278.                            DOS Phantom V2.9 Users Guide
  3279.  
  3280.  
  3281.  
  3282.  
  3283.                 $ExitWait n
  3284.  
  3285.  
  3286.  
  3287.            Where n is the number of seconds to wait before continuing with
  3288.            playback if no keystrokes are detected.
  3289.  
  3290.            You can use the $IfTimeout directive to determine whether a
  3291.            $ExitWait directive terminated because it timed out or because
  3292.            of program exit.
  3293.  
  3294.            Here is an example of running a program called TROJAN and
  3295.            waiting for program exit or 1 minute without keystrokes. If a
  3296.            timeout occurs, a CTRL-C character is delivered to the program
  3297.            to terminate it before continuing.
  3298.  
  3299.  
  3300.              * TROJAN
  3301.              $ExitWait 60
  3302.              $IfTimeout TERMINATE
  3303.  
  3304.              $CONTINUE:
  3305.              .
  3306.              .
  3307.              .
  3308.  
  3309.              $TERMINATE:
  3310.              * <Ctrl-C>$
  3311.              $Goto CONTINUE
  3312.  
  3313.  
  3314.  
  3315.            9.2.14. Detecting Exit Status
  3316.  
  3317.            Many DOS programs return an "exit status" when they terminate
  3318.            indicating whether they were successful in performing whatever
  3319.            function they were supposed to perform. The $IfError and
  3320.            $IfSuccess directives enable you to go to a label depending on
  3321.            the exit status of the last program you ran.
  3322.  
  3323.            Here is the example from the previous section re-coded to take
  3324.            advantage of these directives:
  3325.  
  3326.  
  3327.  
  3328.  
  3329.  
  3330.  
  3331.  
  3332.  
  3333.                                     52
  3334.  
  3335.  
  3336.  
  3337.                            DOS Phantom V2.9 Users Guide
  3338.  
  3339.  
  3340.  
  3341.              $LOOP:
  3342.              * TROJAN
  3343.              $ExitWait 60
  3344.              $IfTimeout TERMINATE
  3345.              $IfSuccess CONTINUE
  3346.              $IfError LOOP
  3347.  
  3348.              $CONTINUE:
  3349.              .
  3350.              .
  3351.              .
  3352.  
  3353.              $TERMINATE:
  3354.              * <Ctrl-C>$
  3355.              $Goto CONTINUE
  3356.  
  3357.            Note that the $IfSuccess CONTINUE is actually superfluous,
  3358.            since execution would continue at the CONTINUE label anyway. It
  3359.            was included to demonstrate the use of the directive.
  3360.  
  3361.            The $IfSuccess and $IfError simply check for an exit code of
  3362.            zero or anything else (zero indicating success). The
  3363.            $IfExitCode directive allows you to branch to a label depending
  3364.            on whether a specific exit code was returned. The format of the
  3365.            $IfExitCode directive is
  3366.  
  3367.               $IfExitCode n label
  3368.  
  3369.            where n is the exitcode to test for, and label is the label to
  3370.            branch to if the exit code is indeed n.
  3371.  
  3372.  
  3373.  
  3374.            9.2.15. Disabling Keyboard Input - $DisableKybd
  3375.  
  3376.            The $DisableKybd causes DOS Phantom to ignore keyboard input
  3377.            until the $EnableKybd directive is encountered. This allows you
  3378.            to use $Pause, $MatchWait, and $ExitWait directives without
  3379.            interference.
  3380.  
  3381.            The $DisableKyd directive accepts a single optional parameter:
  3382.            a letter or number designating a key which when depressed will
  3383.            re-enable the keyboard.  If no parameter is provided, the only
  3384.            way the keyboard can be re-enabled is with the $EnableKybd
  3385.            directive.  Only letters and numbers may be specified in the
  3386.  
  3387.  
  3388.  
  3389.  
  3390.  
  3391.  
  3392.                                     53
  3393.  
  3394.  
  3395.  
  3396.                            DOS Phantom V2.9 Users Guide
  3397.  
  3398.  
  3399.  
  3400.            $DisableKybd directive; no Alt or Ctrl key combinations are
  3401.            allowed, and letters are not case-sensitive.
  3402.  
  3403.  
  3404.  
  3405.            9.2.16. Flushing the Typeahead Buffer - $FlushTypAhd
  3406.  
  3407.            The $FlushTypAhd directive removes any characters which have
  3408.            accumulated in the typeahead buffer and have not been read by a
  3409.            program.
  3410.  
  3411.  
  3412.  
  3413.            9.2.17. Disabling Ctl-Alt-Del
  3414.  
  3415.            The $DisableCtrlAltDel directive prohibits the rebooting of the
  3416.            computer using the Ctrl-Alt-Del key combination until the
  3417.            $EnableCtrlAltDel directive is encountered. This can be useful
  3418.            to protect critical sections of a playback from accidental
  3419.            rebooting from the keyboard. Of course, the power could still
  3420.            be turned off, or the reset button pressed.
  3421.  
  3422.  
  3423.  
  3424.            9.2.18. Programmed Reboots - $Reboot
  3425.  
  3426.            The $Reboot directive allows you to reboot your computer from
  3427.            within a DOS Phantom playback file. This can be useful for re-
  3428.            configuring a system at preset times (installing different
  3429.            CONFIG.SYS and AUTOEXEC.BAT files) from a scheduled Phantom
  3430.            playback.
  3431.  
  3432.  
  3433.  
  3434.            9.2.19. Retaining Keyboard Flags - $RetainKybdFlags
  3435.  
  3436.            Normally, when a playback is complete, DOS Phantom returns the
  3437.            state of the toggle keys Insert, NumLock, ScrollLk and CapsLock
  3438.            to the state they were in before the playback was started. If
  3439.            you wish the keys to remain in the state they were in when the
  3440.            playback ended, use the $RetainKybdFlags directive anywhere in
  3441.            your playback file.
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.                                     54
  3452.  
  3453.  
  3454.  
  3455.                            DOS Phantom V2.9 Users Guide
  3456.  
  3457.  
  3458.  
  3459.            9.2.20. Using the $SETMODE Directives
  3460.  
  3461.            The $SetMode directives could have been called the "Prodigy
  3462.            directives" since their usefulness appears to be limited to
  3463.            fast playback into the Prodigy on-line service. Prodigy uses
  3464.            what may be a unique method of obtaining characters from the
  3465.            keyboard which can cause loss of characters during high-speed
  3466.            playback. To ensure against this, the $SetMode Func6 directive
  3467.            should be placed after the command which invokes Prodigy, and
  3468.            the $SetMode Normal command placed just after the command
  3469.            terminating Prodigy.
  3470.  
  3471.            You may not experience difficulties playing back into Prodigy
  3472.            without these directives. If that is the case, ignore this
  3473.            section. If you do experience character loss playing into
  3474.            Prodigy, these directives should solve the problem.
  3475.  
  3476.            Here is an example of the use of the $SetMode directives where
  3477.            Prodigy is invoked, the stock price for IBM is displayed, and
  3478.            Prodigy is terminated.
  3479.  
  3480.              * Prodigy
  3481.              $SetMode Func6
  3482.  
  3483.              !
  3484.              ! Prodigy user ID and password
  3485.              !
  3486.              * HDCK21B<Tab>PASSWORD
  3487.  
  3488.              !
  3489.              ! Jump to quote check
  3490.              !
  3491.              * <F6>Quote Check
  3492.  
  3493.              !
  3494.              ! Display IBM's current price
  3495.              !
  3496.              * IBM
  3497.  
  3498.              !
  3499.              ! Give us a chance to read it
  3500.              !
  3501.              $Wait 00:30.000
  3502.  
  3503.              !
  3504.              ! Leave prodigy
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.                                     55
  3511.  
  3512.  
  3513.  
  3514.                            DOS Phantom V2.9 Users Guide
  3515.  
  3516.  
  3517.  
  3518.              !
  3519.              * <Shft-Tab><Shft-Tab>
  3520.              * E
  3521.  
  3522.              $SetMode Normal
  3523.  
  3524.  
  3525.  
  3526.         9.2.21. String Variables
  3527.  
  3528.            V2.9 of DOS Phantom adds support for 9 string variables S1-S9.
  3529.            To include the contents of a string variable in playback, the
  3530.            string variable is prefixed with a dollar sign, similar to
  3531.            command line parameters. For example, here is an output
  3532.            statement which includes a command line parameter as well as a
  3533.            string variable:
  3534.  
  3535.                 * REM The value of $$1 is $1. The value of S3 is $S3.
  3536.  
  3537.  
  3538.  
  3539.            A number of directives are available for dealing with string
  3540.            variables:
  3541.  
  3542.            $Assign Sn <text>
  3543.  
  3544.                 Assigns <text> to string variable Sn. <Text> may contain
  3545.                 string and command line variables. The contents of Sn, if
  3546.                 any, are overwritten.
  3547.  
  3548.  
  3549.  
  3550.            $GetScreen r,c len Sn
  3551.  
  3552.                 Reads len characters from the screen at row r column c
  3553.                 into string variable Sn. The contents of Sn, if any, are
  3554.                 overwritten.
  3555.  
  3556.  
  3557.  
  3558.            $Read <file> Sn
  3559.  
  3560.                 Reads a line from file <file> into string variable Sn. The
  3561.                 contents of Sn, if any, are overwritten.
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.                                     56
  3570.  
  3571.  
  3572.  
  3573.                            DOS Phantom V2.9 Users Guide
  3574.  
  3575.  
  3576.  
  3577.            $Write <file> <text>
  3578.  
  3579.                 Appends <text> to <file>. <Text> may contain string and
  3580.                 command line variables, for example: "parm1=$1, string
  3581.                 variable 3=$S3". (The quotation marks are not required
  3582.                 syntax.)
  3583.  
  3584.  
  3585.  
  3586.            $IfEqual <label> Sn <text>
  3587.  
  3588.                 Branches to <label> if the contents of Sn are equal to
  3589.                 <text>. <Text> may contain string and command line
  3590.                 parameters. Comparison is case-sensitive.
  3591.  
  3592.  
  3593.  
  3594.            $IfEmpty <label> Sn
  3595.  
  3596.                 Branches to <label> if the string variable Sn is empty.
  3597.  
  3598.  
  3599.  
  3600.            $Clear Sn
  3601.  
  3602.                 Empties the string variable Sn.
  3603.  
  3604.  
  3605.  
  3606.            The maximum length of a string variable is 79 characters.
  3607.  
  3608.            String variables retain their contents between successive
  3609.            Phantom playbacks if DOS Phantom is not unloaded from memory in
  3610.            between.
  3611.  
  3612.  
  3613.  
  3614.         9.2.22. Working with Files
  3615.  
  3616.            A number of directives are available for working with files.
  3617.            They are listed here.
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.                                     57
  3629.  
  3630.  
  3631.  
  3632.                            DOS Phantom V2.9 Users Guide
  3633.  
  3634.  
  3635.  
  3636.            $FirstFile Sn <filename>
  3637.  
  3638.                 Locates the first file matching <filename> which may
  3639.                 include the * and ? wildcard characters and disk and
  3640.                 directory specifications. The filename is placed in Sn.
  3641.  
  3642.  
  3643.  
  3644.            $NextFile Sn
  3645.  
  3646.                 Locates the next file matching the <filename> in the last
  3647.                 $FirstFile executed. The filename is placed in Sn. If no
  3648.                 more files exist which match the <filename> specified in
  3649.                 the last $FirstFile, the string FILE NOT FOUND is
  3650.                 returned.
  3651.  
  3652.  
  3653.  
  3654.            $Read <file> Sn
  3655.  
  3656.                 Reads a line from file <file> into string variable Sn. The
  3657.                 file is opened if this is the first $Read from it. The
  3658.                 line must not exceed 80 characters in length.  The CR and
  3659.                 LF characters are ommitted.  When the end of file is
  3660.                 reached, $Read automatically closes the file.  (The
  3661.                 $IfClosed directive can be used to detect this condition.)
  3662.                 Subsequent $Reads of the file will begin at the start of
  3663.                 the file.
  3664.  
  3665.  
  3666.  
  3667.            $Write <file> <text>
  3668.  
  3669.                 Appends <text> to <file>. <Text> may contain string and
  3670.                 command line variables, for example: "parm1=$1, string
  3671.                 variable 3=$S3". (The quotation marks are not required
  3672.                 syntax.)  A CR-LF combination (a newline) is suffixed to
  3673.                 the text unless the text string is terminated with a $.
  3674.  
  3675.  
  3676.  
  3677.            $Close
  3678.  
  3679.                 Closes the file currently open for read, if any.
  3680.                 Subsequent reads of the file will begin at the start of
  3681.                 the file.
  3682.  
  3683.  
  3684.  
  3685.  
  3686.  
  3687.                                     58
  3688.  
  3689.  
  3690.  
  3691.                            DOS Phantom V2.9 Users Guide
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.            $IfClosed <label>
  3698.  
  3699.                 Branches to <label> if no $Read file is currently open.
  3700.                 This directive can be used to detect the end of file when
  3701.                 using $Read.
  3702.  
  3703.            The $FirstFile and $NextFile directives which allow you to
  3704.            perform directory searches from within Phantom scripts.
  3705.  
  3706.            When no more files match <filename>, the string FILE NOT FOUND
  3707.            is placed in Sn. Here is an example of a script which places
  3708.            the names of all the .PTM files in the PHANTOM directory into a
  3709.            file called PTMLIST.TXT:
  3710.  
  3711.  
  3712.                 $FirstFile S1 C:\PHANTOM\*.PTM
  3713.                 $IfEqual EndLoop S1 FILE NOT FOUND
  3714.                 $Loop:
  3715.                   $Write PTMLIST.TXT $S1
  3716.                   $NextFile S1
  3717.                   $IfEqual EndLoop S1 FILE NOT FOUND
  3718.                   $Goto Loop
  3719.                $EndLoop:
  3720.  
  3721.            Only one file may be open for read at a time. If a second
  3722.            filename is encountered in a $Read directive, the first is
  3723.            automatically closed. A subsequent $Read of the first file will
  3724.            close the second file and return the first line of the first
  3725.            file.
  3726.  
  3727.            The $IfClosed directive can be used to detect end of file since
  3728.            when $Read encounters the end of file, the file being read is
  3729.            closed. The result of the last $Read is invalid if the file was
  3730.            closed by the $Read. Thus, $IfClosed should be used before
  3731.            making use of lines returned by $Read.
  3732.  
  3733.  
  3734.  
  3735.         9.2.23. Substrings - The $F Directives
  3736.  
  3737.            V2.9 of DOS Phantom introduces a new type of directive: the $F
  3738.            directive. $F directives are similar to functions in
  3739.            programming languages in that when a $F directive is placed in
  3740.            a string, the result of the $F directive replaces the $F
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.                                     59
  3747.  
  3748.  
  3749.  
  3750.                            DOS Phantom V2.9 Users Guide
  3751.  
  3752.  
  3753.  
  3754.            directive in the string. $F directives take their arguments in
  3755.            parenthesis immediately following the directive name. No spaces
  3756.            are allowed between the directive name and the leading
  3757.            parenthesis, nor are any spaces allowed between the comma-
  3758.            separated arguments within the parentheses.
  3759.  
  3760.            Three $F directives have been implemented in V2.9: $FSubStr,
  3761.            $FBefore, and $FAfter. The $FSubStr directive extracts a
  3762.            substring from a string variable. Th format of $FSubStr is
  3763.  
  3764.             $FSubStr(Sn,<start>,<length>)
  3765.  
  3766.             where    Sn is the string variable from which to extract the
  3767.                           substring,
  3768.  
  3769.                      <start> is the character at which to start
  3770.                           extracting (1-based), and
  3771.  
  3772.                      <length> is the number of characters to extract.
  3773.  
  3774.            Here is an example of $FSubStr being used to extract the
  3775.            characters EFGHTUVW from the string ABCDEFGHIJKLMNOPQRSTUVWXYZ
  3776.            and placing them in S2:
  3777.  
  3778.  
  3779.                 $Assign S1 ABCDEFGHIJKLMNOPQRSTUVWXYZ
  3780.                 $Assign S2 $FSubStr(S1,5,4)$FSubStr(S1,20,4)
  3781.  
  3782.  
  3783.            $FBefore selects the portion of a string which appears before a
  3784.            specified character, while $FAfter selects the portion of a
  3785.            string which occurs after a specified character. For example,
  3786.  
  3787.  
  3788.                 $Assign S1 RECORDNG.PTM
  3789.                 $Assign S2 $FBefore(S1,.)
  3790.                 $Assign S3 $FAfter(S1,.)
  3791.  
  3792.            results in S2 containing RECORDNG (the substring before the
  3793.            period), and  S3 containg EXE (the substring after the period).
  3794.  
  3795.             $F directives can be used wherever the $Sn syntax is allowed,
  3796.            except in *-prefixed output lines. To output a substring as if
  3797.            it was being typed at the keyboard, you must $assign it to a
  3798.            string variable first, and then output the variable, like this:
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.                                     60
  3806.  
  3807.  
  3808.  
  3809.                            DOS Phantom V2.9 Users Guide
  3810.  
  3811.  
  3812.  
  3813.                 $Assign S6 $FSubStr(S3,1,8)
  3814.                 * rem THE SUBSTRING IS $S6.
  3815.  
  3816.  
  3817.  
  3818.            Here is a sample script which places the filenames of the files
  3819.            in the current directory minus their filetypes (the three
  3820.            characters after the period) in a file called TEST.TXT. It then
  3821.            types the file.
  3822.  
  3823.  
  3824.                 * DEL TEST.TXT
  3825.                 $FirstFile S1 *.*
  3826.                 $IfEqual EndLoop S1 FILE NOT FOUND
  3827.                 $Loop:
  3828.                   $Write TEST.TXT $FBefore(S1,.)
  3829.                   $NextFile S1
  3830.                   $IfEqual EndLoop S1 FILE NOT FOUND
  3831.                   $Goto Loop
  3832.                 $EndLoop:
  3833.                 * Type TEST.TXT
  3834.  
  3835.  
  3836.  
  3837.         9.2.24. Iterated Looping - the $On Directive
  3838.  
  3839.            V2.9 adds support for looping using the $On directive. The
  3840.            format of the $On directive is:
  3841.  
  3842.                 $On <count> <label>
  3843.  
  3844.            When the $On directive has been encountered <count> times,
  3845.            control is transferred to <label>. Before <count> times, the
  3846.            directive is ignored. Here is an example of a loop which copies
  3847.            200 lines from FILEA.TXT to FILEB.TXT unless the end of
  3848.            FILEA.TXT is encountered first:
  3849.  
  3850.  
  3851.                 $Loop:
  3852.                   $Read FILEA.TXT S1
  3853.                   $IfClosed EndLoop
  3854.                   $Write FILEB.TXT $S1
  3855.                   $On 200 EndLoop
  3856.                   $Goto Loop
  3857.                $EndLoop:
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.                                     61
  3865.  
  3866.  
  3867.  
  3868.                            DOS Phantom V2.9 Users Guide
  3869.  
  3870.  
  3871.  
  3872.            A maximum of 256 $On directives may be used in a single Phantom
  3873.            script.  The maximum count value is 32767.
  3874.  
  3875.  
  3876.  
  3877.         9.2.25. Playing Music - The $Music Directive
  3878.  
  3879.            The $Music directive allows you to play melodies from a Phantom
  3880.            script. $Music accepts a series of note/duration arguments,
  3881.            each of which specifies a musical note and the length of time
  3882.            for which is to be played. Four octaves supported with notes
  3883.            from C1 to B5. The following notes are supported:
  3884.  
  3885.            A, A#, Bb, C, C#, Dd, D, D#, Eb, F, F#, Gb, G, G#, Ab, R.
  3886.  
  3887.            R is a rest (no sound). Each note is suffixed with the octave
  3888.            in which it is to be played, a forward slash, and the number of
  3889.            ticks for which the note is to be sounded.
  3890.  
  3891.            Here is how the first few notes of "Mary Had A Little Lamb"
  3892.            might be specified in a Phantom script (played in octave 3):
  3893.  
  3894.             $Music R/80
  3895.             $Music E3/60 D3/20 C3/40 D3/40 E3/15 R/25 E3/15 R/25 E3/60 /20
  3896.             $Music D3/15 R/25 D3/15 R/25 D3/40 R/40 E3/40 G3/15 R/25 G3/40
  3897.             $Music R/80
  3898.  
  3899.  
  3900.            For those less musically inclined, numbers from 1 to 69 may be
  3901.            used in place of the musical notes.
  3902.  
  3903.  
  3904.  
  3905.         9.3. Hints and Tips
  3906.  
  3907.  
  3908.  
  3909.         9.3.1. Interrupting Directive Execution
  3910.  
  3911.            When a series of directives is executed without any intervening
  3912.            keystrokes, the attention hot key may be ignored for an
  3913.            extended period, making it difficult to interrupt the playback.
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.                                     62
  3924.  
  3925.  
  3926.  
  3927.                            DOS Phantom V2.9 Users Guide
  3928.  
  3929.  
  3930.  
  3931.         9.3.2. Recovering Editing Sessions
  3932.  
  3933.            To recover an aborted editing session with DOS Phantom, for
  3934.            example, you should make sure that everything is as it was when
  3935.            you started the recording: the same files with the same
  3936.            contents, the same default disk and directory, and so on.
  3937.  
  3938.  
  3939.  
  3940.         9.3.3. Using DOS Phantom in Batch Files
  3941.  
  3942.            To use DOS Phantom from a batch file, don't use the /I command
  3943.            line switch and end your recordings with the DOS EXIT command.
  3944.            To use scraper from a batch-initiated playback, invoke Scraper
  3945.            from within the playback without the /I switch.  When you are
  3946.            done with Scraper, remove it with the DOS EXIT command. Note
  3947.            that there will be two exit commands required to terminate the
  3948.            playback if Scraper is used.
  3949.  
  3950.  
  3951.  
  3952.         9.3.4. Playback Chaining
  3953.  
  3954.            Beginning with version 2.5, during playback you can chain to
  3955.            another file by invoking Phantom at the DOS command line from
  3956.            within the first file. Note that invoking Phantom for recording
  3957.            from within a playback file is *not* supported.
  3958.  
  3959.  
  3960.  
  3961.         9.3.5. Don't Use the Mouse
  3962.  
  3963.            DOS Phantom doesn't record mouse activity, so you have to do
  3964.            everything you want recorded on the keyboard.
  3965.  
  3966.  
  3967.  
  3968.  
  3969.  
  3970.  
  3971.  
  3972.  
  3973.  
  3974.  
  3975.  
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.                                     63
  3983.  
  3984.  
  3985.  
  3986.                            DOS Phantom V2.9 Users Guide
  3987.  
  3988.  
  3989.  
  3990.  
  3991.  
  3992.  
  3993.  
  3994.  
  3995.  
  3996.  
  3997.  
  3998.  
  3999.  
  4000.                    10. DOS Phantom Technical Information
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.            10.1. DOS Version Requirements
  4009.  
  4010.            DOS Phantom uses features first made available in MS-DOS V3.0,
  4011.            and will probably not execute properly on prior versions of MS-
  4012.            DOS.
  4013.  
  4014.  
  4015.  
  4016.  
  4017.  
  4018.            10.2. Memory Usage
  4019.  
  4020.            DOS Phantom V2.9, when installed as a TSR, uses approximately
  4021.            40K of memory.
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.  
  4035.  
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  
  4041.                                     64
  4042.  
  4043.  
  4044.  
  4045.                            DOS Phantom V2.9 Users Guide
  4046.  
  4047.  
  4048.  
  4049.  
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.              11. License, Warranty, Registration, and Support
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.            11.1. License
  4068.  
  4069.            DOS PHANTOM is not and has never been public domain software,
  4070.            nor is it free software.
  4071.  
  4072.            Non-licensed users are granted a limited license to use DOS
  4073.            PHANTOM on a 21-day trial basis for the purpose of determining
  4074.            whether DOS PHANTOM is suitable for their needs. The use of DOS
  4075.            PHANTOM, except for the initial 21-day trial, requires
  4076.            registration. The use of unlicensed copies of DOS PHANTOM by
  4077.            any person, business, corporation, government agency or any
  4078.            other entity is strictly prohibited. A single user license
  4079.            permits a user to use DOS PHANTOM only on a single computer.
  4080.            Licensed users may use the program on different computers, but
  4081.            may not use the program on more than one computer at the same
  4082.            time.
  4083.  
  4084.            No one may modify or patch the DOS PHANTOM executable files in
  4085.            any way, including but limited to decompiling, disassembling,
  4086.            or otherwise reverse engineering the program.
  4087.  
  4088.            A limited license is granted to copy and distribute DOS PHANTOM
  4089.            only for the trial use of customers, subject to the above
  4090.            limitations, and also the following:
  4091.  
  4092.                   o   DOS PHANTOM must be copied in unmodified form,
  4093.                       complete with the provided license and registration
  4094.                       information.
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.                                     65
  4101.  
  4102.  
  4103.  
  4104.                            DOS Phantom V2.9 Users Guide
  4105.  
  4106.  
  4107.  
  4108.                   o   The full machine-readable DOS PHANTOM documentation
  4109.                       must be included with each copy.
  4110.  
  4111.                   o   DOS PHANTOM may not be distributed in conjunction
  4112.                       with any other product without a specific license to
  4113.                       do so from P2 Enterprises.
  4114.  
  4115.                   o   No fee, charge, or other compensation may be
  4116.                       requested or accepted, except as authorized below:
  4117.  
  4118.                        o  Operators of electronic bulletin board systems
  4119.                           (sysops) may make DOS PHANTOM available for
  4120.                           downloading only as long as the above conditions
  4121.                           are met. An overall or time-dependent charge for
  4122.                           the use of the bulletin board system is
  4123.                           permitted as long as there is not a specific
  4124.                           charge for the download of DOS PHANTOM.
  4125.  
  4126.                        o  Vendors of user-supported or shareware software
  4127.                           approved by the ASP may distribute DOS PHANTOM,
  4128.                           subject to the above conditions, without
  4129.                           specific permission. Non-approved vendors may
  4130.                           distribute DOS PHANTOM only after obtaining
  4131.                           written permission from P2 Enterprises. Such
  4132.                           permission is usually granted. Please write for
  4133.                           details (enclose your catalog). Vendors may
  4134.                           charge a disk duplication and handling fee,
  4135.                           which, when pro-rated to the DOS PHANTOM
  4136.                           product, may not exceed eight dollars.
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  11.2. Limited Warranty
  4143.  
  4144.  
  4145.  
  4146.            THIS PRODUCT IS LICENSED "AS IS" WITHOUT ANY WARRANTY OF ANY
  4147.            KIND INCLUDING, BUT NOT LIMITED TO IMPLIED WARRANTIES OF
  4148.            MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
  4149.            WHICH ARE EXPRESSLY DISCLAIMED. SHOULD THE PROGRAM PROVE
  4150.            DEFECTIVE, THE PURCHASER ASSUMES THE RISK OF PAYING THE ENTIRE
  4151.            COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION AND ANY
  4152.            INCIDENTAL OR CONSEQUENTIAL DAMAGES. IN NO EVENT WILL P2
  4153.            ENTERPRISES BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.                                     66
  4160.  
  4161.  
  4162.  
  4163.                            DOS Phantom V2.9 Users Guide
  4164.  
  4165.  
  4166.  
  4167.            WITHOUT LIMITATION DAMAGES FOR LOSS OF BUSINESS PROFITS,
  4168.            BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION AND THE
  4169.            LIKE) ARISING OUT OF THE USE OR THE INABILITY TO USE THIS
  4170.            PRODUCT EVEN IF P2 ENTERPRISES HAS BEEN ADVISED OF THE
  4171.            POSSIBILITY OF SUCH DAMAGES.
  4172.  
  4173.            Use of this product for any period of time constitutes your
  4174.            acceptance of this agreement and subjects you to its contents.
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.            11.2.1. Government Restricted Rights
  4183.  
  4184.            Use, duplication, or disclosure by the Government is subject to
  4185.            restrictions as set forth in subdivision (b)(3)(ii) of the
  4186.            Rights in Technical Data and Computer Software clause at
  4187.            252.227-7013. Contractor/manufacturer is P2 Enterprises, P.O.
  4188.            Box 25, Ben Lomond, CA 95005-0025.
  4189.  
  4190.            The information in this document is subject to change without
  4191.            notice and does not represent a commitment on the part of P2
  4192.            Enterprises.
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  11.3. Registration
  4201.  
  4202.  
  4203.  
  4204.            This program is shareware. It is not free. If, after an
  4205.            evaluation period of 21 days, you wish to continue using this
  4206.            program, you must register and pay the registration fee. The
  4207.            order form at the end of this document may be used to register.
  4208.  
  4209.            In response to your registration, P2 Enterprises will send you
  4210.            a personalized Product Registration Key (PRK) which you can use
  4211.            with the REGISTER program to effect registration of this
  4212.            program.
  4213.  
  4214.  
  4215.  
  4216.  
  4217.  
  4218.                                     67
  4219.  
  4220.  
  4221.  
  4222.                            DOS Phantom V2.9 Users Guide
  4223.  
  4224.  
  4225.  
  4226.            Registration suppresses the display of the statements
  4227.            requesting that you register.
  4228.  
  4229.            Registration entitles you to three months of support from P2
  4230.            Enterprises as described in the following section.
  4231.  
  4232.            Your Product Registration Key can be used to register future
  4233.            versions of this program released within one year at no
  4234.            additional cost.
  4235.  
  4236.            Licenses for unlimited use on a single LAN, licenses for
  4237.            commercial distribution of this product as part of another
  4238.            product and a Programmer's Kit are also available. See the
  4239.            order form at the end of this document for details.
  4240.  
  4241.  
  4242.  
  4243.  
  4244.  
  4245.  11.4. Support
  4246.  
  4247.  
  4248.  
  4249.         11.4.1. P2 Technical Support
  4250.  
  4251.            Registered users receive three months of support from P2
  4252.            Enterprises. P2 Enterprises will answer questions and fix
  4253.            serious bugs during the three month support period. P2
  4254.            Enterprises may choose not to attempt a fix to a problem
  4255.            involving a specific hardware or software environment or
  4256.            feature. If this is the case, a full refund of the registration
  4257.            fee will be made upon your request.
  4258.  
  4259.            P2 Enterprises may be reached via a VoiceMail system at (408)
  4260.            336-8080 mailbox 9090, or via CompuServe ID 70621,2475, by
  4261.            Internet mail at p2p2p2@cruzio.santa-cruz.ca.us, or by US Mail
  4262.            at PO Box 25, Ben Lomond CA 95005-0025 USA. The VoiceMail
  4263.            system is in operation between the hours of 6AM and 6PM Pacific
  4264.            Time.
  4265.  
  4266.  
  4267.  
  4268.         11.4.2. The P2 Enterprises Customer Service BBS
  4269.  
  4270.            P2 Enterprises maintains a dial-in Customer Service BBS.  The
  4271.            latest versions of all P2 shareware products are always
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.                                     68
  4278.  
  4279.  
  4280.  
  4281.                            DOS Phantom V2.9 Users Guide
  4282.  
  4283.  
  4284.  
  4285.            available on the P2 BBS. In addition, lists of frequently asked
  4286.            questions are available for perusal or download.  Also, you can
  4287.            upload file to P2 Tech Support if you wish.  The BBS is on-line
  4288.            weeknights between 6PM and 6AM and 24 hrs on weekends. (The BBS
  4289.            shares the phone line with our voicemail system.)  The number
  4290.            for the P2 Enterprises Customer Service BBS is (408) 336-8080.
  4291.  
  4292.  
  4293.  
  4294.         11.4.3. The ASP Ombudsman
  4295.  
  4296.            P2 Enterprises is a member of the Association of Shareware
  4297.            Professionals (ASP). ASP wants to make sure that the shareware
  4298.            principle works for you. If you are unable to resolve a
  4299.            shareware-related problem with an ASP member by contacting the
  4300.            member directly, ASP may be able to help. The ASP Ombudsman can
  4301.            help you resolve a dispute or problem with an ASP member, but
  4302.            does not provide technical support for members' products.
  4303.            Please write to the ASP Ombudsman at 545 Grover Road, Muskegon,
  4304.            MI 49442 or send a CompuServe message via CompuServe Mail to
  4305.            ASP Ombudsman 70007,3536.
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.  
  4328.  
  4329.  
  4330.  
  4331.  
  4332.  
  4333.  
  4334.  
  4335.  
  4336.  
  4337.                                     69
  4338.                          REGISTRATION INFORMATION
  4339.  
  4340.      ======================================================================
  4341.            P2 Enterprises, P.O. Box 25, Ben Lomond, CA 95005-0025
  4342.      ======================================================================
  4343.  
  4344.      PRODUCT REGISTRATION KEYS (PRK)
  4345.  
  4346.      Upon receiving payment for registration, P2 Enterprises will send you
  4347.      by mail a personalized Product Registration Key (PRK) which, used with
  4348.      the Register Main Menu option, will allow you to register your current
  4349.      copy of the software as well as future versions for a period of one
  4350.      year, without additional charge or paperwork.
  4351.  
  4352.      A separate Product Registration Key is required for each copy of the
  4353.      software.  (A single copy may be moved from computer to computer, but
  4354.      if it is executed at the same time on different computers, it is
  4355.      regarded as constituting multiple copies requiring multiple
  4356.      registrations.)
  4357.  
  4358.  
  4359.      DISKETTES
  4360.  
  4361.      If you wish, we will mail you diskettes containing the latest version
  4362.      of the product(s) along with your Product Registration Key(s).  There
  4363.      is an additional charge of US$4.00 per product for diskettes.  Be sure
  4364.      to specify whether you prefer 3-1/2 or 5-1/4 inch diskettes.
  4365.  
  4366.  
  4367.      QUANTITY PURCHASES
  4368.  
  4369.      The order form on the following may be used to purchase multiple
  4370.      copies with discounts as follows:
  4371.  
  4372.                  1 - 5 copies      no discount
  4373.                  6 and up          33% discount
  4374.  
  4375.      The name on the order form is the person whose name wil be associated
  4376.      with the Product Registration Key(s).
  4377.  
  4378.  
  4379.      PAYMENT
  4380.  
  4381.      Payment may be by cash, check, postal money order, or credit card.
  4382.      VISA and Mastercard are accepted.
  4383.  
  4384.      Checks denominated in US Dollars must be drawn on a US bank.  You may
  4385.      pay with a check denominated in other than US Dollars if you first
  4386.      add 5% to the registration fee before conversion to US Dollars at the
  4387.      prevailing exchange rate.
  4388.  
  4389.  
  4390.                          REGISTRATION INFORMATION
  4391.                                (continued)
  4392.  
  4393.      REGISTRATION BY PHONE
  4394.  
  4395.      If you are paying by credit card, you may register using our voicemail
  4396.      system weekdays at (408) 336-8080 mailbox 9090. Leave your credit card
  4397.      information and we will call you back with your registration key, usually
  4398.      the same day. You may also register via the P2 Enterprises Customer
  4399.      Service BBS. The BBS is available weeknights between 6PM and 6AM Pacific
  4400.      Time and 24 hours on weekends at (408) 336-8080. (Our voicemail and BBS
  4401.      share the phone line and computer hardware.)
  4402.  
  4403.  
  4404.      AVAILABILITY
  4405.  
  4406.      All orders are shipped within 10 working days after receipt of the
  4407.      registration fee.  Most orders are shipped within 48 hours.
  4408.                        DOS PHANTOM REGISTRATION AND ORDER FORM
  4409.     -------------------------------------------------------------------
  4410.     Remit to:   P2 Enterprises, P.O. Box 25, Ben Lomond, CA  95005-0025
  4411.     -------------------------------------------------------------------
  4412.     Qty Item                                   Price
  4413.     ===================================================================
  4414.     ___ DOS Phantom Single User PRK            @ US$40.00    US$_______
  4415.  
  4416.     ___ DOS Phantom Single User PRK + diskette @ US$44.00    US$_______
  4417.  
  4418.     ___ DOS Phantom Laser-printed Users Guide  @ US$12.00    US$_______
  4419.  
  4420.     ___ DOS Phantom Quick Reference Booklet    @  US$1.00    US$_______
  4421.         (One FREE with each registration.)
  4422.  
  4423.     ___ DOS Phantom Multi-User LAN License     @US$120.00    US$_______
  4424.         Allows unlimited use on a single LAN.  A separate
  4425.         license is required for each LAN installation.
  4426.  
  4427.     ___ DOS Phantom Commercial Distribution   @ US$240.00    US$_______
  4428.         License
  4429.         Allows unlimited distribution of the PHANTOM2.EXE
  4430.         file with another product. Other programs may not
  4431.         be distributed.
  4432.  
  4433.     ___ Borland C Phantom Programmer's Kit     @ US$180.00   US$_______
  4434.         C source code module which performs TXT2PTM translation
  4435.         for use in application programs and a play-only version of
  4436.         PHANTOM2.EXE.  No restriction on use for commercial purposes.
  4437.  
  4438.     ___ Microsoft C Phantom Programmer's Kit   @ US$180.00   US$_______
  4439.  
  4440.                                             Volume Discount  US$(______)
  4441.  
  4442.                 Outside North America
  4443.                 add $3 per diskette or users guide ordered   US$_______
  4444.  
  4445.                 California residents add state
  4446.                 and county taxes (at least 6.5%)             US$_______
  4447.  
  4448.  
  4449.      Diskette size:  ___ 3.5   ___ 5.25               TOTAL  US$_______
  4450.  
  4451.      __Visa  __Mastercard  __Amex  __Discover __DinersClub
  4452.  
  4453.      Account Number____________________________  Expir.Date____________
  4454.  
  4455.          Name__________________________________________________________
  4456.  
  4457.       Company__________________________________________________________
  4458.  
  4459.       Address__________________________________________________________
  4460.  
  4461.              ________________________________ Phone____________________
  4462.  
  4463.       Where did you obtain your copy of DOS Phantom?___________________
  4464.