home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / CO / CO029A.ZIP / CA28-2.ZIP / CASCRIPT.DOC next >
Text File  |  1991-07-22  |  271KB  |  8,801 lines

  1. COM-AND: IBM PC Communication Script Language
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.           ------------------------------------------
  18.           COM-AND:    Communications Script Language
  19.                  for the IBM PC
  20.           ------------------------------------------
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.     COM-AND is distributed freely and may be copied by anyone for
  33.     any number of machines, for purposes of evaluation.  The author
  34.     offers COM-AND and its accessory programs as a package, as
  35.     "shareware".  If you USE the program a registration of $50.00 is
  36.     required.  The author may be reached:
  37.  
  38.  
  39.                  CABER Software
  40.                  R. (Scott) McGinnis
  41.                  P.O. Box 3607 Mdse Mart
  42.                  Chicago, IL 60654-0607
  43.  
  44.                  PLINK, GEnie id: TARTAN
  45.                  CIS id: 73147,2665
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. Version 2.8: 910717
  55.  
  56. COM-AND: IBM PC Communication Script Language
  57.  
  58.  
  59.  
  60.     COM-AND version 2.8 is copyright 1991 CABER Software (R.  Scott
  61.     McGinnis).  All rights are reserved world wide, excepting redistri-
  62.     bution under the ShareWare concept.  COM-AND is distributed freely
  63.     and may be copied by anyone for any number of machines, under the
  64.     ShareWare concept.  Restrictions on redistribution are discussed in
  65.     the accompanying document VENDOR.DOC.
  66.  
  67.  
  68.     COM-AND is distributed as ShareWare.  You may use COM-AND without
  69.     charge for the purposes of evaluating its usefulness.  It is sug-
  70.     gested that this evaluation period be limited to a few days of actual
  71.     use.  If you find COM-AND to be worth continued use, then you must
  72.     pay for it.  Please complete the form REGISTER.DOC and mail it with
  73.     your payment.
  74.  
  75.  
  76.     Registration of COM-AND includes all published accessory programs
  77.     (which currently are PC-VCO, CCHESS, CBRIDGE, and CCOLOR), and
  78.     several utilities (unPACKIT and unSTUFIT).  Accessories and utili-
  79.     ties are published separately.    One registration covers the use of
  80.     any and all of these programs.
  81.  
  82.  
  83.     By registering your copy of COM-AND (or any ShareWare product), you
  84.     are promoting and supporting the convenient distribution method and
  85.     free evaluation policy that brought you this copy of COM-AND.
  86.  
  87.  
  88.     If you have received this copy from a Users' Group, "Software
  89.     Library" or "SIG", and have paid a small fee (usually $3 to $10),
  90.     you have NOT acquired a registration or continued right to use
  91.     COM-AND.  This fee was for the convenience of obtaining the diskette
  92.     with COM-AND on it.  The fee does NOT apply to the registration fee.
  93.  
  94.  
  95.     You may NOT distribute COM-AND or its documentation in connection
  96.     with ANY commercial venture, product, publication or service without
  97.     written approval.  COM-AND may not be disassembled or modified
  98.     without express written consent of its author.
  99.  
  100.  
  101.     COM-AND is supplied "as-is" with no warranties expressed or implied.
  102.     Neither CABER Software nor the author will be liable for any damages
  103.     or lost revenues incurred through the use of this program or any of
  104.     its accessories and utilities beyond the registration price paid.
  105.  
  106.  
  107.  
  108.  
  109. Version 2.8: 910717
  110.  
  111. COM-AND: IBM PC Communication Script Language
  112.  
  113.  
  114.  
  115.     COM-AND version 2.8 is available as shareware through PLINK, GEnie,
  116.     UNISON, NWI, Delphi and CIS.  COM-AND is also available through many
  117.     Bulletin Board systems.  Individuals are welcome to download COM-AND
  118.     for purposes of evaluation, and to upload COM-AND (in its entirety)
  119.     to Bulletin Board systems.
  120.  
  121.     Commercial users of COM-AND must register COM-AND with the author or
  122.     one of the individuals listed on this page.  Site licenses (multiple
  123.     copy registrations) are available from:
  124.  
  125.         CABER Software
  126.         R. (Scott) McGinnis
  127.         P.O. Box 3607 Mdse Mart
  128.         Chicago, IL 60654-0607
  129.  
  130.         PLINK, GEnie, Delphi ID: TARTAN
  131.         CIS id: 73147,2665
  132.  
  133.     A COM-AND BBS (using a version of COM-AND's BBS script) is operated
  134.     by SupportWare of Long Beach, CA.  SupportWare is licensed to nego-
  135.     tiate COM-AND commercial and site licenses, and provide COM-AND
  136.     support.  SupportWare offers considerable expertise in the field of
  137.     communications consultation.  Contact SupportWare through:
  138.  
  139.         SupportWare
  140.         Mike Todd
  141.         P.O. Box 14927
  142.         Long Beach, CA 90803-1449
  143.  
  144.         Voice: (213) 439-6104
  145.         BBS:   (213) 439-7714 (1200/2400 8n1)
  146.  
  147.     In Japan, COM-AND may be downloaded as shareware from PC-VAN.  It
  148.     is also available in Japan as a commercial product tailored for
  149.     specific machines through:
  150.  
  151.         Discotel Japan (Ciari Soft)
  152.         Kurakuen 3 ban-cho 2-50
  153.         Nishinomiya 662
  154.         Japan
  155.  
  156.         Contact: Claude Ciari
  157.         Tel (0798)73-0052
  158.         PC-VAN NEC by Ciari
  159.         ID: CCIARI
  160.  
  161.  
  162.  
  163.  
  164. Version 2.8: 910717
  165.  
  166. COM-AND: IBM PC Communication Script Language
  167.  
  168.  
  169.     THE ASSOCIATION OF SHAREWARE PROFESSIONALS (ASP)
  170.  
  171.         ┌─────────┐
  172.       ┌─────┴───┐      │          (R)
  173.     ──│        │o      │──────────────────
  174.       │   ┌─────┴╨──┐ │  Association of
  175.       │   │     │─┘  Shareware
  176.       └───│    o    │    Professionals
  177.     ──────│    ║    │────────────────────
  178.           └────╨────┘    MEMBER
  179.  
  180.  
  181.     In 1987 Shareware authors founded the Association of Shareware
  182.     Professionals (ASP).  In forming this industry association, these
  183.     Shareware authors had several primary goals in mind, including:
  184.  
  185.        .  To inform users about Shareware programs and about Shareware as
  186.           a method of distributing and marketing software.
  187.  
  188.        .  To foster professionalism amongst Shareware authors by setting
  189.           programming, marketing, and support standards for ASP members.
  190.  
  191.        .  To encourage broader distribution of Shareware through user
  192.           groups and disk dealers who agree to identify and explain the
  193.           nature of Shareware.
  194.  
  195.        .  To provide a forum through which ASP members may communicate,
  196.           share ideas, and learn from each other.
  197.  
  198.     ASP OMBUDSMAN STATEMENT
  199.  
  200.     CABER Software (R.  Scott McGinnis) is a member of the Association of
  201.     Shareware Professionals (ASP).    ASP wants to ensure that the Share-
  202.     ware principle works for you.  If you are unable to resolve a Share-
  203.     ware-related problem with an ASP member by contacting the member
  204.     directly, ASP may be able to help.  The ASP Ombudsman can help you
  205.     resolve a dispute or problem with an ASP member, but does not provide
  206.     technical support for members' products.
  207.  
  208.     Please write to the ASP Ombudsman at:
  209.  
  210.        ASP Ombudsman
  211.        Association of Shareware Professionals
  212.        545 Grover Road
  213.        Muskegon, MI  49442-9427
  214.  
  215.     or send a CompuServe message via CompuServe MAIL to ASP Ombudsman
  216.     70007,3536.
  217.  
  218.  
  219. Version 2.8: 910717
  220.  
  221. COM-AND: IBM PC Communication Script Language
  222.  
  223.  
  224.                  Table of Contents
  225.                  -----------------
  226.  
  227. I.    COM-AND Introduction  ...................................... page 1
  228. II.    Script Introduction  ....................................... page 2
  229. III.    Definitions  ............................................... page 4
  230.  
  231.     A. Comments ................................................ page 4
  232.     B. Labels .................................................. page 4
  233.     C. Keywords ................................................ page 5
  234.     D. Commands ................................................ page 5
  235.     E. Strings ................................................. page 6
  236.     F. Numerics ................................................ page 7
  237.     G. States .................................................. page 8
  238.  
  239. IV.    Syntax    .................................................... page 9
  240. V.    Script Language Commands ................................... page 11
  241.  
  242.     Commands beginning "A"...................................... page 11
  243.     Commands beginning "B"...................................... page 14
  244.     Commands beginning "C"...................................... page 15
  245.     Commands beginning "D"...................................... page 20
  246.     Commands beginning "E"...................................... page 26
  247.     Commands beginning "F"...................................... page 29
  248.     Commands beginning "G"...................................... page 39
  249.     Commands beginning "H"...................................... page 43
  250.     Commands beginning "I"...................................... page 44
  251.     Commands beginning "J"...................................... page --
  252.     Commands beginning "K"...................................... page 52
  253.     Commands beginning "L"...................................... page 52
  254.     Commands beginning "M"...................................... page 54
  255.     Commands beginning "N"...................................... page 59
  256.     Commands beginning "O"...................................... page 60
  257.     Commands beginning "P"...................................... page 62
  258.     Commands beginning "Q"...................................... page 63
  259.     Commands beginning "R"...................................... page 64
  260.     Commands beginning "S"...................................... page 67
  261.     Commands beginning "T"...................................... page 77
  262.     Commands beginning "U"...................................... page 79
  263.     Commands beginning "V"...................................... page 79
  264.     Commands beginning "W"...................................... page 80
  265.     Commands beginning "X"...................................... page --
  266.     Commands beginning "Y"...................................... page --
  267.     Commands beginning "Z"...................................... page --
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274. Version 2.8: 910717
  275.  
  276. COM-AND: IBM PC Communication Script Language
  277.  
  278.  
  279.                  Table of Contents
  280.                  -----------------
  281.  
  282. VI.    SET Commands  .............................................. page 85
  283.  
  284.     A. Basic set ............................................... page 85
  285.     B. SET ASCII ............................................... page 100
  286.     C. SET KERMIT .............................................. page 101
  287.     D. SET ZMODEM .............................................. page 103
  288.  
  289. VII.    String Intrinsics  ......................................... page 104
  290. VIII.    Script Errors .............................................. page 108
  291. IX.    ASPECT 1.x and PROCOMM 2.x scripts ......................... page 109
  292. X.    Program Requirements ....................................... page 111
  293. XI.    Program and Author Information    ............................ page 112
  294.  
  295.  
  296.                 Appendices
  297.                 ----------
  298.  
  299. A.    Sample scripts    ............................................ page 113
  300. B.    Host and BBS scripts  ...................................... page 116
  301. C.    External Protocol Drivers  ................................. page 117
  302. D.    Encoded Music  ............................................. page 119
  303. E.    File transfer error numbers  ............................... page 122
  304. F.    EBL  ....................................................... page 124
  305. G.    Manual setting and scripts ................................. page 125
  306.  
  307.     1. Alt-S (Setup window) .................................... page 125
  308.     2. Alt-O (Options window) .................................. page 126
  309.     3. Alt-P (Parameters window) ............................... page 127
  310.     4. Alt-K (KERMIT defaults window) .......................... page 128
  311.     5. Alt-J (Colors window) ................................... page 128
  312.     6. Help (General Help list) ................................ page 129
  313.  
  314. H.    STACK and Macro keycodes  .................................. page 130
  315. I.    Dynamic string variables ................................... page 131
  316. J.    Flow control methods ....................................... page 133
  317. K.    Machine language subroutines ............................... page 135
  318. L.    CACMP ...................................................... page 139
  319. M.    Script Language (version 1.x) .............................. page 140
  320. N.    Language Summary ........................................... page 143
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329. Version 2.8: 910717
  330.  
  331. COM-AND: IBM PC Communication Script Language                 Page   1
  332.  
  333.  
  334. I.    COM-AND Introduction
  335.  
  336.  
  337.     COM-AND for the IBM PC and compatibles is a communications program
  338.     that may be used by itself, or with several integrated accessory
  339.     programs (which themselves may be used independent of COM-AND).
  340.     COM-AND provides standard comm program functions:  a dialing
  341.     directory, macros, disk logging, binary and ASCII file transfers,
  342.     and most particularly: scripted execution.
  343.  
  344.  
  345.     COM-AND Version 2.8 executes as a CRT based comm program either in 25
  346.     line text mode on a CGA or monochrome screen, or 25/43 line mode on
  347.     an EGA display.  When an accessory is loaded through COM-AND (or when
  348.     COM-AND is loaded by an accessory), most of the functions of COM-AND
  349.     are available through the accessory.
  350.  
  351.  
  352.     COM-AND and its accessories (PC-VCO, CCHESS, CBRIDG, and CCOLOR) may
  353.     be copied freely and distributed to anyone for any number of
  354.     machines.  The author offers COM-AND as "shareware".  If the program
  355.     is used after a reasonable period of evaluation, a registration of
  356.     $50.00 is asked for the entire package.
  357.  
  358.  
  359.     COM-AND provides a script language for automation of certain tasks.
  360.     COM-AND is distributed with a KERMIT server, a HOST mode, a Bulletin
  361.     board, a file manager, and a LEARN MODE... all as scripts.  Scripts
  362.     may be written for COM-AND by anyone, requiring only an editor that
  363.     produces ASCII files.  COM-AND will execute scripts written for the
  364.     very popular PROCOMM 2.x and PCPLUS 1.x programs as well.
  365.  
  366.  
  367.     This document discusses scripted execution, and the COM-AND Script
  368.     Language.  The script language has grown over the years to the point
  369.     where its documentation requires a separate file.  For manual use
  370.     of COM-AND, and functional overview, the reader is referred to the
  371.     document COM-AND.DOC.
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384. Version 2.8: 910717
  385.  
  386. COM-AND: IBM PC Communication Script Language                 Page   2
  387.  
  388.  
  389. II.    Script Introduction
  390.  
  391.  
  392.     The script processor allows certain manual tasks to be automated,
  393.     and COM-AND to run unattended (if you have tested the script !!!).
  394.     Scripts are invoked in several ways:
  395.  
  396.     o    at load time:
  397.  
  398.         .. COM-AND.CMD, if present in the current directory or the
  399.            subdirectory indicated by the 'COM-AND=' environment
  400.            variable, is executed immediately;
  401.  
  402.         .. the /F switch in the run command may specify a script to
  403.            be executed immediately (after COM-AND.CMD, if present);
  404.  
  405.     o    interactively (through F2) as a script
  406.  
  407.     o    interactively (through F1) as an accessory or part of one
  408.  
  409.     o    a script may be attached to a dialing directory entry, to
  410.         be executed upon successful connection
  411.  
  412.     o    through a macro and similar methods
  413.  
  414.  
  415.     Script commands are read by COM-AND from an ASCII file (word
  416.     processor files are not usually ASCII files!).    Programmer's text
  417.     editors and EDLIN (provided with DOS) may be used to create and
  418.     modify a script file.  If you wish to use a word processor to update
  419.     a script, first ensure that the particular word processor will output
  420.     an ASCII file (often called non-document format, perhaps even called
  421.     ASCII).
  422.  
  423.  
  424.     Once a script begins, execution of COM-AND is automatic, driven by
  425.     the script.  However, the ESC key may be used to terminate the
  426.     script at most any time (depending on the script.  The script author
  427.     might make ESC unusable).  During dialing, two ESCs are needed...
  428.     one to terminate the dial function, and the second to end script.
  429.  
  430.  
  431.     Generally speaking, a script usually takes the form:
  432.  
  433.         <perform some action>
  434.         <wait for an identifiable response>
  435.         <perform some action...
  436.         ... and so on
  437.  
  438.  
  439. Version 2.8: 910717
  440.  
  441. COM-AND: IBM PC Communication Script Language                 Page   3
  442.  
  443.  
  444. II.    Script Introduction (continued)
  445.  
  446.  
  447.     For example, a script might dial a number listed in the dialing
  448.     directory and wait for the "ID = " response from the dialed host.
  449.     The next action would be to send the logon ID, with a carriage
  450.     return and await a prompt for a password.
  451.  
  452.  
  453.     The scripts included with COM-AND are examples of such simple
  454.     scripts.  However:  the COM-AND script language is not limited to
  455.     communications related tasks...  programs may be loaded and passed
  456.     parameters, screen windows may be opened and scrolled, and so on.
  457.     A nontrivial BBS has been written using COM-AND's scripting, and is
  458.     provided with the distribution for the interested (and wary)!
  459.  
  460.  
  461.     It is taken for granted that the script programmer is acquainted with
  462.     the computer and telecommunications environment in general, and the
  463.     COM-AND program in particular.    Much of the script language facility
  464.     revolves around making the features of COM-AND available to the
  465.     programmer.  After that, the remainder of the language makes the
  466.     computer (e.g.    read and write files), and the communications line
  467.     (e.g.  read and write lines of text) available to the programmer.
  468.  
  469.  
  470.     Details of the features of COM-AND are discussed in the COM-AND.DOC
  471.     document.  Much of the discussion to follow assumes familiarity with
  472.     that document.
  473.  
  474.  
  475.     The next few pages define terms used in discussing scripts and script
  476.     language elements.  Notational symbols will then be defined.  After
  477.     that, script language elements will be presented in detail.  Appendix
  478.     M summarizes the version 1.x script language.  Appendix N summarizes
  479.     the version 2 and 3.x languages.  Sample scripts are presented in
  480.     Appendix A.
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494. Version 2.8: 910717
  495.  
  496. COM-AND: IBM PC Communication Script Language                 Page   4
  497.  
  498.  
  499. III.    Definitions
  500.  
  501.  
  502.     A. Comments:
  503.  
  504.        Comments may be used (and are highly recommended!) alone on a
  505.        line, on a command line (after the command) or on a label line
  506.        (after the label).  A comment begins with a semi-colon or asterisk
  507.        and extends to the end of the line.
  508.  
  509.        Blank lines are also treated as comments, for phrasing.  Top-of-
  510.        form, appearing in the first column, is treated as a comment.
  511.  
  512.  
  513.     B. Labels:
  514.  
  515.        Labels are character strings terminated with a colon, not
  516.        including the characters:  blank, comma(,), exclamation (!),
  517.        number sign (#), dollar sign ($), percent sign (%), ampersand (&),
  518.        apostrophe ('), double quote ("), left and right parenthesis,
  519.        asterisk (*), plus (+), hyphen (-, minus), right slash (/), and
  520.        semi-colon(;).
  521.  
  522.        Only the first 8 characters of the label are significant to the
  523.        script processor; if two labels match for the first 8 characters,
  524.        the one closest to the beginning of the script will be used, and
  525.        the second ignored.
  526.  
  527.        Case is not significant in labels.
  528.  
  529.        Comments are allowed on a line with a label (comments begin with
  530.        semi-colon or asterisk and extending to the end of the line).
  531.  
  532.        Commands are not allowed on a line with a label.
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549. Version 2.8: 910717
  550.  
  551. COM-AND: IBM PC Communication Script Language                 Page   5
  552.  
  553.  
  554. III.    Definitions (continued)
  555.  
  556.  
  557.     C. Keywords:
  558.  
  559.        Keywords are alphanumeric character strings terminated by a blank,
  560.        a comma, a left parenthesis, or a semi-colon.  Only the first 4
  561.        characters of the keyword are significant to the script processor
  562.        (where keywords are the same for the first 4 letters, the last
  563.        letter is used to distinguish them).
  564.  
  565.  
  566.        Case is not significant in keywords.
  567.  
  568.  
  569.     D. Commands:
  570.  
  571.        Commands are structured:  <keyword> followed by arguments (if
  572.        any).  Delimiters between command arguments are blank and comma.
  573.        Each command is a line by itself (with the exception of the IF
  574.        statement which may contain a second command).  Comments are
  575.        allowed after the command (comments begin with semi-colon or
  576.        asterisk and extend to the end of the line).
  577.  
  578.  
  579.        COM-AND implements a stack for GOSUB, IF, SWITCH, FOR, DO and
  580.        WHILE commands.  This allows these commands to be nested to 20
  581.        levels.  A 'stack overflow' message is issued when nesting of
  582.        more than 20 is attempted.  A 'stack underflow' message is issued
  583.        when a RETURN is encountered for which no corresponding GOSUB was
  584.        issued.
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.  
  602.  
  603.  
  604. Version 2.8: 910717
  605.  
  606. COM-AND: IBM PC Communication Script Language                 Page   6
  607.  
  608.  
  609. III.    Definitions (continued)
  610.  
  611.  
  612.     E. Strings:
  613.  
  614.        String arguments are of two kinds:  literal and variable.  Literal
  615.        strings are enclosed in double quotes (").  The accent grave (`)
  616.        is used in a literal string to force the next character (e.g. the
  617.        string "`"" is a literal consisting of a double quote by itself).
  618.  
  619.  
  620.        String variables are referred to as S0, S1, ...  S29.  Each string
  621.        variable is 80 characters wide, and may be set with the Sx=,
  622.        ASSIGN, GET, and RGET statements.  They are set to blank when the
  623.        script begins (but are not reset to blanks when EXECUTE or FCALL
  624.        moves the script processor to a new script file).
  625.  
  626.  
  627.        Strings are manipulated internally exactly as given.  However,
  628.        when issued (to the console or out the comm port, or in some cases
  629.        to disk), or used in WHEN string, certain edits are performed:
  630.  
  631.        o       Trailing blanks are trimmed
  632.        o       "!" by itself (except "!!") is translated into a
  633.            carriage return
  634.        o       "^x" (except ^^) where 'x' is character "@" through "`"
  635.            is translated into the corresponding control character
  636.        o       Certain strings are treated as "intrinsic"s.  Refer
  637.            to chapter VII of this document for further discussion.
  638.  
  639.        Refer below to the "Sx = <expression>" discussion on page 77 for
  640.        details on string expressions.
  641.  
  642.  
  643.        Another set of string variables may be dynamically allocated by a
  644.        script (or scripts).  These variables are referred to as V0, V1,
  645.        ...    Vx, where 'x' is determined by the allocating script.
  646.        Dynamic string variables may be used anywhere static variables are
  647.        used, AFTER A SCRIPT ALLOCATES THEM.  Refer to appendix 'I' for a
  648.        discussion of these variables and their use.
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659. Version 2.8: 910717
  660.  
  661. COM-AND: IBM PC Communication Script Language                 Page   7
  662.  
  663.  
  664. III.    Definitions (continued)
  665.  
  666.  
  667.     F. Numerics:
  668.  
  669.        Numeric arguments are of two kinds:    literal and variable.  The
  670.        literal numerics are values alone or within double quotes, or as
  671.        a string within a string variable.  Decimal values with the range
  672.        -32,768 to 32,767 are supported.  Hexadecimal values may be
  673.        specified using the 'C' convention (e.g.  0xffff is -1).
  674.  
  675.  
  676.        Numeric variables are referred to as N0, N1, ...  N99.  Each
  677.        numeric variable is capable of storing the value -32,768 to
  678.        32,767.  All are set to zero when the script begins (but not
  679.        reset to zeroes when an EXECUTE or FCALL statement moves the
  680.        script processor to a new script file).
  681.  
  682.  
  683.        Refer below to the "Nx = <expression>" discussion on page 59
  684.        for details on numeric expressions.    Numeric expressions are
  685.        allowed in place of single numeric values (where a value is
  686.        required) in all commands except:  ADD, SUB, MUL and DIV, IF
  687.        EQ/LT/...  and IF ZERO.  An expression may be used in these
  688.        commands only if it is entirely contained within parentheses.
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714. Version 2.8: 910717
  715.  
  716. COM-AND: IBM PC Communication Script Language                 Page   8
  717.  
  718.  
  719. III.    Definitions (continued)
  720.  
  721.  
  722.     G. States:
  723.  
  724.        o    String variables are set to blank at the start of a script.
  725.  
  726.        o    Numeric variables are set to zero at the start of a script.
  727.  
  728.        o    EXECUTE does not reset string or numeric variables or clear
  729.         any conditions (SUCCESS/FAILED/WAITFOR/etc).  Neither does
  730.         EXECUTE clear WHEN settings.
  731.  
  732.        o    EXECUTE clears any IF and SWITCH function and GOSUB stack.
  733.  
  734.        o    FCALL does not allow 'branch-back' from a called file to a
  735.         label in the calling file.  FCALL does not reset the ON
  736.         ESCAPE implicit GOSUB (which potentially is a branch-back),
  737.         so be careful!.
  738.  
  739.        o    GOTO must not be used to enter an IF clause or SWITCH case,
  740.         even from within an IF clause or SWITCH.
  741.  
  742.        o    Received text is not processed until RGET, PAUSE or WAITFOR
  743.         instructions are performed.
  744.  
  745.        o    Keystrokes entered during a script are transmitted out the
  746.         comm port (unless HITKEY or SET TTHRU has been invoked).
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769. Version 2.8: 910717
  770.  
  771. COM-AND: IBM PC Communication Script Language                 Page   9
  772.  
  773.  
  774. IV.    Syntax
  775.  
  776.  
  777.     The chapter defines symbols that will be used in command syntax
  778.     descriptions.  Of necessity, some will seem cryptic at first...
  779.     bear with me, please.
  780.  
  781.  
  782.     ->         Author's note.  A command highlighted with '->'
  783.              IS compatible with ASPECT 1.x and PROCOMM 2.x scripting.
  784.  
  785.     *         Author's note.  A command highlighted with '*'
  786.              is documented for ASPECT 1.x compatiblity, but not
  787.              implemented in this version of COM-AND.
  788.  
  789.     [A]         optional keyword A
  790.  
  791.     (A!B!C...)   Required choice: A or B or C ...
  792.  
  793.     Sx         String variable S0, S1, S2 ...S29
  794.     Vx         String variable (dynamic) V0, V1 ...V99
  795.     Nx         Numeric variable N0, N1, N2 ...N99
  796.  
  797.  ->    <label>      Label identifier     (1) literal value (e.g. LABEL)
  798.  ->                     (2) a string variable (e.g.  S0)
  799.  ->                         containing a label name
  800.                      (3) a quoted string (e.g.  "...")
  801.  
  802.  ->    <string>     Textual value, i.e. (1) a quoted string (e.g. "...")
  803.  ->                     (2) a string variable (e.g. S0)
  804.                      (3) a substring (e.g. S0(4:5),
  805.                          being position 4 through 5)
  806.                      (4) a string expression
  807.  
  808.  ->    <number>     Numeric value, i.e. (1) a quoted number (e.g. "4")
  809.  ->                     (2) a literal number (e.g. 555,
  810.                          or hex value e.g. 0xff)
  811.  ->                     (3) a numeric variable (e.g. N5)
  812.                      (4) a string variable (e.g. S0),
  813.                          which contains the value.
  814.                      (5) a numeric expression
  815.  
  816.     <row>         Numeric value representing a row number (0-24 or 0-42
  817.              according to the screen mode).  Expressions (e.g.
  818.              N0+1) are legitimate and accepted.
  819.  
  820.     <col>         Numeric value representing a column number (0-79).
  821.              Expressions are legitimate and accepted.
  822.  
  823.  
  824. Version 2.8: 910717
  825.  
  826. COM-AND: IBM PC Communication Script Language                 Page  10
  827.  
  828.  
  829. IV.    Syntax (continued)
  830.  
  831.  
  832.     <len>         Numeric value representing a length (0-79).  Expres-
  833.              sions (e.g. N0+1) are legitimate and accepted.
  834.  
  835.     <color>      Color keyword or value.  These are:
  836.  
  837.              0      Black            8    DkGrey (Dark Grey)
  838.              1      Blue               9    LtBlue
  839.              2      Green           10    LtGn (Light Green)
  840.              3      Cyan              11    LtCyan
  841.              4      Red              12    LtRed
  842.              5      Magenta          13    LtMagenta
  843.              6      Brown           14    Yellow
  844.              7      LtGrey (Light Grey) 15    White
  845.  
  846.               DEFAULT: This keyword specifies the foreground/
  847.               background attr set through Alt-J for menues.
  848.  
  849.               CONTRAST: This keyword specifies the foreground/
  850.               background attr (reversed) as specified through
  851.               Alt-J for menues.
  852.  
  853.               TEXT: This keyword specifies the foreground/back-
  854.               ground as specified through Alt-J for text.
  855.  
  856.               TCONTRAST: This keyword specifies the foreground/
  857.               background (reversed) text as specified in Alt-J.
  858.  
  859.  ->    <attr>         A foreground/background attribute.  This may be
  860.  ->             of two forms: 0-255 (background value*16+foreground)
  861.  
  862.              and:       ([<color>] <color>).
  863.              or        ([DEFAULT] DEFAULT)
  864.              or        ([CONTRAST] CONTRAST)
  865.              or        any mix of the above
  866.  
  867.              For example "15" and "(black white)" are equivalent
  868.              attributes to COM-AND.  "(DEFAULT)" sets the attribute
  869.              the default set through Alt-J for menu windows.
  870.  
  871.     #         A single digit
  872.  
  873.     (#)         A digit within literal parenthesis
  874.  
  875.  
  876.  
  877.  
  878.  
  879. Version 2.8: 910717
  880.  
  881. COM-AND: IBM PC Communication Script Language                 Page  11
  882.  
  883.  
  884. V.    Script Language Commands
  885.  
  886.  
  887.     ACCESSORY <string>             or ACCESSORY <number>
  888.  
  889.          The ACCESSORY statement invokes the accessory directory to (op-
  890.          tionally) execute a new script, and (optionally) load a program.
  891.          The accessory directory entry number is specified in <string>.
  892.          <String> is formatted exactly as with the F1 menu; it consists
  893.          of an entry number 1-50.  Examples:
  894.  
  895.          ACCESSORY 1         ; Load entry 1
  896.          ; Nothing past this point in the script will be performed.
  897.  
  898.          Each accessory entry specifies:
  899.  
  900.          o         A drive:subdirectory (optional)
  901.          o         A script to be executed (optional)
  902.          o         A program invocation (optional)
  903.  
  904.          Accessory entries are constructed and modified with the 'r' sub-
  905.          command of the F1 menu or SET ACCESSORY script commands.
  906.  
  907.          The ACCESSORY command terminates the current script file.    The
  908.          current script file is closed (and not re-entered when the new
  909.          file completes).  Any IF/GOSUB/SWITCH commands in effect are
  910.          cleared.
  911.  
  912.          Unlike EXECUTE, all strings and conditions are cleared when the
  913.          Accessory script (if there is one) begins.  Parameters may not
  914.          therefore be passed to an accessory script (yet!).
  915.  
  916.  ->    ADD Nx Ny Nz
  917.  
  918.          The ADD command performs the instruction:    Nz = Nx+Ny.  No error
  919.          checking is performed; should the value exceed the range of a
  920.          numeric variable, results are unpredictable.  Example:
  921.  
  922.  ->         ADD N1 N2 N3         ; N3 = N1+N2
  923.  
  924.          An expression may be used for Nx or Ny if it is entirely con-
  925.          tained within parentheses.
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934. Version 2.8: 910717
  935.  
  936. COM-AND: IBM PC Communication Script Language                 Page  12
  937.  
  938.  
  939. V.    Script Language Commands (continued)
  940.  
  941.  
  942.  ->    ALARM [<number>]
  943.  
  944.          The ALARM command sounds COM-AND's alarm.  The alarm continues
  945.          for the time in seconds specified through the Alt-S 'Display
  946.          duration', unless overridden by the optional numeric argument.
  947.          Any keypress terminates the alarm.  Example:
  948.  
  949.  ->         ALARM 10                 ; Annoy for 10 seconds
  950.  
  951.     ALOAD <string>
  952.  
  953.          The ALOAD statement loads a new Accessory Definition file (F1).
  954.          The ALOAD command requires a file name in <string>.  <String>
  955.          contains an unqualified file.ext (or may contain a fully pathed
  956.          file name).  Example:
  957.  
  958.          ALOAD "COM-AND.ACC"             ; Load original accessory def
  959.          ALOAD "C:\SOURCE\COM-AND.ACC"   ; Load special definitions
  960.  
  961.          Note:  The file name is limited to 27 characters in length.
  962.  
  963.     ALLOCATE <number>
  964.  
  965.          The ALLOCATE statement allocates up to 100 dynamic variables
  966.          referenced V0, V1, ... for use by the current and subsequent
  967.          scripts.  ALLOCATE returns success/failure according to avail-
  968.          able memory.  Please refer to Appendix I for a discussion of
  969.          dynamic allocation of variables.  Example:
  970.  
  971.          ALLOCATE N0             ; Allocate a dynamic area
  972.  
  973.          Note:  The number of dynamic variables is limited to 100.
  974.  
  975.     ANAME Sx <number>
  976.  
  977.          The ANAME command returns the name field from the accessory
  978.          directory.  A directory number (1-50) must be specified.
  979.          Example:
  980.  
  981.          ANAME S0 5              ; Fetch the name from # 5
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989. Version 2.8: 910717
  990.  
  991. COM-AND: IBM PC Communication Script Language                 Page  13
  992.  
  993.  
  994. V.    Script Language Commands (continued)
  995.  
  996.  
  997.     APGM Sx <number>
  998.  
  999.          The APGM command returns the program invocation field from the
  1000.          accessory directory.  A directory number (1-50) must be speci-
  1001.          fied.  Example:
  1002.  
  1003.          APGM S0 5                 ; Fetch the pgm from # 5
  1004.  
  1005.     ASCRIPT Sx <number>
  1006.  
  1007.          The ASCRIPT command returns the script field from the accessory
  1008.          directory.  A directory number (1-50) must be specified.
  1009.          Example:
  1010.  
  1011.          ASCRIPT S0 5             ; Fetch the name from # 5
  1012.  
  1013.  ->    ASSIGN Sx <string>
  1014.  
  1015.          The ASSIGN statement allows a string variable to be set to a
  1016.          value.  The value may be another string variable, a literal
  1017.          textual value (a quoted string), or a substring.  Examples:
  1018.  
  1019.  ->         ASSIGN S0 "MAIL"        ; S0 now contains "MAIL"
  1020.  ->         ASSIGN S1 S0         ; S1 now contains "MAIL"
  1021.          ASSIGN S2 S0(0:1)         ; S2 now contains "MA" (char0:char1)
  1022.  
  1023.     ASUBDIR Sx <number>
  1024.  
  1025.          The ASUBDIR command returns the subdirectory field from the
  1026.          accessory directory.  A directory number (1-50) must be
  1027.          specified.  Example:
  1028.  
  1029.          ASUBDIR S0 5             ; Fetch the subdir from # 5
  1030.  
  1031.  ->    ATGET row col attr len Sx
  1032.  
  1033.          The ATGET statement performs the GET function, i.e.  reading
  1034.          the keyboard for a length, with cursor positioning and color
  1035.          control.  Example:
  1036.  
  1037.  ->         ATGET 0 0 15 5 S5         ; Read up to 5 chars into S5 from 0,0
  1038.          ATGET 0 0 (black white) 5 S5
  1039.  
  1040.          Note that the cursor is left positioned after the last
  1041.          character read.
  1042.  
  1043.  
  1044. Version 2.8: 910717
  1045.  
  1046. COM-AND: IBM PC Communication Script Language                 Page  14
  1047.  
  1048.  
  1049. V.    Script Language Commands (continued)
  1050.  
  1051.  
  1052.  ->    ATOI Sx Nx
  1053.  
  1054.          The ATOI statement converts a value in a string variable to a
  1055.          numeric variable.    If no numeric value is found, or the value
  1056.          exceeds the range for numeric variables, the ERROR flag is set.
  1057.          Examples:
  1058.  
  1059.  ->         ASSIGN S0 "1234"        ; S0 now contains "1234"
  1060.  ->         ATOI S0 N1          ; N1 now contains 1234
  1061.          ATOI S2(2:3) N2         ; N2 now contains 34 (char2:char3)
  1062.  
  1063.  ->    ATSAY row col attr <string>
  1064.  
  1065.          The ATSAY statement performs the MESSAGE function, i.e. writing
  1066.          to the screen, with cursor positioning and color control.
  1067.          Example:
  1068.  
  1069.  ->         ATSAY 0 0 15 "text"     ; Write at 0,0; white on black
  1070.          ATSAY 0 0 (black white) S5
  1071.  
  1072.          Note that the cursor is left positioned after the last
  1073.          character written.
  1074.  
  1075.     ATSCR row col len Sx
  1076.  
  1077.          The ATSCR statement reads the screen starting at the position
  1078.          indicated by <row> and <col>, for the length specified into the
  1079.          string variable Sx.  The screen display characters (not their
  1080.          color attributes) are copied into Sx.  Example:
  1081.  
  1082.          ATSCR 2 0 80 S5         ; Read the whole of line 2 into S5
  1083.  
  1084.  ->    BOX row col row col attr
  1085.  
  1086.          The BOX statement draws a box over a region on the screen,
  1087.          filling the space within with a specified color.  The first and
  1088.          second arguments specify the row/column of the top-left of the
  1089.          region.  The third and fourth arguments specify the row/column
  1090.          of the bottom-right of the region.  The last argument specifies
  1091.          the color attribute to be used for the characters written.
  1092.  
  1093.  ->         BOX 0 10,10 20,20 15    ; White on black:    narrow box
  1094.          BOX 0 10,10 20,20 (black white)
  1095.  
  1096.  
  1097.  
  1098.  
  1099. Version 2.8: 910717
  1100.  
  1101. COM-AND: IBM PC Communication Script Language                 Page  15
  1102.  
  1103.  
  1104. V.    Script Language Commands (continued)
  1105.  
  1106.  
  1107.  ->    BREAK [<number>]
  1108.  
  1109.          The BREAK statement performs a true break.  The length of the
  1110.          BREAK is set (by default) through the Alt-S menu.    The length
  1111.          of the signal optionally may be specified in milliseconds.
  1112.          Example:
  1113.  
  1114.  ->         BREAK 1500          ; Send a 1.5 second break
  1115.  
  1116.  ->    BYE
  1117.  
  1118.          The BYE statement terminates both the script and COM-AND,
  1119.          leaving DTR as-is (connection, if made, is not broken).  It may
  1120.          be coded at any level (for example within a subroutine reached
  1121.          through a call from a subroutine).  Example:
  1122.  
  1123.  ->         BYE             ; Leave connection open
  1124.          ; Nothing past this point in the script is executed
  1125.  
  1126.          Note also the QUIT command.
  1127.  
  1128.  ->    CASE (<string>!<numeric>)
  1129.  
  1130.          The CASE statement must be contained within the domain of a
  1131.          SWITCH/ENDSWITCH pair.  The CASE statement specifies a value
  1132.          against which the string variable identified is tested.  Case
  1133.          is not significant in the comparison.  If the variable matches
  1134.          the given string (shift case excluded), the statements following
  1135.          the CASE will be executed, until an ENDCASE is encountered.
  1136.          Refer to SWITCH for an example.
  1137.  
  1138.          Note that the argument of a CASE statement may be a literal or
  1139.          variable value.  Both string and numeric variables are allowed.
  1140.          String substring extraction (e.g.    S0(5:10)) is also supported.
  1141.  
  1142.  ->    CHDIR <string>
  1143.  
  1144.          The CHDIR statement changes the current default subdirectory
  1145.          used for unqualified file name references.  Examples:
  1146.  
  1147.  ->         CHDIR "\COM-AND"        ; Change path on the current drive
  1148.          CHDIR "C:\COM-AND"      ; Change drive and path
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154. Version 2.8: 910717
  1155.  
  1156. COM-AND: IBM PC Communication Script Language                 Page  16
  1157.  
  1158.  
  1159. V.    Script Language Commands (continued)
  1160.  
  1161.  
  1162.  ->    CLEAR [<attr>]
  1163.  
  1164.          The CLEAR statement clears the screen.  It optionally changes
  1165.          the background and foreground colors.  The <attr> argument
  1166.          specifies a new background color (if present), and a new
  1167.          foreground color.    Note that a foreground argument requires a
  1168.          background argument.  Example:
  1169.  
  1170.  ->         CLEAR 15             ; Clear screen, set white on black
  1171.          CLEAR (BLACK RED)         ; Clear screen, set red on black
  1172.          CLEAR             ; Clear screen, leave colors alone
  1173.  
  1174.          CLEAR sets the cursor to the top left of the scrolling region,
  1175.          either as defined by default, or through the DWINDOW command.
  1176.  
  1177.     CLOG OPEN <string>
  1178.     CLOG CLOSE
  1179.     CLOG <string>
  1180.  
  1181.          The CLOG subcommands OPEN a call-log file by name, CLOSE an
  1182.          open call-log file, and write to the call-log (if open).
  1183.  
  1184.          The CLOG OPEN command requires a file name.  The <string> is
  1185.          limited to 26 characters in length.  It may contain a fully
  1186.          pathed file name.    The given name will be searched for on the
  1187.          current drive:subdirectory and the one specified by the
  1188.          'COM-AND=' environment variable.  Example:
  1189.  
  1190.          CLOG OPEN "Log.txt"     ; Open calllog file and start logging
  1191.          CLOG OPEN "E:log.txt"   ; Open calllog on RAM drive
  1192.  
  1193.          CLOG OPEN sets the SUCCESS/FAILURE condition (tested with the
  1194.          IF statement).
  1195.  
  1196.          Note that the script write may choose to open a call-log file
  1197.          by name (closing the default call-log, if one is established)
  1198.          or alternatively to accept the user's discretion in the matter.
  1199.          The CLOG command writes to the call-log only if it is open.  If
  1200.          the script writer does not open the call-log (CLOG OPEN or SET
  1201.          CALLLOG ON), CLOG commands will be ignored unless call-logging
  1202.          has been enabled BY THE USER.
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209. Version 2.8: 910717
  1210.  
  1211. COM-AND: IBM PC Communication Script Language                 Page  17
  1212.  
  1213.  
  1214. V.    Script Language Commands (continued)
  1215.  
  1216.  
  1217.  ->    COLOR <attr>
  1218.  
  1219.          The COLOR statement changes the foreground (and optionally the
  1220.          background display colors.  The first argument specifies a new
  1221.          background color.    The second argument specifies a new fore-
  1222.          ground color.  Note that a background argument requires a fore-
  1223.          ground argument.  Example:
  1224.  
  1225.  ->         COLOR 15             ; Set white on black
  1226.          COLOR (0 15)         ; Set white on black
  1227.          COLOR (BLACK RED)         ; Set red on black
  1228.          COLOR (RED)         ; Set foreground to red
  1229.  
  1230.     COMBASE <port> Nx
  1231.  
  1232.          The COMBASE statement returns the base address for the given
  1233.          port (port is COM1, COM2...).  This value may be set through
  1234.          Alt-P (manually) or SET COMBASE in a script.
  1235.  
  1236.          COMBASE COM1 N0         ; Read current base address
  1237.  
  1238.     COMPARMS Sx
  1239.  
  1240.          The COMPARMS statement returns the current communications
  1241.          parameters, formatted:  "bbbb,p,d,s,COMx" where "bbbb" is
  1242.          baud rate, "p" is parity (E/O/N), "d" is the number of data
  1243.          bits (7/8), "s" is the number of stop bits (1/2), and "COMx"
  1244.          is the comm port.    Example:
  1245.  
  1246.          COMPARMS S4         ; Read current settings
  1247.  
  1248.     COMVECTOR <port> Nx
  1249.  
  1250.          The COMVECTOR statement returns the vector # (0-7) for the
  1251.          given port (port is COM1, COM2...).  This value may be set
  1252.          through Alt-P (manually) or SET COMVECTOR in a script.
  1253.  
  1254.          COMVECTOR COM1 N0         ; Read current vector #
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264. Version 2.8: 910717
  1265.  
  1266. COM-AND: IBM PC Communication Script Language                 Page  18
  1267.  
  1268.  
  1269. V.    Script Language Commands (continued)
  1270.  
  1271.  
  1272.     CONCAT Sx [(##)!*] <string>
  1273.  
  1274.          The CONCAT statement concatenates two strings.  The first string
  1275.          is the target variable (Sx).  The second string is the text to
  1276.          be concatenated.  Concatenation may take place at a fixed posi-
  1277.          tion in the target, or the target may be backscanned for the
  1278.          last nonblank character.  Example:
  1279.  
  1280.          S1 = "MAIL"             ; Set file name 1st 4 char
  1281.          CONCAT S0 "_DATE"(0:1)  ; Take month num from date
  1282.          CONCAT S0 "_DATE"(3:4)  ; Take day num from date
  1283.          CONCAT S0(8) ".TXT"     ; Add extension at column 8
  1284.  ->         LOG OPEN S0         ; Open log file "MAILmmdd.TXT"
  1285.  
  1286.          Note that "*" may be specified instead of an index (0,1,2...)
  1287.          after the target variable.  "*" specifies that the concaten-
  1288.          ation is to be performed without blank trimming.  Example:
  1289.  
  1290.          CONCAT S0 * S1         ; Concat S1 at LENGTH S0
  1291.  
  1292.  ->    CONNECT
  1293.  
  1294.          The CONNECT statement terminates a COM-AND script, returning to
  1295.          CRT mode.    It may be coded at any level (for example within a
  1296.          subroutine reached through a call from a subroutine).  Example:
  1297.  
  1298.  ->         CONNECT             ; End of script
  1299.          ; Nothing past this point in the script is executed
  1300.  
  1301.          Note also the EXIT and TERMINAL command.
  1302.  
  1303.     CRC <string> Nx
  1304.  
  1305.          The CRC statement computes a CRC for the string given.  This
  1306.          CRC might be transmitted after the string to automate error
  1307.          detection and recovery.  Example:
  1308.  
  1309.          CRC S0(0:19) N0         ; Compute CRC for 20 characters
  1310.          S0(20:24) = N0         ; Add CRC to the string
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319. Version 2.8: 910717
  1320.  
  1321. COM-AND: IBM PC Communication Script Language                 Page  19
  1322.  
  1323.  
  1324. V.    Script Language Commands (continued)
  1325.  
  1326.  
  1327.     CTOI <string> Nx
  1328.  
  1329.          The CTOI statement converts a string (1st byte) to a numeric
  1330.          variable.    Only a single character is extracted.  The value in
  1331.          the numeric variable is the character.  Example:
  1332.  
  1333.          S0 = "A"                ; Place something in a string
  1334.          CTOI S0 N0          ; N0 now contains a 65 (ASCII "A")
  1335.  
  1336.  ->    CUROFF
  1337.  
  1338.          The CUROFF statement turns off the blinking cursor.  The cursor
  1339.          will be restored by the CURON command or upon exit.  Example:
  1340.  
  1341.  ->         CUROFF             ; Turn off the cursor
  1342.  
  1343.  ->    CURON
  1344.  
  1345.          The CURON statement restores on the blinking cursor.  This has
  1346.          no effect unless a CUROFF was performed previously.  Example:
  1347.  
  1348.  ->         CURON             ; Turn back on the cursor
  1349.  
  1350.  ->    CURSOR Nx Ny
  1351.  
  1352.          The CURSOR statement reads the current cursor position.  Nx
  1353.          returns the row number, and Ny returns the column number.
  1354.          Example:
  1355.  
  1356.  ->         CURSOR N0,N1         ; Read current cursor row,col
  1357.  
  1358.  ->    CWHEN [(#)]
  1359.  
  1360.          The CWHEN statement clears a WHEN setting.  10 WHEN settings are
  1361.          available (WHEN (0), WHEN (1) ...    WHEN (9), with the unquali-
  1362.          fied WHEN equivalent to WHEN(0)).    Each must be set and cleared
  1363.          individually.  Examples:
  1364.  
  1365.  ->         CWHEN             ; Clear primary WHEN setting
  1366.          CWHEN (0)             ; Same as CWHEN
  1367.          CWHEN (9)             ; Clear last WHEN
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374. Version 2.8: 910717
  1375.  
  1376. COM-AND: IBM PC Communication Script Language                 Page  20
  1377.  
  1378.  
  1379. V.    Script Language Commands (continued)
  1380.  
  1381.  
  1382.  ->    DATE Sx [0!1]
  1383.  
  1384.          The DATE statement stores the current system date into the
  1385.          target variable.  Example:
  1386.  
  1387.  ->         DATE S0             ; Get today's date
  1388.  
  1389.          The date is formatted according to the optional argument (if
  1390.          provided and nonzero, the date is formatted mm/dd/yyyy;
  1391.          otherwise it is formatted mm/dd/yy).
  1392.  
  1393.     DBOX row col row col attr
  1394.  
  1395.          The DBOX statement draws a box using double line borders, over a
  1396.          region on the screen, filling the space within with a specified
  1397.          color.  The first and second arguments specify the row/column of
  1398.          the top-left of the region.  The third and fourth arguments
  1399.          specify the row/column of the bottom-right of the region.    The
  1400.          last argument specifies the color attribute to be used for the
  1401.          characters written.  Example:
  1402.  
  1403.          DBOX 0 10,10 20,20 (black white)
  1404.  
  1405.     DEALLOCATE
  1406.  
  1407.          The DEALLOCATE statement deallocates dynamic variables if they
  1408.          are currently allocated.  Example:
  1409.  
  1410.          DEALLOCATE          ; DEALLOCATE dynamic variables
  1411.  
  1412.  ->    DEC Nx
  1413.  
  1414.          The DEC command performs the instruction:    Nx = Nx-1.  No error
  1415.          checking is performed; should the value exceed the range of a
  1416.          numeric variable, results are unpredictable.  Example:
  1417.  
  1418.  ->         DEC N1             ; N1 = N1-1
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429. Version 2.8: 910717
  1430.  
  1431. COM-AND: IBM PC Communication Script Language                 Page  21
  1432.  
  1433.  
  1434. V.    Script Language Commands (continued)
  1435.  
  1436.  
  1437.     DECRYPT <string> <string> <string>
  1438.  
  1439.          The DECRYPT command decrypts a file (named in the first argu-
  1440.          ment) to a new file (named in the second argument, which will
  1441.          be purged if it exists) using a 32 character password (the third
  1442.          argument).  SUCCESS/FAILURE is set by DECRYPT.  Do not decrypt
  1443.          in place!    Example:
  1444.  
  1445.          DECRYPT "SECRET.ENF" "COM-AND.EXE" "abcdefghijklmnop"
  1446.  
  1447.  ->    DEFAULT
  1448.  
  1449.          The DEFAULT statement must be contained within the domain of a
  1450.          SWITCH/ENDSWITCH pair.  The DEFAULT statement specifies a domain
  1451.          of statements to be executed if none of the preceding CASE
  1452.          statements have been executed.  The DEFAULT does not have to be
  1453.          the last statement in the SWITCH domain...  but should be.  The
  1454.          DEFAULT case is terminated when an ENDCASE is encountered.
  1455.          Refer to SWITCH for an example.
  1456.  
  1457.     DEFTIME <number>
  1458.  
  1459.          The DEFTIME statement sets the default delay for the RGET,
  1460.          WAITFOR, and PAUSE statements.  <number> is a delay interval
  1461.          in seconds.  Example:
  1462.  
  1463.          DEFTIME 60          ; Set original default value back
  1464.  
  1465.     DELETE <file>
  1466.  
  1467.          The DELETE statement deletes a file named in the command.
  1468.          SUCCESS flag is set according to the result of the command.
  1469.          Example:
  1470.  
  1471.          DELETE "COM-AND.LOG"    ; Delete file on the default d:subd
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484. Version 2.8: 910717
  1485.  
  1486. COM-AND: IBM PC Communication Script Language                 Page  22
  1487.  
  1488.  
  1489. V.    Script Language Commands (continued)
  1490.  
  1491.  
  1492.  ->    DIAL <string>                    or DIAL <number>
  1493.  
  1494.          The DIAL statement invokes the dialing directory to dial the
  1495.          entry number specified in <string>.  <String> is formatted
  1496.          exactly as with the Alt-D menu; it consists of an entry number
  1497.          1-100 prefixed or suffixed by an optional long-distance entry
  1498.          flag.  Examples:
  1499.  
  1500.  ->         DIAL "1"                ; Dial entry 1
  1501.  ->         DIAL "@1"               ; Dial entry 1 with long-distance
  1502.  
  1503.          When a dialing directory entry indicates a script to be per-
  1504.          formed, the indicated script is ignored when the number is
  1505.          dialed from within a script.  Use the LINKED condition of IF to
  1506.          test this for this condition.  [When a script is invoked from
  1507.          Alt-D, LINKED is true.]
  1508.  
  1509.          Dialing is performed as with the redial command (Alt-R).  The
  1510.          number is dialed every <RDELAY> seconds (below, see SET), until
  1511.          connection is established, or ESC is pressed.  [Note: a script
  1512.          may set a maximum number of redial attempts through SET RDMAX,
  1513.          below.  This feature is ONLY available through a script.]
  1514.  
  1515.          The DIAL command sets the FAILED condition if the command was
  1516.          syntactically incorrect or if an ESC was entered to terminate
  1517.          redialing.  [Note: The script intrinsic "_RDPN" may be used to
  1518.          determine if the DIAL FAILED after redialing the maximum number
  1519.          of times (if set), or aborted by the user.]
  1520.  
  1521.  ->    DIR <string>
  1522.  
  1523.          The DIR statement accepts a string argument as a wildcard
  1524.          template and opens a file display window equivalent to the
  1525.          interactive Alt-F command of COM-AND.  Example:
  1526.  
  1527.  ->         DIR "*.*"               ; Show files on current subdir
  1528.  
  1529.     DIRECTORY Sx (<number>)
  1530.  
  1531.          The DIRECTORY command returns the name field from the dialing
  1532.          directory.  A directory number may be specified, or the last
  1533.          dialed entry may be requested.  Example:
  1534.  
  1535.          DIRECT S0 5             ; Fetch the name from # 5
  1536.          DIRECT S1                 ; Fetch name of last dialed
  1537.  
  1538.  
  1539. Version 2.8: 910717
  1540.  
  1541. COM-AND: IBM PC Communication Script Language                 Page  23
  1542.  
  1543.  
  1544. V.    Script Language Commands (continued)
  1545.  
  1546.  
  1547.  ->    DIV Nx Ny Nz
  1548.  
  1549.          The DIV command performs the instruction:    Nz = Nx/Ny.  No error
  1550.          checking is performed;  should the value exceed the range of a
  1551.          numeric variable, results are unpredictable.  Dividing by zero
  1552.          always yields zero.  Example:
  1553.  
  1554.  ->         DIV N1 N2 N3         ; N3 = N1/N2
  1555.  
  1556.          An expression may be used for Nx or Ny if it is entirely
  1557.          contained within parentheses.
  1558.  
  1559.     DLDIR Sx
  1560.  
  1561.          The DLDIR statement reads the current download drive:subdirec-
  1562.          tory into the string variable Sx.    Example:
  1563.  
  1564.          DLDIR S0               ; Read the current setting
  1565.  
  1566.     DLOAD <string>
  1567.  
  1568.          The DLOAD statement loads a new dialing directory file (Alt-D).
  1569.          The DLOAD command requires a file name in <string> (up to 27
  1570.          characters).  <String> contains an unqualified file.ext (or may
  1571.          contain a fully pathed file name).  Example:
  1572.  
  1573.          DLOAD "COM-AND.DIR"           ; Load original dialing dir
  1574.          DLOAD "C:\SOURCE\COM-AND.DIR" ; Load special directory
  1575.  
  1576.     DNUMBER Sx (<number>)
  1577.  
  1578.          The DNUMBER command returns the number field from the dialing
  1579.          directory.  A directory number may be specified, or the last
  1580.          dialed entry may be requested.  Example:
  1581.  
  1582.          DNUM S0 5                 ; Fetch the nbr from # 5
  1583.          DNUM S1                 ; Fetch number last dialed
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594. Version 2.8: 910717
  1595.  
  1596. COM-AND: IBM PC Communication Script Language                 Page  24
  1597.  
  1598.  
  1599. V.    Script Language Commands (continued)
  1600.  
  1601.  
  1602.     DO
  1603.  
  1604.          The DO statement asserts the beginning of a loop.    The end of
  1605.          the loop is signalled by an UNTIL statement (which is evaluated
  1606.          to determine if looping occurs).  Example:
  1607.  
  1608.          DO              ; Loop until condition below
  1609.          ...
  1610.          UNTIL GE N0,10      ; Loop until N0 >= 10
  1611.  
  1612.          The condition evaluated by the UNTIL is any condition accepted
  1613.          by the IF statement (including conjunctions of conditions, dis-
  1614.          junction of conditions, and so on).
  1615.  
  1616.  
  1617.          Note: (1) GOTO statements may never enter a DO loop;  even
  1618.                to leave an inner loop to return to an outer loop.
  1619.  
  1620.          Note: (2) DO statements may be nested (along with IF, SWITCH,
  1621.                WHILE, and FOR loops) up to 20 levels.  However,
  1622.                they may not overlap other DO loops, or other
  1623.                flow-of-control statements.
  1624.  
  1625.          Note: (3) The clause of the DO statement (the statement after
  1626.                'DO' down to the UNTIL statement) is always executed
  1627.                at least once.  The conditional evaluation is not
  1628.                performed until the end of the clause.
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649. Version 2.8: 910717
  1650.  
  1651. COM-AND: IBM PC Communication Script Language                 Page  25
  1652.  
  1653.  
  1654. V.    Script Language Commands (continued)
  1655.  
  1656.  
  1657.  ->    DOS <string> [WAIT]
  1658.  
  1659.          The DOS command executes any DOS command.    It works by loading
  1660.          a copy of COMMAND.COM (or other SHELL program, as specified by
  1661.          the environment variable COMSPEC=) and passing <string> for
  1662.          execution.  Example:
  1663.  
  1664.  ->         DOS "dir a:"            ; List files on the 'A' drive
  1665.  
  1666.          The optional keyword WAIT signals that COM-AND is to pause
  1667.          after completion for a keypress before the script continues.
  1668.  
  1669.          NOTE: The screen is saved prior to the DOS function, for
  1670.          restoration upon completion.  However, the screen size saved
  1671.          is defined by the DWINDOW currently in effect!
  1672.  
  1673.          This command sets the SUCCESS condition (unless the SHELL cannot
  1674.          be found).
  1675.  
  1676.     DPARMS Sx (<number>)
  1677.  
  1678.          The DPARMS command returns the parameters field from the dialing
  1679.          directory, formatted:  rrrr,p,d,s,e (where r=rate, p = parity
  1680.          (EON), d = #data bits (7,8), s=#stop bits (1,2) and e=echo
  1681.          (Y,N," ").  A directory number may be specified, or the last
  1682.          dialed entry may be requested.  Example:
  1683.  
  1684.          DPARMS S0 5             ; Fetch the parms from # 5
  1685.          DPARMS S1                 ; Fetch parms last dialed
  1686.  
  1687.     DSCRIPT Sx (<number>)
  1688.  
  1689.          The DSCRIPT command returns the script file name from the
  1690.          dialing directory (or blanks).  A directory number may be
  1691.          specified, or the last dialed entry may be requested.  Example:
  1692.  
  1693.          DSCRIPT S0 5             ; Fetch the file from # 5
  1694.          DSCRIPT S1              ; Fetch script last dialed
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704. Version 2.8: 910717
  1705.  
  1706. COM-AND: IBM PC Communication Script Language                 Page  26
  1707.  
  1708.  
  1709. V.    Script Language Commands (continued)
  1710.  
  1711.  
  1712.     DWINDOW row col row col
  1713.     DWINDOW CLEAR
  1714.  
  1715.          The DWINDOW command defines a new scrolling region.  The first
  1716.          row/col pair define the new top-left, and the second row/col
  1717.          pair define the bottom-right.  Example:
  1718.  
  1719.          DWINDOW 10,10,20,70         ; Define a small scroll box
  1720.  
  1721.          DWINDOW CLEAR resets the scrolling region to its maximum size
  1722.          (0,0,23,79 CGA, or 0,0,42/49,79 EGA/VGA).
  1723.  
  1724.          'Home' cursor position is relative to the current definition of
  1725.          the scrolling region (e.g.  CLEAR statement).  The region region
  1726.          is returned to 'normal' when a script terminates.  SET 43 and
  1727.          SET 25, if executed after DWINDOW, reset the scrolling region
  1728.          and clear the DWINDOW.
  1729.  
  1730.          Note that COM-AND appropriates the last line of the current
  1731.          display for status/LEGEND display unconditionally.
  1732.  
  1733.          NOTE: The DWINDOW defines the screen size for the DOS, RUN and
  1734.          SHELL functions (for screen saves and restoration).  DWINDOW
  1735.          should generally be turned off prior to these commands, and
  1736.          reset afterwards.
  1737.  
  1738.     EBL Sx <EBL var>
  1739.  
  1740.          The EBL statement references the global data area maintained by
  1741.          EBL (see Appendix F) if EBL is currently installed.  If EBL is
  1742.          not installed, FAILURE is set.  If EBL is installed, the given
  1743.          variable (%A through %O, or &<name>) will be returned in Sx, up
  1744.          to 80 characters long (EBL allows up to 127 characters).
  1745.          Example:
  1746.  
  1747.          EBL S0 %B             ; Fetch The second variable's value
  1748.          IF FAILURE ...         ; Action if EBL not installed
  1749.  
  1750.          Note:  The EBL command tests for the environment variable
  1751.          'BATINT=' before inquiring for EBL's presence.  EBL users use
  1752.          environment variables to declare a new (hex) interrupt number.
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759. Version 2.8: 910717
  1760.  
  1761. COM-AND: IBM PC Communication Script Language                 Page  27
  1762.  
  1763.  
  1764. V.    Script Language Commands (continued)
  1765.  
  1766.  
  1767.     EBLSET &<name> Sx
  1768.  
  1769.          The EBLSET statement permits modification (and creation if space
  1770.          permits) of EBL external variables (see appendix F) if EBL is
  1771.          currently installed.  If EBL is not installed, or if space does
  1772.          not permit the modification, FAILURE is set.  If EBL is in-
  1773.          stalled, the given variable (named '&<name>) will be set to the
  1774.          value in Sx, up to 80 characters long (EBL allows up to 127
  1775.          characters).  Example:
  1776.  
  1777.          EBLSET &USER S0         ; Set ext var to value in S0
  1778.          IF FAILURE ...         ; Action if EBL not installed
  1779.  
  1780.  ->    ELSE
  1781.  
  1782.          The ELSE statement must be contained within the domain of an
  1783.          IF/ENDIF pair.  Statements following an IF statement are
  1784.          executed if the condition specified was found to be true, and
  1785.          execution continues until an ELSE or ENDIF are encountered.
  1786.          If the condition tested with the IF was found to be false,
  1787.          statements following the ELSE statement (if present) will be
  1788.          executed.    Refer to the IF statement for an example.
  1789.  
  1790.          Note that ELSE may contain the statement to be executed on
  1791.          its own line, in which case no ENDIF is required.
  1792.  
  1793.  ->    EMULATE (TTY!ANSI!VIDTEX!VT100!VT52)
  1794.  
  1795.          The EMULATE command specifies terminal emulation.    COM-AND
  1796.          provides the following emulations (refer to COM-AND.DOC for
  1797.          details):    TTY (b/w), ANSI (color), VIDTEX (for CIS), VT-100
  1798.          and VT-52.  Example:
  1799.  
  1800.  ->         EMULATE TTY         ; Set screen to B&W
  1801.  
  1802.          Note that "EMULATE VIDTEX" is equivalent to "SET ENQ CISB".
  1803.  
  1804.  
  1805.  
  1806.  
  1807.  
  1808.  
  1809.  
  1810.  
  1811.  
  1812.  
  1813.  
  1814. Version 2.8: 910717
  1815.  
  1816. COM-AND: IBM PC Communication Script Language                 Page  28
  1817.  
  1818.  
  1819. V.    Script Language Commands (continued)
  1820.  
  1821.  
  1822.     ENCRYPT <string> <string> <string> [DES!SIMPLE!AUTO]
  1823.  
  1824.          The ENCRYPT command encrypts a file (named in the first argu-
  1825.          ment) to a new file (named in the second argument, which will
  1826.          be purged if it exists) using a 32 character password (the third
  1827.          argument).  An optional keyword specifies the method (DES is
  1828.          default).    SUCCESS/FAILURE is set by ENCRYPT.  Do not encrypt
  1829.          in place!    Example:
  1830.  
  1831.          ENCRYPT "COM-AND.EXE" "SECRET.ENF" "abcdefghijklmnop"
  1832.  
  1833.          Note that scripts are automatically decrypted when encountered
  1834.          by COM-AND.  You do not need to decrypt a script in order to
  1835.          EXECUTE it (but you may if you wish...).
  1836.  
  1837.  ->    ENDCASE
  1838.     ENDFOR
  1839.  ->    ENDIF
  1840.  ->    ENDSWITCH
  1841.     ENDWHILE
  1842.  
  1843.          The 'END' statements terminate the domain of 'CASE' (and
  1844.          'DEFAULT'), 'FOR', 'IF', 'SWITCH' and 'WHILE' statements,
  1845.          respectively.  [Note, "DO" is terminated by "UNTIL".] Each of
  1846.          these domain statements MUST be paired with its terminating
  1847.          statement.
  1848.  
  1849.     ENVIRON Sx <string>
  1850.  
  1851.          The ENVIRON statement returns the value associated with the
  1852.          variable <string> in the current environment block.  Envi-
  1853.          ronment variables are established with the DOS SET command,
  1854.          before COM-AND is entered (SET commands executed through the
  1855.          DOS SHELL have no effect on COM-AND).  Example:
  1856.  
  1857.          ENVIRON S5 "COMSPEC="   ; Get current shell pgm name
  1858.  
  1859.          ENVIRON sets and reset the FOUND flag according to operation.
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869. Version 2.8: 910717
  1870.  
  1871. COM-AND: IBM PC Communication Script Language                 Page  29
  1872.  
  1873.  
  1874. V.    Script Language Commands (continued)
  1875.  
  1876.  
  1877.  ->    EXECUTE <string>
  1878.  
  1879.          The EXECUTE command chains to a new script file.  The current
  1880.          script file is closed (and not re-entered when the new file
  1881.          completes).  Any IF/GOSUB/SWITCH/DO/WHILE commands in effect
  1882.          are cleared.  Example:
  1883.  
  1884.  ->         EXECUTE "newfile.cmd"   ; Pick up with a new script
  1885.          ; Nothing past this point in the script will be performed.
  1886.  
  1887.          Note that string variables and conditions are retained as they
  1888.          are when the new script file begins execution.  In this way,
  1889.          parameters may be passed to a new script.
  1890.  
  1891.  ->    EXIT
  1892.  
  1893.          The EXIT command terminates the script execution.    It may be
  1894.          coded at any level (for example within a subroutine reached
  1895.          through a call from a subroutine).  Example:
  1896.  
  1897.  ->         EXIT             ; Terminate the script processor
  1898.          ; Nothing past this point in the script will be performed.
  1899.  
  1900.          NOTE: When the script processor reaches end-of-file, an implicit
  1901.          EXIT is performed.  This is true in EXECUTed as well as FCALLed
  1902.          scripts.
  1903.  
  1904.  ->    FATSAY row col attr <string> <parms>
  1905.  
  1906.          The FATSAY statement performs the MESSAGE function, i.e.
  1907.          writing to the screen, with cursor positioning and color
  1908.          control.  Parameters are formatted into the string provided
  1909.          from the list provided.  Example:
  1910.  
  1911.  ->         FATSAY 0 0 15 "The answer is %d %s" N0 S0 ; Value and label
  1912.          FATSAY 0 0 (black white) "The answer is %d %s" N0 S0
  1913.  
  1914.          Note that the cursor is left positioned after the last character
  1915.          written.  Refer to the STRFMT statement for discussion of
  1916.          parameter formatting.
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.  
  1923.  
  1924. Version 2.8: 910717
  1925.  
  1926. COM-AND: IBM PC Communication Script Language                 Page  30
  1927.  
  1928.  
  1929. V.    Script Language Commands (continued)
  1930.  
  1931.  
  1932.     FATTR Sx <file>
  1933.  
  1934.          The FATTR command formats the file attribute byte as binary
  1935.          digits into the target string (Sx).  The file name specifi-
  1936.          cation may be a literal quoted string, or a string variable.
  1937.          The formatted string is 8 characters, either 0 or 1.  Example:
  1938.  
  1939.          FATTR S3 "COM-AND.EXE"          ; Format into S3
  1940.  
  1941.          The FATTR command sets and resets the SUCCESS flag according to
  1942.          the presence of the named file.  The bits returned have meaning:
  1943.  
  1944.        (msb) xxxxxxxx (lsb)
  1945.             ^------------------------  Read-only file
  1946.            ^-------------------------  Hidden file
  1947.           ^--------------------------  System file
  1948.          ^---------------------------  File is a volume ID
  1949.         ^----------------------------  File is a subdirectory
  1950.            ^-----------------------------  Archive bit for the file
  1951.           ^------------------------------  Always 0
  1952.          ^-------------------------------  Always 0
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964.  
  1965.  
  1966.  
  1967.  
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979. Version 2.8: 910717
  1980.  
  1981. COM-AND: IBM PC Communication Script Language                 Page  31
  1982.  
  1983.  
  1984. V.    Script Language Commands (continued)
  1985.  
  1986.  
  1987.     FCALL <file>
  1988.  
  1989.          The FCALL command invokes the file given as if it were a sub-
  1990.          routine.  If the new file is encrypted, a password will be
  1991.          requested (if the calling file is encrypted, the password to
  1992.          the old file is not requested upon return).  Example:
  1993.  
  1994.          FCALL "SUBS.CMD"                ; Call a file
  1995.  
  1996.          The called file returns to the caller upon an FRETURN instruc-
  1997.          tion.  If end-of-file or EXIT is encountered in the called
  1998.          file, the script terminates.  [Note that "IF FCALLed" permits
  1999.          determination that the current file was entered via FCALL.]
  2000.  
  2001.          FCALL does not allow a branch out of the called file back into
  2002.          the caller's file.  Labels in an FCALLed file MAY duplicate
  2003.          labels in the caller's file.  Note that ON ESCAPE is not reset
  2004.          on entry via FCALL, and unless the new script has the identical
  2005.          label, the script fails (label not found) on escape.
  2006.  
  2007.          For performance purposes, FCALL does NOT close the calling file
  2008.          when the new script file is opened.  All script files are closed
  2009.          upon exit... however, a recursion amongst scripts may quickly
  2010.          consume all DOS file handles.  Avoid pairs of scripts where
  2011.          each script FCALLs the other.
  2012.  
  2013.          FCALLs may be nested to a depth of up to 10.
  2014.  
  2015.  
  2016.  
  2017.  
  2018.  
  2019.  
  2020.  
  2021.  
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034. Version 2.8: 910717
  2035.  
  2036. COM-AND: IBM PC Communication Script Language                 Page  32
  2037.  
  2038.  
  2039. V.    Script Language Commands (continued)
  2040.  
  2041.  
  2042.  ->    FCLOSEI
  2043.  ->    FCLOSEO
  2044.  
  2045.          The FCLOSEI and FCLOSEO commands close a file opened for input
  2046.          or output.  FCLOSE<I!O> on a file not opened does not hurt
  2047.          anything.    When a file is closed, all blocks pending are
  2048.          flushed to the file.  Example:
  2049.  
  2050.  ->         FCLOSEI             ; We're done with it
  2051.  
  2052.          Please note that, when opened for output in TEXT mode, COM-AND
  2053.          does not add a final ^Z (ASCII EOF convention).  The script
  2054.          author may choose to precede FCLOSEO with a 'WRITE ^Z"' as
  2055.          need dictates.
  2056.  
  2057.     FDATE Sx <file> [0!1]
  2058.  
  2059.          The FDATE command places the date last modified (as known by
  2060.          DOS) into the target string (Sx).    The file name specification
  2061.          may be a literal quoted string, or a string variable.  The date
  2062.          is formatted according to the optional format argument (if
  2063.          provided and nonzero, the date is formatted mm/dd/yyyy;
  2064.          otherwise it is formatted mm/dd/yy).  Example:
  2065.  
  2066.          FDATE S3 "COM-AND.EXE" 1        ; Format date into S3
  2067.  
  2068.          The FDATE command sets and resets the SUCCESS flag.
  2069.  
  2070.     FFIRST Sx
  2071.  
  2072.          The FFIRST command initializes a wildcard lookup.    If SUCCESS
  2073.          is set after FFIRST, file names may be obtained using the FNEXT
  2074.          command.  Only one thread of file name lookups is performed at
  2075.          anyone time;  invoking FFIRST when there are more file names to
  2076.          be returned terminates the previous thread.  Example:
  2077.  
  2078.          FFIRST "*.asm"                  ; Initialize lookup
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089. Version 2.8: 910717
  2090.  
  2091. COM-AND: IBM PC Communication Script Language                 Page  33
  2092.  
  2093.  
  2094. V.    Script Language Commands (continued)
  2095.  
  2096.  
  2097.  ->    FGETC Sx
  2098.  ->    FGETS Sx
  2099.  
  2100.          The FGETC and FGETS commands read a character (FGETC) or a
  2101.          string (FGETS) into a string variable.  The input file must
  2102.          be opened by a previous FOPENI, of course.
  2103.  
  2104.          In TEXT mode, the FGET commands translate CR/LF pairs in the
  2105.          input file to single LFs.    No tab expansion is performed.
  2106.          In TEXT mode, the FGET commands stop on an ASCII EOF (Ctl-Z).
  2107.  
  2108.          FGETC reads a single character into Sx(0:0).  FGETS reads up
  2109.          to 80 characters into Sx.    If the input file was opened in TEXT
  2110.          mode, the read string terminates at the 80th byte or a CR/LF
  2111.          pair (placed in Sx as a single LF).  Example:
  2112.  
  2113.  ->         FGETS S0             ; Read up to 80 bytes
  2114.  
  2115.          The FGET commands set the EOF condition on input EOF.  This
  2116.          may be tested with the IF statement.
  2117.  
  2118.          Note also: FREAD and READ commands.
  2119.  
  2120.  ->    FIND Sx <string> [Nx]
  2121.  
  2122.          The FIND command tests for a substring within a target string.
  2123.          Case is not significant.  This command sets the FOUND condition
  2124.          for the IF command.  Example:
  2125.  
  2126.  ->         FIND S0 "sentence"      ; Test for the word 'sentence'
  2127.  
  2128.          Note the optional numeric variable argument.  If supplied, the
  2129.          index (0,1,2,3...) to the substring within the target string is
  2130.          placed in the indicated numeric variable.
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140.  
  2141.  
  2142.  
  2143.  
  2144. Version 2.8: 910717
  2145.  
  2146. COM-AND: IBM PC Communication Script Language                 Page  34
  2147.  
  2148.  
  2149. V.    Script Language Commands (continued)
  2150.  
  2151.  
  2152.     FNEXT  Sx [QUAL]
  2153.  
  2154.          The FNEXT command returns file names from a wildcard lookup.
  2155.          If SUCCESS is set after FNEXT, the given string variable con-
  2156.          tains the next file name from the template match begun with
  2157.          FFIRST.  IF FAILURE is set, the string variable is also set
  2158.          to nulls.    Example:
  2159.  
  2160.          FNEXT S0                 ; Return name.ext
  2161.          FNEXT S0 QUAL             ; Return fully qualified name
  2162.  
  2163.          Wildcard lookup must be initialized with the FFIRST command.
  2164.          The optional 'QUAL' modifier controls whether the returned name
  2165.          is "name.ext" or fully qualified with drive:subdirectory.
  2166.  
  2167.  ->    FOPENI <file> [TEXT!BINARY]
  2168.  ->    FOPENO <file> [TEXT!BINARY!APPEND]
  2169.  
  2170.          The FOPENI and FOPENO commands open a file for input or output.
  2171.          COM-AND currently supports one file opened for input and one for
  2172.          output at any one time.  I/O to/from the file is blocked for
  2173.          fastest access.
  2174.  
  2175.          Files opened for input may be declared TEXT or BINARY in the
  2176.          open statement.  The default is TEXT.  When the file is opened,
  2177.          it is positioned to the start of the file.
  2178.  
  2179.          Files opened for output may be declared TEXT or BINARY in the
  2180.          open statement.  The default is TEXT.  On output, unless APPEND
  2181.          is specified, the file is purged if it existed previously.  On
  2182.          output, if APPEND is specified, the file is created if it does
  2183.          not exist, and positioned to end-of-file.
  2184.  
  2185.  ->         FOPENI "COM-AND.UFL" TEXT       ; Open file in text mode
  2186.          FOPENO "COM-AND.LOG" TEXT APPEND; Open file, add to old data
  2187.  
  2188.          The FOPEN commands set the SUCCESS flag according to completion.
  2189.  
  2190.          Refer to FCLOSE, FGET, FPUT, FREAD, FWRITE, READ and WRITE for
  2191.          details of input/output file handling.  Also refer to REWIND,
  2192.          FSAVE and FRESTORE for positioning controls.
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199. Version 2.8: 910717
  2200.  
  2201. COM-AND: IBM PC Communication Script Language                 Page  35
  2202.  
  2203.  
  2204. V.    Script Language Commands (continued)
  2205.  
  2206.  
  2207.     FOR Nx = <init> <final> [<step>]
  2208.  
  2209.          The FOR statement asserts the beginning of a loop, controlled
  2210.          by the value of a specific numeric index.    The initial value,
  2211.          the final value, and an optional step value are specified.
  2212.          [If a step value is not specified, a step of 1 is used.]
  2213.  
  2214.          The FOR statement initializes the index variable to the given
  2215.          value and performs commands until an ENDFOR is encountered.
  2216.          Upon ENDFOR, the index is incremented (or decremented) by the
  2217.          step value and the result tested against the given final value.
  2218.  
  2219.          If the step is positive, the loop terminates when the index is
  2220.          greater than the final value.  If the step is negative, the
  2221.          loop terminates when the index is less than the final value.
  2222.  
  2223.          Example:
  2224.  
  2225.          FOR N0 = 1,10         ; Loop for 10 times
  2226.          ...
  2227.          ENDFOR
  2228.  
  2229.  
  2230.          Note: (1) The STEP and FINAL values are evaluated when the
  2231.                FOR statement is encountered.  Changing intermediate
  2232.                values has no effect on the loop.
  2233.  
  2234.          Note: (2) The loop index specified should not be modified
  2235.                within the loop.  The results are unspecified if so.
  2236.  
  2237.          Note: (3) GOTO statements may never enter a FOR loop;  even
  2238.                to leave an inner loop to return to an outer loop.
  2239.  
  2240.          Note: (4) FOR statements may be nested (along with IF, SWITCH,
  2241.                WHILE and DO loops) up to 20 levels.  However, they
  2242.                may not overlap other FOR loops, or other flow-of-
  2243.                control statements.
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254. Version 2.8: 910717
  2255.  
  2256. COM-AND: IBM PC Communication Script Language                 Page  36
  2257.  
  2258.  
  2259. V.    Script Language Commands (continued)
  2260.  
  2261.  
  2262.  ->    FPUTC Sx
  2263.  ->    FPUTS Sx
  2264.  
  2265.          The FPUTC and FPUTS commands write a character (FPUTC) or a
  2266.          string (FPUTS) from a string variable to the output file.
  2267.          The output file must be opened by a previous FOPENO.
  2268.  
  2269.          In TEXT mode the FPUT commands translate LFs in the string
  2270.          buffer to CR/LF pairs.  No tab compression is performed.
  2271.  
  2272.          FPUTC writes a single character from Sx.
  2273.  
  2274.          FPUTS writes up to 80 characters from Sx, according to the
  2275.          length of the value in Sx.  Example:
  2276.  
  2277.  ->         FPUTS S0             ; Write up to 80 bytes
  2278.  
  2279.          Note also: FWRITE and WRITE commands.
  2280.  
  2281.  ->    FREAD Sx Nx Ny
  2282.  
  2283.          The FREAD command reads a string (up to Nx characters) into a
  2284.          string variable.  The input file must be opened by a previous
  2285.          FOPENI, of course.
  2286.  
  2287.          In TEXT mode, the FREAD command translates CR/LF pairs in the
  2288.          input file to single LFs, and the read operation ends.  No tab
  2289.          expansion is performed.  If the input file was opened in TEXT
  2290.          mode, the FREAD commands stop on an ASCII EOF character (Ctl-Z).
  2291.  
  2292.          FREAD reads up to 80 characters into Sx.  If the input file was
  2293.          opened in TEXT mode, the read string terminates at the 80th byte
  2294.          or at a CR/LF pair (placed in Sx as a single LF).    The count
  2295.          read is placed in Ny.
  2296.  
  2297.          Example:
  2298.  
  2299.  ->         FREAD S0 80 N4         ; Read 80 bytes; count read in N4
  2300.  
  2301.          The FREAD command sets the EOF condition on input EOF.  This
  2302.          may be tested with the IF statement.
  2303.  
  2304.          Note also: FGETC/FGETS/READ, and especially notes in READ.
  2305.  
  2306.  
  2307.  
  2308.  
  2309. Version 2.8: 910717
  2310.  
  2311. COM-AND: IBM PC Communication Script Language                 Page  37
  2312.  
  2313.  
  2314. V.    Script Language Commands (continued)
  2315.  
  2316.  
  2317.     FREE Sx <string>
  2318.  
  2319.          The FREE statement returns the free space (as a numeric string)
  2320.          on a given disc.  The second operand specifies the drive (""
  2321.          may be used for the default drive) as "d:", where d = a,b,c...
  2322.          Example:
  2323.  
  2324.          FREE S0 "C:"                   ; Get free space on C:
  2325.  
  2326.     FRESTOREI
  2327.     FRESTOREO
  2328.  
  2329.          The FRESTORE statement restores the last saved position in
  2330.          either the input or output file.  The FRESTORE statement sets
  2331.          the SUCCESS flag according to save-stack underflow.  See FSAVE
  2332.          below for more detail.  Example:
  2333.  
  2334.          FRESTOREI                ; Restore last saved position
  2335.  
  2336.     FRETURN
  2337.  
  2338.          The FRETURN command returns returns from an FCALL instruction.
  2339.          The current file is closed, and the previous file (the one
  2340.          containing the FCALL) continues.  If the file that invoked FCALL
  2341.          is encrypted, the previous password is NOT requested a second
  2342.          time.  Example:
  2343.  
  2344.          FRETURN                 ; Return to calling file
  2345.  
  2346.          The FCALL stack is limited to a depth of 10 FCALLs.
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364. Version 2.8: 910717
  2365.  
  2366. COM-AND: IBM PC Communication Script Language                 Page  38
  2367.  
  2368.  
  2369. V.    Script Language Commands (continued)
  2370.  
  2371.  
  2372.     FSAVEI [CLEAR!SHIFT!POP]
  2373.     FSAVEO [CLEAR!SHIFT!POP]
  2374.  
  2375.          The FSAVE statement saves the current file position (input or
  2376.          output) on a stack for later repositioning (FRESTORE).  Up to
  2377.          20 positions may be saved for each file.  The SUCCESS flag is
  2378.          set/reset according to save-stack overflow.  Example:
  2379.  
  2380.          FSAVEI                 ; To come back later
  2381.  
  2382.          Three subcommands are also provided:
  2383.  
  2384.          FSAVE[I!O] CLEAR             ; Zeroes the save-stack
  2385.          FSAVE[I!O] SHIFT             ; Shifts the stack down one
  2386.          FSAVE[I!O] POP             ; Throws away last saved pos
  2387.  
  2388.          The appropriate file must be open before FSAVE is used.  The
  2389.          FCLOSEx (and FOPENx) instruction clears its save-stack.
  2390.  
  2391.     FSIZE Sx <file>
  2392.  
  2393.          The FSIZE command sets the file size (up to seven digits) into
  2394.          the target string (Sx).  The file name specification may be a
  2395.          literal quoted string, or a string variable.  The SIZE is
  2396.          formatted with leading zeroes blanked and the string right
  2397.          justified in a space of 7 characters.  Example:
  2398.  
  2399.          FSIZE S3 "COM-AND.EXE"          ; Format into S3
  2400.  
  2401.          The FSIZE command sets and resets the SUCCESS flag according
  2402.          to the presence of the named file.
  2403.  
  2404.     FTIME Sx <file> [0!1]
  2405.  
  2406.          The FTIME command sets the time last modified (as known by DOS)
  2407.          into the target string (Sx).  The file name specification may
  2408.          be a literal quoted string, or a string variable.    The TIME is
  2409.          formatted according to the optional format argument (if provided
  2410.          and nonzero, the time is formatted hh:mm:ss where hh is 0-23;
  2411.          otherwise it is formatted hh:mm:ss with a final AM or PM).
  2412.          Example:
  2413.  
  2414.          FTIME S3 "COM-AND.EXE" 1        ; Format military time into S3
  2415.  
  2416.          The FTIME command sets and resets the SUCCESS flag.
  2417.  
  2418.  
  2419. Version 2.8: 910717
  2420.  
  2421. COM-AND: IBM PC Communication Script Language                 Page  39
  2422.  
  2423.  
  2424. V.    Script Language Commands (continued)
  2425.  
  2426.  
  2427.  ->    FWRITE Sx Nx
  2428.  
  2429.          The FWRITE command writes a string from a string variable to
  2430.          the output file.  The length of the string variable is specified
  2431.          by Nx.  The output file must be opened by a previous FOPENO.
  2432.  
  2433.          In TEXT mode the FWRITE command translates LFs in the string
  2434.          buffer to CR/LF pairs.  No tab compression is performed.
  2435.  
  2436.          FWRITE writes up to 80 characters from Sx, according to the
  2437.          value in Nx.
  2438.  
  2439.          Example:
  2440.  
  2441.  ->         FPUTS S0 75         ; Write 75 bytes
  2442.  
  2443.          Note also: FPUTC/FPUTS/WRITE and especially the WRITE command.
  2444.  
  2445.  ->    GET Sx [<number>]
  2446.  
  2447.          The GET command reads the keyboard for text.  Text entry is
  2448.          terminated by a carriage return, or, if the optional numeric
  2449.          argument was supplied, after <number> characters.    Keyentry is
  2450.          echoed back to the screen.  Escape entered in response to the
  2451.          GET command terminates the script.  Example:
  2452.  
  2453.  ->         MESSAGE "^MEnter a password:"
  2454.  ->         GET S0 8             ; Get up to 8 characters
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474. Version 2.8: 910717
  2475.  
  2476. COM-AND: IBM PC Communication Script Language                 Page  40
  2477.  
  2478.  
  2479. V.    Script Language Commands (continued)
  2480.  
  2481.  
  2482.  ->    GETFILE ASCII    <string>     ; A.K.A. Buffer capture
  2483.  ->    GETFILE BYMODEM          ; Batch YMODEM
  2484.  ->    GETFILE BYMODEMG         ; Batch YMODEM-G (BYMOG works too)
  2485.  ->    GETFILE CISB             ; CompuServe B-protocol
  2486.  ->    GETFILE KERMIT             ; Kermit or SuperKermit
  2487.     GETFILE QUICKB             ; CompuServe Quick B-protocol
  2488.  ->    GETFILE RXMODEM <string>     ; Relaxed CRC or Checksum XMODEM
  2489.  ->    GETFILE WXMODEM <string>     ; Windowed XMODEM
  2490.  ->    GETFILE XMODEM    <string>     ; CRC or Checksum XMODEM
  2491.  ->    GETFILE YMODEM    <string>     ; Simple YMODEM (not True ... (TM))
  2492.     GETFILE ZMODEM             ; ZMODEM transfer (batch)
  2493.  
  2494.          The GETFILE statement initiates a download using one of the
  2495.          specified protocols.  The <string> argument must specify a
  2496.          valid file name.  [If the specified file name exists with one
  2497.          of the XMODEMs, a manual "Purge?" query will pop-up.] The
  2498.          GETFILE command sets SUCCESS/FAILURE condition according to
  2499.          the transfer.  Example:
  2500.  
  2501.  ->         GETFILE XMODEM "com-and.arc"  ; Download
  2502.  
  2503.          Note that, in the cases of CISB, KERMIT,Batch YMODEM (G), and
  2504.          ZMODEM, the host tells COM-AND the name the file will take on
  2505.          your machine.  If the name duplicates an existing name, charac-
  2506.          ters of the extent are replaced by '$' (right to left).  [If
  2507.          ZMODEM recovery is enabled, a ZMODEM transfer picks up where
  2508.          a failed transfer stopped, using the same file name.]
  2509.  
  2510.  
  2511.          Notes:
  2512.  
  2513.          (1) With ASCII transfers, you must manually terminate the
  2514.          capture with ESC.
  2515.  
  2516.          (2) XMODEM and YMODEM (XMODEM1K) automatically purge the target
  2517.          file if found.  No manual intervention is required.
  2518.  
  2519.          (3) ZMODEM and CIS-B ( and QuickB) provide an automated download
  2520.          function.  The automated function is NOT available within a
  2521.          script unless the script is 'reading the port', i.e. with an
  2522.          RGET, PAUSE or SUSPEND statement.
  2523.  
  2524.          (4) ZMODEM recovery (of a failed transfer) may be enabled and
  2525.          disabled with the SET ZMODEM RECOVER statement.
  2526.  
  2527.  
  2528.  
  2529. Version 2.8: 910717
  2530.  
  2531. COM-AND: IBM PC Communication Script Language                 Page  41
  2532.  
  2533.  
  2534. V.    Script Language Commands (continued)
  2535.  
  2536.  
  2537.  ->    GOSUB <label>
  2538.  
  2539.          The GOSUB statement transfers control to the label specified in
  2540.          <label>.  When a RETURN statement is encountered, execution
  2541.          resumes at the next statement (after the GOSUB).  GOSUB commands
  2542.          may be nested to a maximum stack depth of 20.  Example:
  2543.  
  2544.          IF FOUND             ; Test result of a FIND
  2545.  ->        GOSUB "SUB"          ; If we found it, transfer to sub
  2546.  ->        ENDIF             ; .. and return here
  2547.          ...
  2548.  ->         EXIT             ; End of main-line script
  2549.          ...
  2550.  ->         SUB:
  2551.  ->         MESSAGE "..."           ; Issue a message
  2552.  ->         RETURN             ; And return to after the GOSUB
  2553.  
  2554.          All of the following are legitimate GOSUB's:
  2555.  
  2556.  ->         GOSUB LABEL         ; Direct LABEL name
  2557.  ->         GOSUB "LABEL"           ; Quoted LABEL name
  2558.  
  2559.          ASSIGN S0 "LABEL"       ; Assign label name to a string
  2560.          GOSUB S0             ; And goto the label in S0
  2561.  
  2562.          Note that you cannot GOSUB to a label in a file that has FCALLed
  2563.          the current file.    This includes ON ESCAPE GOSUB and ON SILENCE
  2564.          GOSUB conditions (see below).  The FCALLed file may however have
  2565.          a label that duplicates one in the caller's file.  In the latter
  2566.          case, the GOSUB transfers to the label in the FCALLed file.
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584. Version 2.8: 910717
  2585.  
  2586. COM-AND: IBM PC Communication Script Language                 Page  42
  2587.  
  2588.  
  2589. V.    Script Language Commands (continued)
  2590.  
  2591.  
  2592.  ->    GOTO <label>
  2593.  
  2594.          The GOTO statement unconditionally transfers control to the
  2595.          label specified in <label>.  If there is more than one <label>
  2596.          in the script file that matches <label> control is transferred
  2597.          to the one nearest the beginning of the script.  Example:
  2598.  
  2599.  ->         IF FAILURE          ; Test previous command execution
  2600.  ->        GOTO "ERROR"         ; Branch if it didn't work
  2601.  ->        ENDIF             ; End error test
  2602.          ...
  2603.  ->         ERROR:
  2604.  ->         EXIT             ; Terminate the script
  2605.  
  2606.          Note:  GOTO's may be used to transfer control out of an IF,
  2607.          CASE, DO, or WHILE clause.  However:  GOTO's should never be
  2608.          used to transfer control INTO one or the other clauses of an IF,
  2609.          CASE, DO or WHILE structure.  This warning includes transfer out
  2610.          of an IF clause into an enveloping IF clause.  "Unexpected
  2611.          ENDIF" or "Unexpected ENDCASE" error messages result from such
  2612.          practice.    For example:
  2613.  
  2614.          IF condition         ; Example of a nested IF
  2615.         ...
  2616.         IF condition
  2617.            GOTO SKIP_It      ; This is INVALID!!!  It branches
  2618.            ENDIF         ; .. into an IF clause out of one
  2619.         ...
  2620.          SKIP_It:             ; This label is within the outer IF
  2621.         ...             ;          !!! INVALID !!!
  2622.         ENDIF             ; End of outer IF
  2623.  
  2624.          Like the GOSUB statement, the operand of a GOTO statement may
  2625.          be a literal label, a quoted label, or a string variable
  2626.          containing the label as text.
  2627.  
  2628.          Note:  GOTO's may not be used to transfer control out of a
  2629.          subroutine.  "Stack overflows" will eventually be reported if
  2630.          this happens.
  2631.  
  2632.          Note:  GOTO's will not exit an FCALLed file to reach a label in
  2633.          a previous file (the caller or caller of caller).    The domain of
  2634.          labels used by GOTO is the current script file, and does not
  2635.          include calling files.
  2636.  
  2637.  
  2638.  
  2639. Version 2.8: 910717
  2640.  
  2641. COM-AND: IBM PC Communication Script Language                 Page  43
  2642.  
  2643.  
  2644. V.    Script Language Commands (continued)
  2645.  
  2646.  
  2647.  ->    HANGUP
  2648.  
  2649.          The HANGUP command terminates the modem connection (if connec-
  2650.          tion has been established).  It changes CONNECTED condition
  2651.          (tested with the IF statement, if true CD is enabled on the
  2652.          modem).  Example:
  2653.  
  2654.  ->         HANGUP             ; Disconnect:  we're done
  2655.  
  2656.  
  2657.  
  2658.  
  2659.  
  2660.  
  2661.  
  2662.  
  2663.  
  2664.  
  2665.  
  2666.  
  2667.  
  2668.  
  2669.  
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677.  
  2678.  
  2679.  
  2680.  
  2681.  
  2682.  
  2683.  
  2684.  
  2685.  
  2686.  
  2687.  
  2688.  
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694. Version 2.8: 910717
  2695.  
  2696. COM-AND: IBM PC Communication Script Language                 Page  44
  2697.  
  2698.  
  2699. V.    Script Language Commands (continued)
  2700.  
  2701.  
  2702.  ->    IF [NOT] <condition> [<statement>]
  2703.  
  2704.          The IF statement tests a stated condition, and transfers control
  2705.          according to the result of the test.  The IF statement may carry
  2706.          the statement to be performed conditionally, or it may precede
  2707.          statements to be executed if the evaluation is true.
  2708.  
  2709.          In the latter case, and ONLY in that case (where the statements
  2710.          to be conditionally executed follow the IF statement), the
  2711.          script may include an optional ELSE clause, to be executed if
  2712.          the condition evaluated is found false.  The domain of this form
  2713.          of IF control is terminated with an ENDIF statement.
  2714.  
  2715.          This construction of the IF statements may be nested up to a
  2716.          maximum stack depth of 20 (with SWITCH DO, FOR, WHILE, and
  2717.          GOSUBs).  Example:
  2718.  
  2719.  ->         IF <condition>         ; Test condition
  2720.  ->        GOSUB "TRUE"         ; .. execute this if true
  2721.  ->         ELSE             ; Optional ELSE clause
  2722.  ->        GOSUB "FALSE"        ; .. execute this if condition false
  2723.  ->         ENDIF             ; End of IF
  2724.  
  2725.          An equally legitimate construction could be:
  2726.  
  2727.          IF <condition> GOSUB "TRUE"
  2728.          IF NOT <condition> GOSUB "FALSE"
  2729.  
  2730.          Or even:
  2731.  
  2732.  ->         IF <condition>         ; Test condition
  2733.  ->        GOSUB "TRUE"         ; .. execute this if true
  2734.          ELSE GOSUB "False"      ; ENDIF-less form
  2735.  
  2736.          Please note however, that the following construction is invalid.
  2737.  
  2738.          IF GOSUB "TRUE"         ; This statement allows NO ELSE or ENDIF
  2739.          ELSE GOSUB "False"      ; Therefore, this statement fails
  2740.  
  2741.          IF conditions may be joined with AND, OR, and XOR within one
  2742.          IF statement.  Parentheticization is also supported.  This
  2743.          extension will be discussed below, after the conditions are
  2744.          listed.
  2745.  
  2746.  
  2747.  
  2748.  
  2749. Version 2.8: 910717
  2750.  
  2751. COM-AND: IBM PC Communication Script Language                 Page  45
  2752.  
  2753.  
  2754. V.    Script Language Commands (continued)
  2755.  
  2756.  
  2757.  ->    IF <condition> (continued)
  2758.  
  2759.          The optional keyword NOT may precede the condition being tested
  2760.          to reverse its meaning.  IF conditions are:
  2761.  
  2762.          ALLOCATED         The ALLOCATED condition is true if dynamic
  2763.                  variables are currently allocated.
  2764.  
  2765.          ALPHA Sx         The ALPHA condition tests the first character
  2766.                  of the given string.  It is true if it finds
  2767.                  A-z or a-z.
  2768.  
  2769.  ->         CONNECTED         The CONNECTED condition is set and reset
  2770.                  according to the CD (carrier detect) of the
  2771.                  modem.  If your modem does not report true
  2772.                  CD, then this condition will not be reliable.
  2773.  
  2774.          CONTROL Sx      The CONTROL condition tests the first character
  2775.                  of the given string.  It is true when the first
  2776.                  character has a value less than 32 (' ').
  2777.  
  2778.          ERROR         The ERROR condition is set and reset by the
  2779.                  script processor after each command.  If the
  2780.                  command was syntactically or semantically
  2781.                  invalid, this condition is set.
  2782.  
  2783.  ->         EOF         The EOF condition is set and reset by the
  2784.                  last FGETS/FGETC/FREAD/READ statements.
  2785.  
  2786.  ->         HITKEY         The HITKEY condition is true if a keypress
  2787.                  is pending (it will not be read).    Note: Use
  2788.                  of this function suspends normal type-through
  2789.                  until a GET/MGET/ATGET/MATGET/KEYGET/KFLUSH
  2790.                  is performed, regardless of value returned.
  2791.  
  2792.                  Use of HITKEY may inhibit ESC termination!
  2793.  
  2794.  ->         FAILED         The FAILED condition is simply "NOT SUCCESS".
  2795.  
  2796.          FCALLED         The FCALLED condition tests if the current
  2797.                  script file was entered via an FCALL state-
  2798.                  ment (if is false unless an FRET is needed).
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804. Version 2.8: 910717
  2805.  
  2806. COM-AND: IBM PC Communication Script Language                 Page  46
  2807.  
  2808.  
  2809. V.    Script Language Commands (continued)
  2810.  
  2811.  
  2812.  ->    IF <condition> (continued)
  2813.  
  2814.          FIND Sx Sy [Nx] The FIND condition is actually a FIND per-
  2815.                  formed within the IF statement.  The syntax
  2816.                  and function are identical to the instruction.
  2817.  
  2818.          FKEY         The FKEY condition works in a fashion similar to
  2819.                  HITKEY.  FKEY waits for a function key (not an
  2820.                  ASCII key) to be pressed.    ASCII keystrokes are
  2821.                  typed-through (if TTHRU is on).
  2822.  
  2823.          FLAG [(#)]      The FLAG condition tests the current state
  2824.                  of flag number # (0-9).  Flags are set and
  2825.                  with the script instruction SET FLAG.
  2826.  
  2827.  ->         FOUND         The FOUND condition is set and reset by
  2828.                  the last FIND statement.
  2829.  
  2830.          FULL         The FULL condition works in a fashion similar to
  2831.                  XOFF.  FULL is true when COM-AND has XOFFed the
  2832.                  other side (SOFT flow control must therefore be
  2833.                  ON for this test to be of use).
  2834.  
  2835.          ISDLFILE Sx     The ISDLFILE condition is actually a ISDLFILE
  2836.                  performed within the IF statement.  The syntax
  2837.                  and function are identical to the instruction.
  2838.  
  2839.          ISFILE Sx         The ISFILE condition is actually a ISFILE
  2840.                  performed within the IF statement.  The syntax
  2841.                  and function are identical to the instruction.
  2842.  
  2843.          ISSCFILE Sx     The ISSCFILE condition is actually a ISSCFILE
  2844.                  performed within the IF statement.  The syntax
  2845.                  and function are identical to the instruction.
  2846.  
  2847.  ->         LINKED         The LINKED condition is true when the
  2848.                  script being executed was invoked from a
  2849.                  dialing directory entry.
  2850.  
  2851.  ->         MONO         The MONO condition is true if the CRT is
  2852.                  a monochrome monitor (mode 7).
  2853.  
  2854.          NULL Sx         The NULL condition tests the given string
  2855.                  and is true if the string is blank or null.
  2856.  
  2857.  
  2858.  
  2859. Version 2.8: 910717
  2860.  
  2861. COM-AND: IBM PC Communication Script Language                 Page  47
  2862.  
  2863.  
  2864. V.    Script Language Commands (continued)
  2865.  
  2866.  
  2867.  ->    IF <condition> (continued)
  2868.  
  2869.          NUMERIC Sx      The NUMERIC condition tests the first charac-
  2870.                  ter of the given string.  It is true if it
  2871.                  finds one of the characters 0-9.
  2872.  
  2873.          PRINTER         The PRINTER condition tests for the printer
  2874.                  enabled through COM-AND (PRINTER ON!OFF).
  2875.  
  2876.          OVERLAY         The OVERLAY condition tests for the presence of
  2877.                  a machine language overlay file.
  2878.  
  2879.          RECEIVE         The RECEIVE condition tests for characters
  2880.                  pending on the comm port.    It is true if one
  2881.                  or more characters are ready to be read.
  2882.  
  2883.          SPECIAL Sx      The SPECIAL condition tests the first charac-
  2884.                  ter of the given string.  It is true if the
  2885.                  character is not alpha, numeric or control.
  2886.  
  2887.          STRCMP Sx Sy    The STRCMP condition is actually a STRCMP
  2888.                  performed within the IF statement.  The syntax
  2889.                  and function are identical to the instruction.
  2890.  
  2891.  ->         SUCCESS         The SUCCESS condition is set and reset
  2892.                  according to the result of the last GETFILE,
  2893.                  SENDFILE, ISFILE, RGET, DOS, RUN, LOG OPEN,
  2894.                  FFIRST, FNEXT, FDATE, FTIME, FSIZE, FATTR,
  2895.                  RENAME, REWIND, DELETE and DIAL statements.
  2896.  
  2897.          TRACE         The TRACE condition tests the TRACE ON!OFF
  2898.                  status.
  2899.  
  2900.  ->         WAITFOR         The WAITFOR condition is set and reset
  2901.                  by the last WAITFOR statement.
  2902.  
  2903.          XOFF         The XOFF condition tests to determine if an XOFF
  2904.                  received from the host is currently pending.
  2905.                  SOFT flow control must be ON for this test.
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914. Version 2.8: 910717
  2915.  
  2916. COM-AND: IBM PC Communication Script Language                 Page  48
  2917.  
  2918.  
  2919. V.    Script Language Commands (continued)
  2920.  
  2921.  
  2922.  ->    IF <condition> (continued)
  2923.  
  2924.  ->         ZERO Nx         The ZERO condition must be qualified by a
  2925.                  numeric value/variable.  The condition is
  2926.                  true if the evaluation is 0.
  2927.  
  2928.                  Note: Expressions may be used in place of Nx,
  2929.                  if the expression is parentheticized.  For
  2930.                  example: "IF ZERO (N0-10)" is allowed.
  2931.  
  2932.  ->         <cc> Nx Ny      Numeric conditionals are expressed as <cc>
  2933.                  (where <cc> may be EQ, LT, GT, LE, GE, NE)
  2934.                  followed by two numeric values/variables.
  2935.                  IF LT N1 N2 is interpreted: IF N1 LT N2.
  2936.  
  2937.                  Note: "NE" is not ASPECT/PROCOMM compatible.
  2938.  
  2939.                  Note: An expressions may be used in place of Nx
  2940.                  or Ny, if the expression is parentheticized.
  2941.                  For example: "IF GT (N0-5) 25" is allowed.
  2942.  
  2943.          Nx <cc> Ny      COM-AND allows the normal comparison form to be
  2944.                  used, as well.  However, as conditional evalua-
  2945.                  tion allows parentheses, the first numeric ex-
  2946.                  pression DOES NOT allow parentheses.  Opening
  2947.                  parens of a conditional expression are taken to
  2948.                  apply to the conditional, not the numeric.  For
  2949.                  example:
  2950.                       IF (N10-2) eq 5    ; Always fails
  2951.                       IF N10-2 eq 5    ; Is fine
  2952.                       IF (N10-2 eq 5)    ; Is fine, too
  2953.  
  2954.  
  2955.          [Discussion continues on the next page.]
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969. Version 2.8: 910717
  2970.  
  2971. COM-AND: IBM PC Communication Script Language                 Page  49
  2972.  
  2973.  
  2974. V.    Script Language Commands (continued)
  2975.  
  2976.  
  2977.  ->    IF <condition> (continued)
  2978.  
  2979.          IF conditions may be joined with AND, OR, and XOR within one
  2980.          IF statement.  Parentheticization is also supported.  For
  2981.          example, the statement:
  2982.  
  2983.              IF NOT (FLAG(0) or FLAG(1)) and FLAG(2)
  2984.             ...
  2985.  ->            ENDIF
  2986.  
  2987.          AND's FLAG(2) with the negated result of an OR between FLAG(0)
  2988.          and FLAG(1).  All clauses are evaluated before the IF is per-
  2989.          formed.  In simpler words, FLAG(2) must be "on", AND both
  2990.          FLAG(1) and FLAG(0) must be "off".
  2991.  
  2992.          In the above example, the NOT applies to the result of the
  2993.          parenthetical "(FLAG(0) or FLAG(1))".  When NOT precedes a
  2994.          condition without parentheses it applies ONLY to that condi-
  2995.          tion.   For example the two fragments below are equivalent:
  2996.  
  2997.          IF NOT FLAG(0) and FLAG(1)  =   IF NOT FLAG(0)
  2998.         ...             =    IF FLAG(1)
  2999.  ->        ENDIF             =       ...
  3000.                      =       ENDIF
  3001.                      =    ENDIF
  3002.  
  3003.  ->    INC Nx
  3004.  
  3005.          The INC command performs the instruction:    Nx = Nx+1.  No error
  3006.          checking is performed;  should the value exceed the range of a
  3007.          numeric variable, results are unpredictable.  Example:
  3008.  
  3009.  ->         INC N1             ; N1 = N1+1
  3010.  
  3011.  ->    INIT Nx <number>
  3012.  
  3013.          The INIT statement assigns a value to a numeric variable just as
  3014.          ASSIGN assigns a value to a string variable.  Example:
  3015.  
  3016.  ->         INIT N5 5             ; Initialize N5
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024. Version 2.8: 910717
  3025.  
  3026. COM-AND: IBM PC Communication Script Language                 Page  50
  3027.  
  3028.  
  3029. V.    Script Language Commands (continued)
  3030.  
  3031.  
  3032.     INPUT Nx <address>
  3033.  
  3034.          The INPUT statement performs a machine level INPUT instruction
  3035.          using the address given.  WARNING: If you're not sure what a
  3036.          'machine level INPUT instruction' is... do not use this!
  3037.  
  3038.          INPUT N0 0x61         ; Read the speaker driver chip
  3039.  
  3040.     ISDLFILE <string>
  3041.  
  3042.          The ISDLFILE statement tests for the presence of a file named
  3043.          in <string> in the current download directory (see SET DLDIR).
  3044.          <String> must contain an unqualified file.ext, (it should not
  3045.          contain a fully pathed file name).  ISDLFILE sets the SUCCESS
  3046.          condition according to the presence of the named file.
  3047.          Example:
  3048.  
  3049.          ISDLFILE "COM-AND.EXE"  ; Is this file in download dir?
  3050.  
  3051.          Note that ISDLFILE may also be used with IF as the condi-
  3052.          tional test (e.g. IF ISDLFILE S0 ...).
  3053.  
  3054.  ->    ISFILE <string>
  3055.  
  3056.          The ISFILE statement tests for the presence of a file named in
  3057.          <string>.    <String> contains an unqualified file.ext (or may
  3058.          contain a fully pathed file name).  ISFILE sets the SUCCESS
  3059.          condition according to the presence of the named file.  Example:
  3060.  
  3061.  ->         ISFILE "COM-AND.EXE"    ; Is this file in current dir?
  3062.          ISFILE "D:\COM-AND\COM-AND.EXE"
  3063.  
  3064.          Note that ISFILE may also be used with IF as the condi-
  3065.          tional test (e.g. IF ISFILE S0 ...).
  3066.  
  3067.  
  3068.  
  3069.  
  3070.  
  3071.  
  3072.  
  3073.  
  3074.  
  3075.  
  3076.  
  3077.  
  3078.  
  3079. Version 2.8: 910717
  3080.  
  3081. COM-AND: IBM PC Communication Script Language                 Page  51
  3082.  
  3083.  
  3084. V.    Script Language Commands (continued)
  3085.  
  3086.  
  3087.     ISSCFILE <string>
  3088.  
  3089.          The ISSCFILE statement tests for the presence of a potential
  3090.          script file named in <string> in the current directory and in
  3091.          the drive:subdirectory specified through the COM-AND= environ-
  3092.          ment variable.  <String> must contain an unqualified file.ext,
  3093.          (or may contain a fully pathed file name).  The SUCCESS
  3094.          condition is set according to the presence of the named file.
  3095.          Example:
  3096.  
  3097.          ISSCFILE "STCLOGON'     ; Is this file available?
  3098.  
  3099.          Note that ISSCFILE may also be used with IF as the condi-
  3100.          tional test (e.g. IF ISSCFILE S0 ...).
  3101.  
  3102.  ->    ITOA Nx Sx
  3103.  
  3104.          The ITOA statement converts a value in a numeric variable to
  3105.          a string variable.  The value is left justified, with leading
  3106.          zeroes suppressed.  Example:
  3107.  
  3108.          N0 = 0             ; N0 now contains 0
  3109.  ->         ITOA N0 S1          ; S1 now contains "0"
  3110.  
  3111.     ITOC Nx Sx[(#)]
  3112.  
  3113.          The ITOC statement converts a value to a single character (for
  3114.          non-ASCII values).  Only a single character is deposited, the
  3115.          low 8 bits of the value.  Example:
  3116.  
  3117.          N0 = 1             ; N0 now contains 1 (which is SOH)
  3118.          ITOC N0 S1          ; S1(0:0) now contains SOH
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124.  
  3125.  
  3126.  
  3127.  
  3128.  
  3129.  
  3130.  
  3131.  
  3132.  
  3133.  
  3134. Version 2.8: 910717
  3135.  
  3136. COM-AND: IBM PC Communication Script Language                 Page  52
  3137.  
  3138.  
  3139. V.    Script Language Commands (continued)
  3140.  
  3141.  ->    KEYGET Sx
  3142.  
  3143.          The KEYGET statement waits for and reads a single keystroke.
  3144.          The returned string is formatted so that the various possible
  3145.          keys are distinguishable.
  3146.  
  3147.          Printable ASCII keystrokes return one character in Sx.
  3148.  
  3149.          Non-printable ASCII keystrokes (e.g.  ESC) are returned as two
  3150.          hex digits (e.g.  ESC returns "1B").
  3151.  
  3152.          Special keys (function and cursor keys) are returned as four
  3153.          hex digits, the last two being '00'.  For example, the F1 key
  3154.          is returned as "3B00".  Example:
  3155.  
  3156.  ->         KEYGET S3             ; Read one keystroke
  3157.  
  3158.  ->    KFLUSH
  3159.  
  3160.          The KFLUSH statement flushes the keyboard of keystrokes.  It
  3161.          is intended for conditions where type-ahead is not appropriate
  3162.          (e.g.  under error conditions).  Example:
  3163.  
  3164.  ->         KFLUSH             ; Throw away key entry
  3165.  
  3166.     LD Sx <number>
  3167.  
  3168.          The LD command returns a long distance string from the dialing
  3169.          directory (or blanks).  A directory number may be specified
  3170.          (0,1,2,3,4 are allowed, 1="+",2="-",3="#",4="@", and 0 is a
  3171.          place holder).  Note the number field is not optional.  Example:
  3172.  
  3173.          LD S0 1                 ; Fetch the "+" string
  3174.  
  3175.     LEGEND <string>
  3176.  
  3177.          The LEGEND statement places the given text into the status line
  3178.          on the 25th line of the screen.  If <string> is blank, the
  3179.          status line reverts to COM-AND status line notes during script
  3180.          processing.  Example:
  3181.  
  3182.          LEGEND "Scripted host mode in effect: Press ESC to abort"
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189. Version 2.8: 910717
  3190.  
  3191. COM-AND: IBM PC Communication Script Language                 Page  53
  3192.  
  3193.  
  3194. V.    Script Language Commands (continued)
  3195.  
  3196.  
  3197.     LENGTH Sx Nx
  3198.  
  3199.          The LENGTH statement computes the current length of the string
  3200.          Sx (1,2,3...80) and places length in the numeric variable Nx.
  3201.          Example:
  3202.  
  3203.          S0 = "   "              ; Set-up a value
  3204.          LENGTH S0 N0         ; N0 should now contain 3
  3205.  
  3206.          Note that lengths range from 0 through 80, while character
  3207.          positions range from 0 through 79.
  3208.  
  3209.     LJ Sx
  3210.  
  3211.          The LJ command left justifies the contents of the given string
  3212.          variable (within its actual length).  Example:
  3213.  
  3214.          LJ S0                 ; Left justify
  3215.  
  3216.     LOAD (DIAL!MACR!ACCE!DEFA!ALLOC) <fname for DIAL/MACR/ACCE/ALLOC>
  3217.  
  3218.          The LOAD command loads a settings file (either the dialing
  3219.          directory, macro definition, accessory definition, defaults,
  3220.          or allocated variables).  Note that 'LOAD DIAL "name"' is
  3221.          equivalent to 'DLOAD "name"'.  MLOAD, ALOAD and RESET are
  3222.          similarly redefined.  Example:
  3223.  
  3224.          LOAD DIAL "com-and.dir"         ; Load original dial dir
  3225.          LOAD DEFAULT             ; Note: takes no file name
  3226.  
  3227.  ->    LOCATE <number> <number>
  3228.  
  3229.          The LOCATE statement positions the cursor to the row and
  3230.          optionally the column specified by the arguments.    The first
  3231.          argument is the row number (0-24, or 0-42).  The second number
  3232.          is the column number (0-79).  Note that a column argument
  3233.          requires a row argument.  Example:
  3234.  
  3235.  ->         LOCATE  0,0         ; Position to home (upper left)
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244. Version 2.8: 910717
  3245.  
  3246. COM-AND: IBM PC Communication Script Language                 Page  54
  3247.  
  3248.  
  3249. V.    Script Language Commands (continued)
  3250.  
  3251.  
  3252.  ->    LOG OPEN <string>
  3253.  ->    LOG CLOSE
  3254.  ->    LOG SUSPEND
  3255.  ->    LOG RESUME
  3256.     LOG MARKED (ON!OFF)
  3257.  
  3258.          The LOG subcommands OPEN a file for logging, CLOSE an open LOG
  3259.          file, SUSPEND logging, RESUME logging after suspension, and turn
  3260.          timestamp MARKing in the log on/off.
  3261.  
  3262.          The LOG OPEN command requires a file name in <string>.  <String>
  3263.          contains an unqualified file.ext (or may contain a fully
  3264.          pathed file name, not PROCOMM compatible).  Example:
  3265.  
  3266.  ->         LOG OPEN "Log.txt"      ; Open log file and start logging
  3267.          LOG OPEN "E:log.txt"    ; OPen log on RAM drive
  3268.  
  3269.          LOG OPEN sets the SUCCESS/FAILURE condition (tested with
  3270.          the IF statement).
  3271.  
  3272.     LOWER Sx
  3273.  
  3274.          The LOWER statement lower cases all alphabetic characters in
  3275.          Sx.  Example:
  3276.  
  3277.          LOWER S5             ; Force all lower case
  3278.  
  3279.  ->    MACRO <number> [Sx]
  3280.  
  3281.          The MACRO statement will (1) transmit macro number 0-9 from the
  3282.          currently open Macro Definition file (Alt-M) or (2) deposit the
  3283.          macro string 0-9 into a string variable.  Example:
  3284.  
  3285.  ->         MACRO 8             ; Send macro #8, which winks
  3286.          MACRO 8 S0          ; Read macro #8 into a string variable
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.  
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299. Version 2.8: 910717
  3300.  
  3301. COM-AND: IBM PC Communication Script Language                 Page  55
  3302.  
  3303.  
  3304. V.    Script Language Commands (continued)
  3305.  
  3306.  
  3307.  ->    MANUAL <number>
  3308.  
  3309.          The MANUAL statement invokes an interactive window (i.e. as if
  3310.          in CRT mode, in response to an Alt'd Key).  The number operand
  3311.          is the scan code equivalent of the Alt'd or Function key that
  3312.          would invoke the window in interactive mode.  For example:
  3313.  
  3314.          MANUAL 0x2000          ; Invoke Alt-D
  3315.  
  3316.          The interactive window is terminated with ESCape (in all cases
  3317.          except Alt-F10).  The script author is referred to a list of
  3318.          extended keycodes for the operand.  Simply, however:
  3319.  
  3320.         ALT  Q,W,E,R,T,Y,U,I,O,P    -> 0x10 through 0x19
  3321.         ALT  A,S,D,F,G,H,J,K,L        -> 0x1E through 0x26
  3322.         ALT  Z,X,C,V,B,N,M        -> 0x2C through 0x32
  3323.         F1 through F10            -> 0x3B through 0x44
  3324.         ALT  1,2,3,4,5,6,7,8,9,0,-,=    -> 0x78 through 0x83
  3325.         PgUp, PgDn            -> 0x49, 0x51
  3326.  
  3327.          These values make the first two digits of the hex equivalent.
  3328.          The second two digits are always '00'.
  3329.  
  3330.  ->    MATGET row col attr len Sx
  3331.  
  3332.          The MATGET statement performs the MGET function, i.e.  reading
  3333.          the keyboard for a length with masked echo, with cursor
  3334.          positioning and color control.  Example:
  3335.  
  3336.  ->         MATGET 0 0 15 5 S5      ; Read up to 5 chars into S5 from 0,0
  3337.          MATGET 0 0 (black white) 5 S5
  3338.  
  3339.          Note that the cursor is left positioned after the last
  3340.          character read.
  3341.  
  3342.  
  3343.  
  3344.  
  3345.  
  3346.  
  3347.  
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354. Version 2.8: 910717
  3355.  
  3356. COM-AND: IBM PC Communication Script Language                 Page  56
  3357.  
  3358.  
  3359. V.    Script Language Commands (continued)
  3360.  
  3361.  
  3362.     MCR Nx
  3363.  
  3364.          The MCR command reads the modem control register and returns
  3365.          an 8 bit value in a numeric register.  Example:
  3366.  
  3367.          MCR N0             ; Read the MCR
  3368.  
  3369.          The format of the bits of the MCR are (please refer to your
  3370.          modem's documentation):
  3371.  
  3372.        (msb) xxxxxxxx (lsb)
  3373.             ^------------------------  DTR (data terminal ready)
  3374.            ^-------------------------  RTS (request to send)
  3375.           ^--------------------------  OUT1
  3376.          ^---------------------------  OUT2
  3377.         ^----------------------------  LOOPBACK
  3378.            ^-----------------------------  Unused
  3379.           ^------------------------------  Unused
  3380.          ^-------------------------------  Unused
  3381.  
  3382.  ->    MDIAL <string>
  3383.  
  3384.          The MDIAL statement dials the number in <string> manually.  The
  3385.          value in <string> must be a valid (to the modem) telephone num-
  3386.          ber, and is limited to 14 characters width.  Example:
  3387.  
  3388.  ->         MDIAL "245-9110"        ; Dial P/Link direct
  3389.  
  3390.     MDIR <string>
  3391.  
  3392.          The MDIR statement creates a subdirectory specified as drive:
  3393.          path in the string operand.  MDIR performs exactly as the DOS
  3394.          MD command, succeeding and failing in exactly the same cases.
  3395.          MDIR sets SUCCESS or FAILURE according to the result.  Example:
  3396.  
  3397.          MDIR "A:\TEMP"             ; Create a temp subdir
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409. Version 2.8: 910717
  3410.  
  3411. COM-AND: IBM PC Communication Script Language                 Page  57
  3412.  
  3413.  
  3414. V.    Script Language Commands (continued)
  3415.  
  3416.  
  3417.  ->    MESSAGE <string>
  3418.  
  3419.          The MESSAGE statement displays a line of text on the local
  3420.          console.  If logging is enabled, the text is logged as well.
  3421.          Control characters (such as ^G, bell) are embedded in the usual
  3422.          manner.  No carriage return/line feed is issued with the
  3423.          <string> unless contained in <string>.  Example:
  3424.  
  3425.  ->         MESSAGE "^GDialing the SOURCE^M"
  3426.  
  3427.  ->    MGET Sx <number>
  3428.  
  3429.          The MGET statement works exactly as the GET statement, taking
  3430.          text from the keyboard (up to a carriage return or <number>
  3431.          length).  However, the echo is 'masked'.  Asterisks are echoed
  3432.          in place of the entry.  Example:
  3433.  
  3434.  ->         SET DUPLEX HALF         ; Turn off local echo
  3435.  ->         MESSAGE "^MEnter a password:"
  3436.  ->         MGET S0 15          ; Get up to 15 characters
  3437.  ->         TRANSMIT S0         ; Transmit the entry
  3438.  ->         TRANSMIT "^M"           ; And a cr to terminate
  3439.  ->         SET DUPLEX FULL         ; Turn echo back on
  3440.  
  3441.  ->    MLOAD <string>
  3442.  
  3443.          The MLOAD statement loads a new Macro Definition file (Alt-M).
  3444.          The MLOAD command requires a file name in <string>.  <String>
  3445.          contains an unqualified file.ext (or may contain a fully
  3446.          pathed file name).  Example:
  3447.  
  3448.  ->         MLOAD "COM-AND.MAC"           ; Load original macro def
  3449.          MLOAD "C:\SOURCE\COM-AND.MAC" ; Load special macros
  3450.  
  3451.          Note: The file name is limited to 27 characters in length.
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464. Version 2.8: 910717
  3465.  
  3466. COM-AND: IBM PC Communication Script Language                 Page  58
  3467.  
  3468.  
  3469. V.    Script Language Commands (continued)
  3470.  
  3471.  
  3472.     MSR Nx
  3473.  
  3474.          The MSR command reads the modem status register and returns the
  3475.          8 bit value in a numeric register.  Example:
  3476.  
  3477.          MSR N0             ; Read the MSR
  3478.  
  3479.          The format of the bits of the MSR are (please refer to your
  3480.          modem's documentation):
  3481.  
  3482.        (msb) xxxxxxxx (lsb)
  3483.             ^------------------------  Change in CTS
  3484.            ^-------------------------  Change in DSR
  3485.           ^--------------------------  Change in RING indicator
  3486.          ^---------------------------  Change in received line signal
  3487.         ^----------------------------  CTS (Clear to send)
  3488.            ^-----------------------------  DSR (Data set ready)
  3489.           ^------------------------------  RI  (Ring indicator)
  3490.          ^-------------------------------  RLSD (received line signal)
  3491.  
  3492.  ->    MUL Nx Ny Nz
  3493.  
  3494.          The MUL command performs the instruction:    Nz = Nx*Ny.  No error
  3495.          checking is performed;  should the value exceed the range of a
  3496.          numeric variable, results are unpredictable.  Example:
  3497.  
  3498.  ->         MUL N1 N2 N3         ; N3 = N1*N2
  3499.  
  3500.          An expression may be used for Nx or Ny if it is entirely
  3501.          contained within parentheses.
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519. Version 2.8: 910717
  3520.  
  3521. COM-AND: IBM PC Communication Script Language                 Page  59
  3522.  
  3523.  
  3524. V.    Script Language Commands (continued)
  3525.  
  3526.  
  3527.     Nx = <expression>
  3528.  
  3529.          Numeric expressions may be computed and assigned directly with
  3530.          the syntax "Nx = <expression>".  <Expression> is any legitimate
  3531.          algebraic statement.  For example:
  3532.  
  3533.          N0 = N1*(N2+N3)
  3534.          N0 = N5 = N1*(N2+N3)
  3535.  
  3536.          Values may be literal or numeric variables.  Operators are:
  3537.  
  3538.          "+", (addition),
  3539.          "-", (subtraction),
  3540.          "/", (division),
  3541.          "*", (multiplication),
  3542.          "\", (returns the remainder of division),
  3543.          "="  (store partial result)
  3544.          "~"  (bitwise complement),
  3545.          "&"  (bitwise AND),
  3546.          "|"  (bitwise OR),
  3547.          "^"  (bitwise XOR),
  3548.  
  3549.  
  3550.          Parentheses may be used to clarify ambiguous expressions (unless
  3551.          parentheses are used, the expression is evaluated from left to
  3552.          right), with the following precedences:
  3553.  
  3554.          "(",")"                 highest precedence
  3555.          "~", "&", "|", "^"      second precedence
  3556.          "*", "/" and "\"        third precedence
  3557.          "+" and "-"             fourth precedence
  3558.          "="                     lowest precedence
  3559.  
  3560.          Numeric variables may also be 'indexed'.  For example, N0[1] is
  3561.          N1, N1[1] is N2, and so on.  Arithmetic expressions are allowed
  3562.          as indices.  Indices may be used on either side of a store (e.g.
  3563.          "N0[N1] = N2[N3]").  An index does not 'wrap' (i.e.  N0[-1] is
  3564.          N0, not N99).
  3565.  
  3566.          Strings and substrings may be used if they contain valid numeric
  3567.          values.  A zero is used (and the ERROR flag is not set) if a
  3568.          string does not contain a valid numeric value.
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574. Version 2.8: 910717
  3575.  
  3576. COM-AND: IBM PC Communication Script Language                 Page  60
  3577.  
  3578.  
  3579. V.    Script Language Commands (continued)
  3580.  
  3581.  
  3582.     OUTPUT <address> Nx
  3583.  
  3584.          The OUTPUT statement performs a machine level OUTPUT instruction
  3585.          using the address given.  WARNING: If you're not sure what a
  3586.          'machine level OUTPUT instruction' is... do not use this!
  3587.  
  3588.          OUTPUT N0 0x61         ; Write the speaker driver chip
  3589.  
  3590.     ON ESCAPE GOSUB <label>
  3591.  
  3592.          The ON ESCAPE GOSUB statement specifies special action to be
  3593.          taken when the operator presses the ESC key.  If this is not
  3594.          set, the operator is prompted "Do you wish to terminate the
  3595.          script?".  The script writer may choose to intercept the ESC
  3596.          key with a subroutine for the special action.  Example:
  3597.  
  3598.          ON ESCAPE GOSUB ESCAPE  ; Subroutine label had best exist!
  3599.  
  3600.          Like the GOSUB statement, the operand of this statement may be
  3601.          a literal label, a quoted label, or a string variable containing
  3602.          the label as text.
  3603.  
  3604.          Note:  Giving the label as blank is equivalent to the statement
  3605.          ON ESCAPE CLEAR, below.  The ON ESCAPE label may be read (using
  3606.          the "_ONEScape" intrinsic), changed, and later reset to its
  3607.          previous condition, using this fact.
  3608.  
  3609.          Note:  WOPEN provides its OWN escape handler.  When WCLOSE is
  3610.          executed, the ON ESCAPE label previously holding is replaced.
  3611.          Therefore, ON ESCAPE used during a WOPEN sequence will have NO
  3612.          effect outside of the sequence.
  3613.  
  3614.          Note:  Although the ON ESCAPE label is NOT cleared upon FCALL,
  3615.          on FRETURN, the ON ESCAPE label holding at FCALL is replaced.
  3616.          Therefore, ON ESCAPE used during a FCALL will have NO effect
  3617.          outside of the FCALLed file.
  3618.  
  3619.     ON ESCAPE CLEAR
  3620.  
  3621.          The ON ESCAPE CLEAR statement clears a previous ON ESCAPE GOSUB
  3622.          setting.  After this statement, pressing the ESC key will result
  3623.          in the COM-AND prompt "Do you wish to terminate the script?".
  3624.          Example:
  3625.  
  3626.          ON ESCAPE CLEAR         ; Return to default condition
  3627.  
  3628.  
  3629. Version 2.8: 910717
  3630.  
  3631. COM-AND: IBM PC Communication Script Language                 Page  61
  3632.  
  3633.  
  3634. V.    Script Language Commands (continued)
  3635.  
  3636.  
  3637.     ON SILENCE GOSUB <label>
  3638.  
  3639.          The ON SILENCE GOSUB statement specifies special action to be
  3640.          taken after a <duration> of silence on the comm line.  The
  3641.          <duration> defaults to 300 seconds (5 min), and may be set
  3642.          with the SET SILENCE command.
  3643.  
  3644.          ON SILENCE GOSUB Disconn ; Subroutine label had best exist!
  3645.  
  3646.          Like the GOSUB statement, the operand of this statement may be
  3647.          a literal label, a quoted label, or a string variable containing
  3648.          the label as text.
  3649.  
  3650.          Note:  The script must allow the comm port to be read... with
  3651.          one of the following: RGET, or PAUSE.  Note that SUSPEND super-
  3652.          cedes the ON SILENCE condition.
  3653.  
  3654.          Note:  When the GOSUB is executed, the ON SILENCE trap is turned
  3655.          off.  If it is to be used again, a new ON SILENCE GOSUB must be
  3656.          performed (best in the subroutine itself).
  3657.  
  3658.          Note:  The ON SILENCE command 'primes' the timer.  Therefore,
  3659.          a loop containing ON SILENCE... will never timeout!  The timer
  3660.          will be continuously reset.
  3661.  
  3662.     ON SILENCE CLEAR
  3663.  
  3664.          The ON SILENCE CLEAR statement clears a previous ON SILENCE
  3665.          setting.  After this statement, the comm port is not tested
  3666.          for silence.  Example:
  3667.  
  3668.          ON SILENCE CLEAR         ; Return to default condition
  3669.  
  3670.  
  3671.  
  3672.  
  3673.  
  3674.  
  3675.  
  3676.  
  3677.  
  3678.  
  3679.  
  3680.  
  3681.  
  3682.  
  3683.  
  3684. Version 2.8: 910717
  3685.  
  3686. COM-AND: IBM PC Communication Script Language                 Page  62
  3687.  
  3688.  
  3689. V.    Script Language Commands (continued)
  3690.  
  3691.  
  3692.     OVERLAY <file name> [<addr>] ; Load a file for use
  3693.     OVERLAY CLEAR             ; Clear a loaded file
  3694.  
  3695.          The OVERLAY statement loads an EXE or COM format file as machine
  3696.          language subroutines for COM-AND scripts.    Routines in the over-
  3697.          lay are invoked with the SCALL statement.    Example:
  3698.  
  3699.          OVERLAY "talker.ovl" 9  ; Load voice synth; end entry = 9
  3700.  
  3701.          The OVERLAY statement sets SUCCESS/FAIL according to the result
  3702.          of the attempt.  Refer to Appendix K for more discussion.
  3703.  
  3704.          The optional address specifies an entry point to be invoked
  3705.          (with no parameters) when the overlay is terminated.  Invocation
  3706.          automatic if specified (unless the end-entry address is invoked
  3707.          by a script through an SCALL).  The end-entry point is executed
  3708.          when any operation would terminate the overlay (e.g. when a new
  3709.          overlay is loaded, or on Alt-X COM-AND termination).
  3710.  
  3711.  ->    PAUSE [<number>]
  3712.  
  3713.          The PAUSE statement pauses the script file for a given number of
  3714.          seconds.  The delay period defaults to 60 seconds, but may be
  3715.          explicitly set with the numeric argument.    Text received during
  3716.          the PAUSE is displayed, and analyzed for WHEN triggers. Example:
  3717.  
  3718.  ->         PAUSE 300             ; Pause for 5 minutes
  3719.  
  3720.     PERFORM <string>
  3721.  
  3722.          The PERFORM statement executes the given string as a command.
  3723.          Self modifying code is not recommended, but remote control of
  3724.          COM-AND is easily implemented with this command.  Example:
  3725.  
  3726.          S0 = "EXIT"             ; Place a command in S0
  3727.          PERFORM S0          ; Execute S0 as a command
  3728.  
  3729.     PLAY <string>
  3730.  
  3731.          The PLAY statement plays the BASIC encoded music statement in
  3732.          <string>.    The ERROR condition is set if the string cannot be
  3733.          parsed (and is therefore not sounded).  Refer to the appendices
  3734.          for the syntax of the play statement.  Example:
  3735.  
  3736.          PLAY "t220 l8 edcdeee2 ddd2 egg2 edcdeee2 ed.d8edc1"
  3737.  
  3738.  
  3739. Version 2.8: 910717
  3740.  
  3741. COM-AND: IBM PC Communication Script Language                 Page  63
  3742.  
  3743.  
  3744. V.    Script Language Commands (continued)
  3745.  
  3746.  
  3747.     PRESERVE Sx
  3748.  
  3749.          When a value is received (either RGET, GET or MGET), it may
  3750.          contain '!'s and '^'s that would be interpreted as special
  3751.          characters ('!' = carriage return, and '^' = control).  The
  3752.          PRESERVE command, applied to a received string variable will
  3753.          modify the value so that a subsequent TRANSMIT or MESSAGE
  3754.          command sends exactly what was received.  Example:
  3755.  
  3756.          SET RDISPLAY OFF         ; Turn off display of rec'd characters
  3757.  ->         RGET S9             ; Read the comm line
  3758.  ->         IF SUCCESS          ; If not a timeout
  3759.         PRESERVE S9         ; Modify to preserve values
  3760.  ->        MESSAGE S9         ; Display on console
  3761.  ->        MESSAGE "^M"         ; And a carriage rtn
  3762.  ->        ENDIF
  3763.  
  3764.     PRINT <string>
  3765.  
  3766.          The PRIN command sends the <string> to the LP1 logging device.
  3767.          The usual string edits are performed first;  however, unlike
  3768.          MESSAGE, no line advance is performed first.
  3769.  
  3770.          The PRINT command ignores the setting of the PRINTER ON!OFF
  3771.          (Ctl-PrtSc) state;  it prints regardless.    Printer error aborts
  3772.          the line, but the next PRINT command is not disabled.  Example:
  3773.  
  3774.          PRINT "^L"              ; Send a top-of-form
  3775.  
  3776.  ->    PRINTER (ON!OFF)
  3777.  
  3778.          The PRINTER command turns on and off the local LP1 logging of
  3779.          received (and echoed) text.
  3780.  
  3781.  ->    QUIT
  3782.  
  3783.          The QUIT command terminates the script execution and COM-AND.
  3784.          It may be coded at any level (for example within a subroutine
  3785.          reached through a call from a subroutine).  Example:
  3786.  
  3787.  ->         QUIT             ; Terminate the script and program
  3788.          ; Nothing past this point in the script will be performed.
  3789.  
  3790.          Note also the BYE command.
  3791.  
  3792.  
  3793.  
  3794. Version 2.8: 910717
  3795.  
  3796. COM-AND: IBM PC Communication Script Language                 Page  64
  3797.  
  3798.  
  3799. V.    Script Language Commands (continued)
  3800.  
  3801.  
  3802.     RDIR <string>
  3803.  
  3804.          The RDIR statement removes a subdirectory specified as drive:
  3805.          path in the string operand.  RDIR performs exactly as the DOS
  3806.          RD command, succeeding and failing in exactly the same cases.
  3807.          RDIR sets SUCCESS or FAILURE according to the result.  Example:
  3808.  
  3809.          RDIR "A:\TEMP"             ; Remove a temp subdir
  3810.  
  3811.     READ Sx Nx Ny
  3812.  
  3813.          The READ command reads a string (up to Nx characters) into a
  3814.          string variable.  The input file must be opened by FOPENI.
  3815.          READ reads up to 80 characters into Sx.  If the input file was
  3816.          opened in TEXT mode, the read string terminates at the 80th byte
  3817.          or at a CR/LF pair (NOT placed in Sx as a single CR).  The count
  3818.          read is placed in Ny.  Example:
  3819.  
  3820.          READ S0 80 N4         ; Read 80 bytes; count read in N4
  3821.  
  3822.          In TEXT mode, the READ function terminates when a CR/LF is en-
  3823.          countered.  In TEXT mode, tabs are expanded to blanks.  In TEXT
  3824.          mode, the READ command stops on an ASCII EOF character (Ctl-Z)
  3825.          as well as on true end-of-file (size).
  3826.  
  3827.          In TEXT mode, when an empty record is encountered (i.e. CR/LF),
  3828.          the returned length is 0 and the returned buffer is empty.  When
  3829.          a record longer than 80 characters is encountered, the first
  3830.          READ returns a length of 80 and subsequent READ statement(s)
  3831.          return the remainder of the record.  Special note should be made
  3832.          of cases where a length of 80 exactly is returned.  Should the
  3833.          next READ return a length of 0, the record was 80 text charac-
  3834.          ters, and the 0 length record represents the record's CR/LF.
  3835.  
  3836.          The READ command sets the EOF condition on input EOF.  This may
  3837.          be tested with an 'IF EOF'.  On EOF the buffer is returned null.
  3838.  
  3839.     RENAME <oldfile> <newfile>
  3840.  
  3841.          The RENAME statement renames a file named in the command.
  3842.          The SUCCESS flag is set according to the result of the command.
  3843.          Example:
  3844.  
  3845.          RENAME "COM-AND.LOG" "COM-AND.OLD"
  3846.  
  3847.  
  3848.  
  3849. Version 2.8: 910717
  3850.  
  3851. COM-AND: IBM PC Communication Script Language                 Page  65
  3852.  
  3853.  
  3854. V.    Script Language Commands (continued)
  3855.  
  3856.  
  3857.     RESET
  3858.  
  3859.          The RESET statement restores default settings (Alt-S, Alt-O, and
  3860.          Alt-P) to their load-time values.    It also restores the default
  3861.          download subdirectory.  It does not reset the current subdirec-
  3862.          tory or the scrolling region coordinates.    Example:
  3863.  
  3864.          RESET             ; Restore default parameters
  3865.  
  3866.     RESTORE
  3867.  
  3868.          The RESTORE statement restores an area saved by the SAVE
  3869.          statement.  The coordinates used by the SAVE statement are
  3870.          implicit to the RESTORE statement.  The RESTORE statement sets
  3871.          the SUCCESS flag according to save-stack underflow.
  3872.  
  3873.          RESTORE             ; Restore saved area
  3874.  
  3875.  ->    RETURN
  3876.  
  3877.          The RETURN command transfers control of the script processor to
  3878.          the last GOSUB executed.  RETURN effectively cancels the domain
  3879.          of any IF or SWITCH statement being processed.  The RETURN may
  3880.          be coded at any level (for example within an IF).    Example:
  3881.  
  3882.  ->         LABEL:
  3883.          ...
  3884.  ->         RETURN             ; Return to caller
  3885.  
  3886.     REWIND
  3887.  
  3888.          The REWIND statement rewinds the input file (if open).  The
  3889.          SUCCESS flag is set according to the result of the command.
  3890.          Example:
  3891.  
  3892.          REWIND             ; REWIND the input file
  3893.  
  3894.  ->    RFLUSH
  3895.  
  3896.          The RFLUSH command flushes the receiver buffer of received text.
  3897.          Text being flushed is not displayed at the CRT.  Example:
  3898.  
  3899.  ->         RFLUSH             ; Flush anything left over
  3900.  ->         HANGUP             ; Disconnect the call
  3901.  
  3902.  
  3903.  
  3904. Version 2.8: 910717
  3905.  
  3906. COM-AND: IBM PC Communication Script Language                 Page  66
  3907.  
  3908.  
  3909. V.    Script Language Commands (continued)
  3910.  
  3911.  
  3912.  ->    RGET Sx [<number> [<number>]]
  3913.  
  3914.          The RGET command reads the comm port for text.  Received text
  3915.          is terminated by a carriage return (in RMODE ASCII), or, if the
  3916.          optional first numeric argument was supplied, after <number>
  3917.          characters.  Receipt may also be terminated after a stated or
  3918.          unstated period of time (default is 60 seconds; the value may be
  3919.          changed with the optional second numeric argument).  Example:
  3920.  
  3921.  ->         RGET S0 24 300          ; Wait up to 5 mins for 24 characters
  3922.  
  3923.          Note that the delay interval cannot be specified without the
  3924.          first numeric argument (length) also present.
  3925.  
  3926.          Note that if WHEN triggers are to be performed during an RGET,
  3927.          the RGET length must be greater than the largest WHEN trigger
  3928.          string.
  3929.  
  3930.          RGET sets the SUCCESS/FAILURE condition (which may then be
  3931.          tested with the IF statement).
  3932.  
  3933.          RGET will read in either an ASCII or BINARY mode.    Its default
  3934.          is ASCII.    In ASCII mode, nulls and linefeeds are ignored,
  3935.          carriage returns end the RGET, and backspaces are performed.
  3936.          In binary mode, the RGET is terminated only by length.  The
  3937.          RGET mode is set with the SET RMODE statement.
  3938.  
  3939.     RJ Sx
  3940.  
  3941.          The RJ command right justifies the contents of the given string
  3942.          variable (within its actual length).  Example:
  3943.  
  3944.          RJ S0                 ; Right justify
  3945.  
  3946.     RND <modulus> Nx
  3947.  
  3948.          The RND command computes a random number (smaller than the
  3949.          given modulus value) and places the value in Nx.  Example:
  3950.  
  3951.          RND 6 N0             ; Roll one six faced die (n0 = 0 to 5)
  3952.  
  3953.  
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959. Version 2.8: 910717
  3960.  
  3961. COM-AND: IBM PC Communication Script Language                 Page  67
  3962.  
  3963.  
  3964. V.    Script Language Commands (continued)
  3965.  
  3966.  
  3967.  ->    RUN <string> [WAIT]
  3968.  
  3969.          The RUN command executes any executable program that may be
  3970.          loaded 'on top of' COM-AND.  The RUN command will not work
  3971.          if there is not sufficient memory to load the new program.
  3972.  
  3973.          Parameters may be passed to the new program by including
  3974.          them after the file name.    Example:
  3975.  
  3976.  ->         RUN "VCOLIB.EXE"             ; Load VCOLIB (menu mode)
  3977.          RUN "VCOLIB.EXE L GENIE.FLB" ; Load and list to CRT
  3978.  
  3979.          The optional keyword WAIT signals that COM-AND is to pause
  3980.          after completion for a keypress before the script continues.
  3981.  
  3982.          This command sets the SUCCESS condition according to the error
  3983.          level returned to DOS by the target program.
  3984.  
  3985.          NOTE:  The screen is saved prior to the RUN function, for
  3986.          restoration upon completion.  However, the screen size saved
  3987.          is defined by the DWINDOW currently in effect!
  3988.  
  3989.     SAVE row col row col
  3990.  
  3991.          The SAVE statement saves an area of screen on a stack.  The
  3992.          first and second arguments specify the row/column of the
  3993.          top-left of the region.  The third and fourth arguments specify
  3994.          the row/column of the bottom-right of the region.    Up to 20
  3995.          regions may be saved at one time.    The SUCCESS flag is set/reset
  3996.          according to save-stack overflow.    Example:
  3997.  
  3998.          SAVE 0 10,10 20,20       ; Save a narrow box.
  3999.  
  4000.     SCALL <addr> [parms [,parms]]
  4001.  
  4002.          The SCALL instruction invokes a procedure in an overlay.  The
  4003.          address of the procedure (relative to the first 64K) must be
  4004.          supplied.    Optional numeric (nx) and string (Sx, Vx) variables
  4005.          may be listed after the mandatory address.  All parameters are
  4006.          passed by reference and may therefore be modified by the over-
  4007.          lay routine.  For example:
  4008.  
  4009.          SCALL 3 N0            ; Invoke proc at addr 3, pass/rtn N0
  4010.  
  4011.  
  4012.  
  4013.  
  4014. Version 2.8: 910717
  4015.  
  4016. COM-AND: IBM PC Communication Script Language                 Page  68
  4017.  
  4018.  
  4019. V.    Script Language Commands (continued)
  4020.  
  4021.  
  4022.     SCREEN row col row col attr Sx
  4023.  
  4024.          The SCREEN statement provides for a multi-line display within
  4025.          an area on the screen.  The leftmost column and the number of
  4026.          lines to be be displayed are defined by the box coordinates.
  4027.          The color attribute is used on each line displayed.  Lines are
  4028.          displayed string with the string variable given, and proceeding
  4029.          in sequence.  For example:
  4030.  
  4031.          SCREEN 10,10 20,20 (black white) S0
  4032.  
  4033.          displays 11 lines from variables S0 through S10.  Note that the
  4034.          given attribute ONLY applies to text written (not the whole box)
  4035.          and that the box width does NOT limit the line length displayed.
  4036.  
  4037.  ->    SCROLL cnt row col row col attr
  4038.  
  4039.          The SCROLL statement scrolls a region on the screen, filling
  4040.          the new lines with the specified color.  The first argument
  4041.          <cnt> specifies the number of lines to scroll (0 implies that
  4042.          the region is to be cleared).  The second and third arguments
  4043.          specify the row/column of the top-left of the region.  The
  4044.          fourth and fifth arguments specify the row/column of the
  4045.          bottom-right of the region.  The last argument specifies the
  4046.          color attribute to be used on the new line.  Example:
  4047.  
  4048.  ->         SCROLL 0 10,10 20,20 15         ; White on black:    narrow box
  4049.          SCROLL 0 10,10 20,20 (black white)
  4050.  
  4051.  
  4052.  
  4053.  
  4054.  
  4055.  
  4056.  
  4057.  
  4058.  
  4059.  
  4060.  
  4061.  
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068.  
  4069. Version 2.8: 910717
  4070.  
  4071. COM-AND: IBM PC Communication Script Language                 Page  69
  4072.  
  4073.  
  4074. V.    Script Language Commands (continued)
  4075.  
  4076.  
  4077.  ->    SENDFILE ASCII      <string>    ; A.K.A. Buffer capture
  4078.  ->    SENDFILE BYMODEM  <string>    ; Batch YMODEM
  4079.  ->    SENDFILE BYMODEMG <string>    ; Batch YMODEM-G (BYMOG works too)
  4080.  ->    SENDFILE CISB              ; CompuServe B-protocol
  4081.  ->    SENDFILE KERMIT   <string>    ; Kermit or SuperKermit
  4082.     SENDFILE QUICKB           ; CompuServe Quick B-protocol
  4083.  ->    SENDFILE RXMODEM  <string>    ; Relaxed CRC or Checksum XMODEM
  4084.  ->    SENDFILE WXMODEM  <string>    ; Windowed XMODEM
  4085.  ->    SENDFILE XMODEM   <string>    ; CRC or Checksum XMODEM
  4086.  ->    SENDFILE YMODEM   <string>    ; Simple YMODEM (not True ... (TM))
  4087.     SENDFILE ZMODEM   <string>    ; ZMODEM transfer (batch)
  4088.  
  4089.          The SENDFILE statement initiates an upload using a specific
  4090.          protocol.    The <string> argument must specify a valid file name,
  4091.          and the file must exist.  The SENDFILE command sets the SUCCESS
  4092.          condition according to the transfer.  Example:
  4093.  
  4094.  ->         SENDFILE XMODEM "Com-and.arc"  ; Upload
  4095.  
  4096.          Note that, in the case of CISB and QUICKB, you tell the host the
  4097.          name the file will take on your machine.
  4098.  
  4099.          Note that CIS-B ( and QuickB) provide an automated upload
  4100.          function.    The automated function is NOT available within a
  4101.          script unless the script is 'reading the port', i.e.  with an
  4102.          RGET, PAUSE or SUSPEND statement.
  4103.  
  4104.  ->    SET <command...>
  4105.  
  4106.          The SET commands are discussed below in a chapter alone.
  4107.  
  4108.  ->    SHELL
  4109.  
  4110.          The SHELL command shell's to DOS using COMMAND.COM or the
  4111.          command line interpretor indicated by the 'COMSPEC=' envi-
  4112.          ronment variable.    Having shelled to DOS, DOS commands may be
  4113.          executed...  however, the shell must be exited for the script
  4114.          to continue.  COMMAND.COM is exited with the command "Exit".
  4115.          Example:
  4116.  
  4117.  ->         SHELL             ; shell to DOS
  4118.  
  4119.          NOTE: The screen is saved prior to the SHELL function, for
  4120.          restoration upon completion.  However, the screen size saved
  4121.          is defined by the DWINDOW currently in effect!
  4122.  
  4123.  
  4124. Version 2.8: 910717
  4125.  
  4126. COM-AND: IBM PC Communication Script Language                 Page  70
  4127.  
  4128.  
  4129. V.    Script Language Commands (continued)
  4130.  
  4131.  
  4132.     SNAME Sx
  4133.  
  4134.          The SNAME command returns the current script file name in the
  4135.          variable given.  Example:
  4136.  
  4137.          SNAME S0             ; shell to DOS
  4138.  
  4139.          This function is provided to make it possible for a script that
  4140.          has been 'EXECUTE'd from another script file to return to the
  4141.          original script.  Note that when a script is started, all string
  4142.          variables are set to blank.  When a script is 'EXECUTE'd string
  4143.          variables retain their current values.
  4144.  
  4145.  ->    SOUND <number> <number>
  4146.  
  4147.          The SOUND statement generates a sound of a specific frequency
  4148.          for a duration specified in milliseconds.    The first argument is
  4149.          the frequency (in Hz).  The second argument is duration.  Both
  4150.          may be specified as literal values or as variables.  Example:
  4151.  
  4152.  ->         SOUND 440 500         ; Sound a 'A' for half-a-sec
  4153.  
  4154.     SSIZE Nx
  4155.  
  4156.          The SSIZE statement returns the current # of screen lines
  4157.          in the given numeric variable.  Example:
  4158.  
  4159.          SSIZE N0             ; Compute # screen lines
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.  
  4167.  
  4168.  
  4169.  
  4170.  
  4171.  
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179. Version 2.8: 910717
  4180.  
  4181. COM-AND: IBM PC Communication Script Language                 Page  71
  4182.  
  4183.  
  4184. V.    Script Language Commands (continued)
  4185.  
  4186.  
  4187.     STACK <string>
  4188.     STACK CLEAR
  4189.  
  4190.          The STACK statement stores the given string (if there is room)
  4191.          in the BIOS keyboard buffer.  STACK CLEAR clears the BIOS key-
  4192.          board buffer.  STACK may be used prior to BYE to effect a chain
  4193.          to another program.  For example:
  4194.  
  4195.          STACK "PC-VCO!"         ; Stack cmd to load PC-VCO
  4196.  ->         BYE             ; Exit COM-AND without hanging up
  4197.  
  4198.          Note that STACK, like HITKEY, sets a state inhibiting type-
  4199.          through until the next KEYGET/GET/MGET/ATGET/MATGET/KFLUSH.
  4200.  
  4201.          To STACK a non-ASCII key, preceded the 'extended code' with null
  4202.          (^@).  Please refer to Appendix H of this document for a table
  4203.          of extended keycodes as used by the STACK command.
  4204.  
  4205.          Note that the STACK command uses the EBL keyboard stack, if EBL
  4206.          is available.  Refer to Appendix (F) below covering EBL for
  4207.          information on EBL.
  4208.  
  4209.          The BIOS keyboard buffer is limited to 15 characters.  The EBL
  4210.          provides a larger buffer for STACK's use.  [Note that various
  4211.          utilities and TSRs may provide a larger keyboard buffer.  If so,
  4212.          COM-AND will use the larger buffer.]
  4213.  
  4214.     STORE (DIAL!MACR!ACCE!DEFA!ALLOC) [parms]
  4215.  
  4216.          The STORE command writes a settings file (either the dialing
  4217.          directory, macro definition, accessory definition, defaults, or
  4218.          allocated variables).  Note that 'STORE DEFAULTS' is equivalent
  4219.          to 'UPDATE'.  Example:
  4220.  
  4221.          STORE DIAL              ; Update original dial dir
  4222.          STORE DEFAULT             ; Note: takes no file name
  4223.  
  4224.          The only STORE subcommand taking a parameter is STORE ALLOCATED.
  4225.          The other statements store to the file currently in use.  STORE
  4226.          ALLOCATED (storing allocated variables to a disk file) requires
  4227.          a specific file name for the store.
  4228.  
  4229.  
  4230.  
  4231.  
  4232.  
  4233.  
  4234. Version 2.8: 910717
  4235.  
  4236. COM-AND: IBM PC Communication Script Language                 Page  72
  4237.  
  4238.  
  4239. V.    Script Language Commands (continued)
  4240.  
  4241.  
  4242.  ->    STRCAT Sx Sy
  4243.  
  4244.          The STRCAT statement concatenates two strings, Sy onto Sx.  The
  4245.          concatenation occurs after the last character of Sx.  Example:
  4246.  
  4247.  ->         STRCAT S0 S1         ; Concat S1 onto S0
  4248.          STRCAT S0 S1(5:10)      ; Extract substring of S1 and add
  4249.  
  4250.          Note that the command above is equivalent to the following:
  4251.  
  4252.          CONCAT S0 * S1         ; Another way to say this
  4253.  
  4254.  ->    STRCMP Sx Sy
  4255.  
  4256.          The STRCMP statement compares two strings (case sensitive)
  4257.          and sets the SUCCESS flag if they are identical.  Example:
  4258.  
  4259.  ->         STRCMP S0 S1         ; Compare strings in S0 & S1
  4260.  ->         IF SUCCESS          ; IF they are equal...
  4261.         ...             ; ...
  4262.  
  4263.          Note that STRCMP may also be used with IF as the conditional
  4264.          test (e.g. IF STRCMP S0 S1 ...).
  4265.  
  4266.  ->    STRCPY Sx <string>
  4267.  
  4268.          The STRCPY statement assigns the value in <string> to Sx.
  4269.          It is equivalent to the ASSIGN statement.    Example:
  4270.  
  4271.  ->         STRCPY  S0 S1         ; S0 = S1, or ASSIGN S0 S1
  4272.  
  4273.  
  4274.  
  4275.  
  4276.  
  4277.  
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289. Version 2.8: 910717
  4290.  
  4291. COM-AND: IBM PC Communication Script Language                 Page  73
  4292.  
  4293.  
  4294. V.    Script Language Commands (continued)
  4295.  
  4296.  
  4297.  ->    STRFMT Sx <fmtstr> <parms>
  4298.  
  4299.          The STRFMT statement formats variables (and literals) into a
  4300.          template and places the result into a string variable.  The
  4301.          argument <fmtstr> above is the formatting template.  The
  4302.          argument list <parms> above is a list of variable names (and
  4303.          literals and substrings) to be formatted.    Example:
  4304.  
  4305.  ->         STRFMT S0 "The answer is %d %s" N1 S1
  4306.  
  4307.          In the above example, the value in N1 replaces %d and the text
  4308.          in S1 replaces %s.  Format specifiers in the template have the
  4309.          form:
  4310.  
  4311.              %[<flags>][<width>][.<precision>]<type>
  4312.  
  4313.          <Flags>         are "-" meaning left justify the argument and
  4314.                  "+" meaning display the argument with a plus
  4315.                  or minus sign (if numeric).  The defaults are
  4316.                  right justified and signed only if negative.
  4317.  
  4318.          <width>         specifies the minimum number of characters to
  4319.                  be displayed.  If <width> is greater than the
  4320.                  value, blanks are added to the left or right
  4321.                  (according to the justification).    If <width>
  4322.                  is prefixed by 0, 0's are used in place of
  4323.                  blanks.
  4324.  
  4325.          .<precision>    specifies the minimum number of digits to be
  4326.                  displayed.  0's are added to the left of the
  4327.                  formatted value to achieve <precision>.
  4328.  
  4329.          <type>         "d" specifies decimal numeric values (signed)
  4330.                  "u" specifies unsigned decimal values
  4331.                  "x" specifies hex values
  4332.                  "s" specifies string values
  4333.  
  4334.  
  4335.          The <fmtstr> is scanned from left to right for format
  4336.          specifiers.  As specifiers are found, parameters after <fmtstr>
  4337.          are extracted and used sequentially.  This usage is similar to
  4338.          the Microsoft "C" compiler's usage.
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344. Version 2.8: 910717
  4345.  
  4346. COM-AND: IBM PC Communication Script Language                 Page  74
  4347.  
  4348.  
  4349. V.    Script Language Commands (continued)
  4350.  
  4351.  
  4352.  ->    SUB Nx Ny Nz
  4353.  
  4354.          The SUB command performs the instruction:    Nz = Nx-Ny.  No
  4355.          error check is performed; should the value exceed the range
  4356.          of a numeric variable, results are unpredictable.    Example:
  4357.  
  4358.  ->         SUB N1 N2 N3         ; N3 = N1-N2
  4359.  
  4360.          An expression may be used for Nx or Ny if it is entirely
  4361.          contained within parentheses.
  4362.  
  4363.     SUBDIR Sx
  4364.  
  4365.          The SUBDIR statement stores the current default drive:sub-
  4366.          directory into the target variable.  Example:
  4367.  
  4368.          SUBDIR S0             ; Get current drive:path
  4369.  
  4370.  ->    SUBSTR Sx Sy <number> <number>
  4371.  
  4372.          The SUBSTR statement extracts a substring from Sy and places
  4373.          it in Sx.    The beginning character position is specified by the
  4374.          first numeric argument (0,1,2...).  The second numeric argument
  4375.          specifies the length of the substring.  Example:
  4376.  
  4377.  ->         SUBSTR S0 S1 5 10          ; S0 = S1 at 5 for 10
  4378.  
  4379.          Note that the command above is equivalent to the following:
  4380.  
  4381.          S0 = S1(5:14)         ; Another way to say this
  4382.  
  4383.  
  4384.  
  4385.  
  4386.  
  4387.  
  4388.  
  4389.  
  4390.  
  4391.  
  4392.  
  4393.  
  4394.  
  4395.  
  4396.  
  4397.  
  4398.  
  4399. Version 2.8: 910717
  4400.  
  4401. COM-AND: IBM PC Communication Script Language                 Page  75
  4402.  
  4403.  
  4404. V.    Script Language Commands (continued)
  4405.  
  4406.  
  4407.     SUSPEND FOR <number> <number>
  4408.  ->    SUSPEND UNTIL <number> <number>
  4409.  
  4410.          The SUSPEND FOR statement suspends COM-AND for the duration
  4411.          indicated (in military form).  The suspension may be up to 24
  4412.          hours.  The first argument is hours (0-23) and the second
  4413.          argument is minutes.  Example:
  4414.  
  4415.          SUSPEND FOR 0 30         ; Wait a-haffa hour
  4416.  
  4417.          The SUSPEND UNTIL statement suspends COM-AND until the time
  4418.          indicated (in military form).  Example:
  4419.  
  4420.  ->         SUSPEND UNTIL 4 30      ; 4:30 AM
  4421.  
  4422.          Incoming text received during SUSPEND is displayed on the
  4423.          screen.  Keystrokes are transmitted.  The SUSPEND may be
  4424.          terminated with the ESC key.  WHEN is active during SUSPEND.
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.  
  4431.  
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.  
  4442.  
  4443.  
  4444.  
  4445.  
  4446.  
  4447.  
  4448.  
  4449.  
  4450.  
  4451.  
  4452.  
  4453.  
  4454. Version 2.8: 910717
  4455.  
  4456. COM-AND: IBM PC Communication Script Language                 Page  76
  4457.  
  4458.  
  4459. V.    Script Language Commands (continued)
  4460.  
  4461.  
  4462.  ->    SWITCH (Sx!Nx)
  4463.  
  4464.          The SWITCH statement declares a variable to be tested and a
  4465.          domain for transfer of control.  A SWITCH statement must be
  4466.          followed an ENDSWITCH statement.  Lines between the SWITCH and
  4467.          the ENDSWITCH statements are the domain of the SWITCH function.
  4468.  
  4469.          Within the SWITCH domain, CASE statements test the given
  4470.          variable for a value (not case sensitive).  If a match is
  4471.          obtained, the statements following the CASE statement are
  4472.          executed until an ENDCASE is encountered.
  4473.  
  4474.          A DEFAULT statement specifies a clause to be executed if none
  4475.          of the prior CASEs have been executed.  The DEFAULT clause is
  4476.          terminated by an ENDCASE;    just as a CASE statement.
  4477.  
  4478.          Schematically:
  4479.  
  4480.  ->         SWITCH (Sx!Nx)             ; Set variable to be tested.
  4481.            CASE (<string>!<number>)      ; Match Sx and <string>
  4482.            ...                 ; .. execute if a match
  4483.  ->           ENDCASE                 ; End of first case
  4484.  ->           CASE <string>             ; <String> = "_NULL" -> empty
  4485.            ...
  4486.  ->           ENDCASE                 ; End of second case
  4487.            ...
  4488.  ->           DEFAULT                 ; DEFAULT executed if no case
  4489.            ...                 ; .. was matched
  4490.  ->           ENDCASE                 ; End of default case
  4491.  ->           ENDSWITCH             ; End of SWITCH domain
  4492.  
  4493.          Statements between a SWITCH and an ENDSWITCH which are not
  4494.          themselves within a CASE/ENDCASE or DEFAULT/ENDCASE are ignored.
  4495.          SWITCH domains may be nested with IF domains, GOSUBs, DO, FOR
  4496.          and WHILE up to a maximum stack depth of 20.
  4497.  
  4498.          Note that either a string OR a numeric variable may be used with
  4499.          the SWITCH statement.  Strings and numerics may be mixed in any
  4500.          (useful) manner with SWITCH and CASEs.
  4501.  
  4502.          Substring bounds are not allowed on the SWITCH variable, but are
  4503.          allowed on the CASE variable.
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509. Version 2.8: 910717
  4510.  
  4511. COM-AND: IBM PC Communication Script Language                 Page  77
  4512.  
  4513.  
  4514. V.    Script Language Commands (continued)
  4515.  
  4516.  
  4517.     Sx = <expression>
  4518.  
  4519.          String expressions may be computed and assigned directly with
  4520.          the syntax "Sx = <expression>".  <Expression> is any legitimate
  4521.          combination of values and operators.  For example:
  4522.  
  4523.          S0 = S1 & S2 * S3(4:5)
  4524.          S0(70:79) = S1
  4525.  
  4526.          Values may be literal or string/numeric variables.  Operators
  4527.          allowed are "*" (concatenate at end), and "&" (trim trailing
  4528.          blanks and then concatenate).  Substrings may be specified using
  4529.          (from:to) notation:  from column # to column #.
  4530.  
  4531.          Numeric variables may also be included.  An implicit ITOA will
  4532.          be performed (leading zeroes suppressed and left justified).
  4533.          The width of the value is exactly the width of the value so
  4534.          formatted.
  4535.  
  4536.          This usage, string expression, is the only statement in the
  4537.          COM-AND script language that supports 'string deposit'...  i.e.
  4538.          specification of a substring for assignment.  I hope that a
  4539.          future extension of this script language will allow string
  4540.          deposit as freely as string extraction.
  4541.  
  4542.          String variables may also be 'indexed'.  For example, S0[1] is
  4543.          S1, S1[1] is S2, and so on.  Arithmetic expressions are allowed
  4544.          as indices.  Indices may be used on either side of a store (e.g.
  4545.          "S0[N1] = S2[N3]").  An index does not 'wrap' (i.e.  S0[-1] is
  4546.          S0, not S29).  For example:
  4547.  
  4548.          S0 = S0[2](2:3) ; Extract cols 2-3 from S2 and place in S0
  4549.  
  4550.  ->    TERMINAL
  4551.  
  4552.          The TERMINAL statement terminates a COM-AND script, returning to
  4553.          CRT mode.    It may be coded at any level (for example within a
  4554.          subroutine reached through a call from a subroutine).  Example:
  4555.  
  4556.  ->         TERMINAL             ; End of script
  4557.          ; Nothing past this point in the script is executed
  4558.  
  4559.          Note also the EXIT and CONNECT command.
  4560.  
  4561.  
  4562.  
  4563.  
  4564. Version 2.8: 910717
  4565.  
  4566. COM-AND: IBM PC Communication Script Language                 Page  78
  4567.  
  4568.  
  4569. V.    Script Language Commands (continued)
  4570.  
  4571.  
  4572.  ->    TIME Sx [0!1]
  4573.  
  4574.          The TIME statement store the current system time into the target
  4575.          variable.    The TIME is formatted according to the optional
  4576.          format argument (if provided and nonzero, the time is formatted
  4577.          hh:mm:ss where hh is 0-23; otherwise it is formatted hh:mm:ss
  4578.          with a final AM or PM).  Example:
  4579.  
  4580.  ->         TIME S1 1             ; Get the time of day military fmt
  4581.  
  4582.  ->    TRACE (ON!OFF)
  4583.  
  4584.          The TRACE statement turns on and off script file tracing.    When
  4585.          tracing is enabled, each line of the script file is displayed on
  4586.          the CRT before the statement is executed.    If logging is
  4587.          enabled, the trace display is also copied to the log.  Example:
  4588.  
  4589.  ->         TRACE ON             ; Turn on tracing
  4590.  
  4591.  ->    TRANSMIT <string>
  4592.  
  4593.          The TRANSMIT statement writes the given string to the communi-
  4594.          cations line.  TRANSMIT does not add a carriage return to the
  4595.          string; if a carriage return is required, it should be con-
  4596.          tained in the string (^M is a carriage return).  TRANSMIT back-
  4597.          scans the text to be transmitted and does not send trailing
  4598.          blanks.  Examples:
  4599.  
  4600.  ->         TRANSMIT S0         ; Send what's in S0
  4601.  ->         TRANSMIT "text"         ; Send text without a c/r
  4602.  ->         TRANSMIT "text^M"       ; Send text with a c/r
  4603.  
  4604.          Note: To be compatible with PCPlus, a tilde (~) represents
  4605.          a 1/2 second pause in the TRANSMIT string.
  4606.  
  4607.     TSINCE [(#)] Nx Ny Nz
  4608.  
  4609.          The TSINCE statement reads the time since a given timer was set
  4610.          (all timers are initialized to the time the script is loaded but
  4611.          may be changed with "SET TIMER"), in hours, minutes and seconds.
  4612.          10 timers are supported.  Example:
  4613.  
  4614.          TSINCE N0,N1,N2         ; Read time since timer 0 was set
  4615.          TSINCE (9) N0,N1,N2     ; Read time since timer 9 was set
  4616.  
  4617.  
  4618.  
  4619. Version 2.8: 910717
  4620.  
  4621. COM-AND: IBM PC Communication Script Language                 Page  79
  4622.  
  4623.  
  4624. V.    Script Language Commands (continued)
  4625.  
  4626.  
  4627.  ->    TYPE <string>
  4628.  
  4629.          The TYPE statement opens the file specified by <string> and
  4630.          displays it to the local console.    This is equivalent to the
  4631.          interactive Alt-W command of COM-AND.  Example:
  4632.  
  4633.  ->         TYPE "COM-AND.DOC"      ; Don't do this:  too big!
  4634.  
  4635.     UNTIL <condition>
  4636.  
  4637.          The UNTIL statement terminates the clause of a DO loop.  The
  4638.          specified condition is evaluated, and looping occurs if the
  4639.          evaluation is false.  Refer to DO above for an example.
  4640.  
  4641.          The <condition> executed by UNTIL has the same form as the
  4642.          condition of the 'IF' statement.
  4643.  
  4644.     UPDATE
  4645.  
  4646.          The UPDATE statement updates the .DFT file.  This is equi-
  4647.          valent to the STORE DEFAULT instruction.  Example:
  4648.  
  4649.          UPDATE             ; Store new settings
  4650.  
  4651.     UPPER Sx
  4652.  
  4653.          The UPPER statement upper cases all alphabetic characters in
  4654.          Sx. Example:
  4655.  
  4656.          UPPER S5             ; Force all upper case
  4657.  
  4658.     VERSION Nx
  4659.  
  4660.          The VERSION statement reads the current version of COM-AND
  4661.          (major*10+minor) and places it into a numeric variable.
  4662.          Example:
  4663.  
  4664.          VERSION N0          ; N0 = 23 if version 2.3
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674. Version 2.8: 910717
  4675.  
  4676. COM-AND: IBM PC Communication Script Language                 Page  80
  4677.  
  4678.  
  4679. V.    Script Language Commands (continued)
  4680.  
  4681.  
  4682.  ->    WAITFOR <string> [<number>]
  4683.  
  4684.          The WAITFOR instruction waits up to a given (explicit in
  4685.          <number>, or default) number of seconds for a the target string
  4686.          to be received.  The WAITFOR instruction sets the WAITFOR con-
  4687.          dition (tested by IF) according to whether or not the target
  4688.          <string> was received.  The WAITFOR function is not case
  4689.          sensitive.  Example:
  4690.  
  4691.  ->         WAITFOR "U#="           ; Waitfor GEnie user # prompt
  4692.  
  4693.          Note:  As with WHEN strings, carriage returns, line feeds,
  4694.          and backspaces should not be encoded in the WAITFOR target.
  4695.          A special provision has been made for the construct:
  4696.  
  4697.  ->         WAITFOR "^M"            ; Waitfor the next carriage return
  4698.  
  4699.          This was required because of the frequency with which scripts
  4700.          that have been published use the construct.  However, in the
  4701.          general case, avoid carriage returns, line feeds and back-
  4702.          spaces in the WAITFOR string.
  4703.  
  4704.     WCLOSE
  4705.  
  4706.          The WCLOSE instruction closes a window opened with the WOPEN
  4707.          instruction.  If no windows are open FAILURE is set.  Otherwise,
  4708.          (1) The saved area (if one was saved) is restored and (2) The ON
  4709.          ESCAPE condition at the time of the WOPEN is restored.  Example:
  4710.  
  4711.          WCLOSE             ; Must match a WOPEN above
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.  
  4727.  
  4728.  
  4729. Version 2.8: 910717
  4730.  
  4731. COM-AND: IBM PC Communication Script Language                 Page  81
  4732.  
  4733.  
  4734. V.    Script Language Commands (continued)
  4735.  
  4736.  
  4737.  ->    WHEN [(#)] <string> <string>
  4738.  
  4739.          The WHEN instruction establishes a 'trigger' condition which
  4740.          will be recognized and responded to automatically.  WHEN has
  4741.          two arguments:  the first argument is a <string> which, when
  4742.          received will result in the transmission of the second string.
  4743.          Example:
  4744.  
  4745.  ->         WHEN "Press return for more" "^M" ; Respond w/c/r
  4746.  
  4747.          The WHEN statement has been extended to allow up to 10 WHEN
  4748.          settings (WHEN (0), WHEN (1) ...  WHEN (9), with an unquali-
  4749.          fied WHEN equivalent to WHEN (0)).  Each must be set and
  4750.          cleared individually.  Examples:
  4751.  
  4752.          WHEN (0) "more?" "^M"   ; Same as WHEN
  4753.          WHEN (9) "Agree?" "Y^M" ; Set last WHEN
  4754.  
  4755.          WHEN trigger strings are not case sensitive;  you needn't
  4756.          represent the trigger exactly.  The WHEN matching begins after
  4757.          receipt of a carriage return, and continues until the length
  4758.          buffered exceeds that of the WHEN string.
  4759.  
  4760.          Note:  The SET ANYWHEN statement affects the type of match
  4761.          performed by the WHEN statement.  When ANYWHEN is off (the
  4762.          default), a match must be made from the start a received line
  4763.          (i.e.  immediately after the return).  When ANYWHEN is on, the
  4764.          match is a substring test against the entire received buffer.
  4765.  
  4766.          If WHEN triggers are to be used during an RGET, the length of
  4767.          the RGET target must be larger than the largest WHEN trigger
  4768.          string.
  4769.  
  4770.          Carriage returns and line feeds cannot be included in a WHEN
  4771.          trigger string.
  4772.  
  4773.          WHEN settings are cleared with the CWHEN statement.
  4774.  
  4775.  
  4776.  
  4777.  
  4778.  
  4779.  
  4780.  
  4781.  
  4782.  
  4783.  
  4784. Version 2.8: 910717
  4785.  
  4786. COM-AND: IBM PC Communication Script Language                 Page  82
  4787.  
  4788.  
  4789. V.    Script Language Commands (continued)
  4790.  
  4791.  
  4792.     WHILE <condition>
  4793.  
  4794.          The WHILE statement asserts the beginning of a loop, if the
  4795.          condition specified evaluates true.  The clause after the WHILE
  4796.          statement is executed through an ENDWHILE statement and looping
  4797.          occurs (back to evaluate the condition again).
  4798.  
  4799.          The WHILE statement evaluates the given condition (see the 'IF'
  4800.          statement for a list of conditions).  If the evaluation is
  4801.          false, statements following are skipped until the corresponding
  4802.          ENDWHILE is encountered.  Example:
  4803.  
  4804.          N0 = 0             ; Initialize index
  4805.          WHILE LT N0 10         ; Loop for 10 times
  4806.          N0 = N0+1         ; Increment index
  4807.          ...
  4808.          ENDWHILE         ; Loop back to WHILE
  4809.  
  4810.  
  4811.          Note: (1) GOTO statements may never enter a WHILE loop;  even
  4812.                to leave an inner loop to return to an outer loop.
  4813.  
  4814.          Note: (2) WHILE statements may be nested (along with IF, FOR,
  4815.                WHILE, SWITCH and DO loops) up to 20 levels.  How-
  4816.                ever, they may not overlap other WHILE loops, or
  4817.                other flow-of-control statements.
  4818.  
  4819.          Note: (3) The clause of the WHILE statement (statements after
  4820.                'WHILE' down to the ENDWHILE statement) is not
  4821.                necessarily executed, even once.  The conditional
  4822.                evaluation is performed before each iteration.
  4823.  
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839. Version 2.8: 910717
  4840.  
  4841. COM-AND: IBM PC Communication Script Language                 Page  83
  4842.  
  4843.  
  4844. V.    Script Language Commands (continued)
  4845.  
  4846.  
  4847.     WOPEN row col row col attr [label]
  4848.  
  4849.          The WOPEN command opens a window on the screen, saving the
  4850.          current ON ESCAPE setting, and optionally, setting a new ON
  4851.          ESCAPE condition.    Up to 10 windows may be opened at one time
  4852.          (if 10 is exceeded, FAILURE is set).
  4853.  
  4854.          The WOPEN instruction combines a number of other instructions
  4855.          into a one function.  WOPEN is equivalent to:
  4856.  
  4857.              Sx = "_ONESCAPE"                ; Read current
  4858.              ON ESCAPE GOSUB label         ; Set new
  4859.              CURSOR Nx Ny             ; Read current & save
  4860.              SAVE row col row col         ; Save screen area
  4861.  ->             BOX  row col row col attr         ; Clear scr, draw box
  4862.  
  4863.          The corresponding WCLOSE is equivalent to:
  4864.  
  4865.              ON ESCAPE GOSUB Sx          ; Reset condition
  4866.              RESTORE                 ; Restore screen
  4867.  ->             LOCATE Nx Ny             ; Restore cursor
  4868.  
  4869.          The ON ESCAPE condition is reset upon WCLOSE to the setting at
  4870.          the time of the WOPEN.  Intervening "ON ESCAPE" statements are
  4871.          therefore cancelled.  Intervening SAVEs and RESTOREs are not
  4872.          cancelled, however.  Have care!
  4873.  
  4874.          Example:
  4875.  
  4876.          WOPEN 10,10 20,70 (default) ESCAPE_Label ; Open a window
  4877.  
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.  
  4892.  
  4893.  
  4894. Version 2.8: 910717
  4895.  
  4896. COM-AND: IBM PC Communication Script Language                 Page  84
  4897.  
  4898.  
  4899. V.    Script Language Commands (continued)
  4900.  
  4901.  
  4902.     WRITE Sx [Nx]
  4903.  
  4904.          The WRITE command writes a string from a string variable to the
  4905.          output file.  The length of the string variable is specified by
  4906.          Nx.  The output file must be opened by a previous FOPENO.
  4907.  
  4908.          In TEXT mode the WRITE command translates CRs in the string
  4909.          buffer to CR/LF pairs.  No tab compression is performed.
  4910.  
  4911.          WRITE writes up to 80 characters from Sx, according to the value
  4912.          in Nx.  Example:
  4913.  
  4914.          WRITE S0 75         ; Write 75 bytes
  4915.  
  4916.          Note that the length given applies to the string as given.  The
  4917.          string "^M" is 2 characters long and should be specified as a
  4918.          length of 2, although only 1 character (control-M) will be
  4919.          written.  The string "`"", interestingly enough, is 1 character
  4920.          long!
  4921.  
  4922.          Note that the length parameter is optional.  If not specified,
  4923.          the current length of the variable will be computed.
  4924.  
  4925.          Note that COM-AND does not write a ^Z (decimal 26) to the output
  4926.          file when it is closed, having been opened in TEXT mode.  The
  4927.          script author may add the ASCII EOF convention by preceding the
  4928.          FCLOSEO with the statement:
  4929.  
  4930.          WRITE "^Z"              ; ASCII EOF convention
  4931.  
  4932.          Note also: FPUTC/FPUTS/FWRITE commands.
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949. Version 2.8: 910717
  4950.  
  4951. COM-AND: IBM PC Communication Script Language                 Page  85
  4952.  
  4953.  
  4954. VI.    SET commands
  4955.  
  4956.  
  4957.     SET subcommands allow string variables for their operands.  For
  4958.     example, ON or OFF may be contained in a string, and the string
  4959.     used as the final operand of the statement.
  4960.  
  4961.  
  4962.     A. Basic set
  4963.  
  4964.        SET 25
  4965.  
  4966.         SET 25 changes to CGA mode (25 lines), for CGA/Monochrome.
  4967.         NOTE: SET 25 clears any DWINDOW in effect.
  4968.  
  4969.        SET 43
  4970.  
  4971.         SET 43 changes to EGA mode (43 lines), if an EGA is avail-
  4972.         able.  [SET 43 sets VGA (50 lines), if VGA is available.]
  4973.         NOTE: SET 43 clears any DWINDOW in effect.
  4974.  
  4975.        SET ACCESSORY NAME # <string>
  4976.        SET ACCESSORY SUBD # <string>
  4977.        SET ACCESSORY PGM  # <string>
  4978.        SET ACCESSORY SCRI # <string>
  4979.  
  4980.            SET ACCE <field> stores the given string into the stated
  4981.            field (name, subdir, ...).  Each field is differently sized.
  4982.            Accessory directory entry numbers range from 1-50.
  4983.  
  4984.        SET ADVERT (ON!OFF)
  4985.  
  4986.         SET ADVERT sets and resets the initial advertisement display.
  4987.  
  4988.  ->       SET ALARM (ON!OFF)
  4989.  
  4990.         SET ALARM sets and resets the alarm function.  When OFF,
  4991.         the alarm does not sound (e.g. after download), but a delay,
  4992.         for a period set through Alt-S or SET ATIME, is performed.
  4993.  
  4994.        SET ANYWHEN (ON!OFF)
  4995.  
  4996.         SET ANYWHEN controls the execution of any current WHEN condi-
  4997.         tions.    When ANYWHEN is off (the default), matching occurs
  4998.         from the beginning of the buffer.  When ANYWHEN is on, the
  4999.         match is actually a substring match to the received buffer.
  5000.  
  5001.  
  5002.  
  5003.  
  5004. Version 2.8: 910717
  5005.  
  5006. COM-AND: IBM PC Communication Script Language                 Page  86
  5007.  
  5008.  
  5009. VI.    SET Commands (continued)
  5010.  
  5011.  
  5012.     A. Basic set (continued)
  5013.  
  5014.  ->       SET ASCII <subcommand>
  5015.  
  5016.         The SET ASCII subcommands are discussed below (section "B").
  5017.  
  5018.  ->       SET ATIME <number>         Alarm time
  5019.  
  5020.         SET ATIME sets the duration (in seconds) of the alarm.
  5021.  
  5022.  ->       SET BACKSPACE IN (NONDESTRUC!DESTRUC)
  5023.  
  5024.         SET BACKSPACE IN controls the function performed when a
  5025.         backspace is received.    Nondestructive backspaces are not
  5026.         common, but may be needed occasionally.
  5027.  
  5028.  ->       SET BACKSPACE OUT (BACKSPACE!DELETE)
  5029.  
  5030.         SET BACKSPACE OUT controls the function performed when a
  5031.         backspace is typed.  Either a 'backspace' character (0x8)
  5032.         or a delete character (0x7f) may be transmitted.
  5033.  
  5034.        SET BAR <attr>
  5035.  
  5036.         SET BAR sets the status line bar color.  The change takes
  5037.         effect the next time the status line is updated (e.g. with
  5038.         the LEGEND command).  The new color holds after the script.
  5039.  
  5040.  ->       SET BAUDRATE (300!1200!2400!4800!9600!19K!38K!57K!115K)
  5041.  
  5042.         SET BAUD sets the communications port linespeed.  This
  5043.         command results in a reset of the line.
  5044.  
  5045.        SET BELL <number>
  5046.  
  5047.         SET BELL sets the bell tone in hertz.
  5048.  
  5049.        SET BKSCREEN <number>
  5050.  
  5051.         SET BELL sets backscreen size in pages (0-64).    Note that
  5052.         this function clears the current backscreen in the process.
  5053.  
  5054.  
  5055.  
  5056.  
  5057.  
  5058.  
  5059. Version 2.8: 910717
  5060.  
  5061. COM-AND: IBM PC Communication Script Language                 Page  87
  5062.  
  5063.  
  5064. VI.    SET Commands (continued)
  5065.  
  5066.  
  5067.     A. Basic set (continued)
  5068.  
  5069.  ->       SET BREAK <number>
  5070.  
  5071.         SET BREAK sets the duration (in milliseconds) of the break
  5072.         signal (BREAK statement or Ctrl-end).
  5073.  
  5074.        SET BSUPPRESS (ON!OFF)
  5075.  
  5076.         SET BSUPPRESS sets and resets blank line suppression as
  5077.         implemented in COM-AND.
  5078.  
  5079.        SET CALLLOG (ON!OFF)
  5080.  
  5081.         SET CALLLOG sets and resets COM-AND's call logging.  The
  5082.         calllog records DIAL (Alt-D), REDIAL (Alt-R), HANGUP
  5083.         (Alt-H), and file transfers (PgUp and PgDn).
  5084.  
  5085.        SET CDISPLAY (ON!OFF)
  5086.  
  5087.         SET CDISPLAY turns on and off control character display.
  5088.         BBS's often use control characters as graphics, and network
  5089.         host systems only generate them inadvertantly.
  5090.  
  5091.        SET CDRESPECT (ON!OFF)
  5092.  
  5093.         SET CDRESPECT sets and resets COM-AND's treatment of the
  5094.         modem carrier detect.  When CD respect is 'off', COM-AND
  5095.         treats modem carrier as always 'true'.
  5096.  
  5097.        SET CHAT (ON!OFF)
  5098.  
  5099.         SET CHAT turns on and off chat mode.
  5100.  
  5101.        SET CHLINES <number>
  5102.  
  5103.         SET CHLINES specifies the size of the CHAT window.
  5104.  
  5105.        SET CLOCK (ON!OFF!NEW)
  5106.  
  5107.         SET CLOCK turns on and off the on-screen clock.  The "NEW"
  5108.         subcommands resets the "call time" and makes an entry in
  5109.         the calllog (if calllogging).
  5110.  
  5111.  
  5112.  
  5113.  
  5114. Version 2.8: 910717
  5115.  
  5116. COM-AND: IBM PC Communication Script Language                 Page  88
  5117.  
  5118.  
  5119. VI.    SET Commands (continued)
  5120.  
  5121.  
  5122.     A. Basic set (continued)
  5123.  
  5124.        SET COLOR (ON!OFF)
  5125.  
  5126.         SET COLOR sets/reset COM-AND's use of a color monitor, if
  5127.         available.  Note the screen is repainted accordingly.
  5128.  
  5129.        SET COMBASE <port> Nx
  5130.  
  5131.         SET COMBASE specifies the base address to be used for the
  5132.         given port (COM1, COM2, etc).
  5133.  
  5134.        SET COMVECTOR <port> Nx
  5135.  
  5136.         SET COMVECTOR specifies the vector number to be used for
  5137.         the given port (COM1, COM2, etc).
  5138.  
  5139.  ->       SET CR (CR!CR_LF)
  5140.  
  5141.         SET CR controls the display of received carriage returns.
  5142.         When set to CR_LF, received carriage returns are displayed
  5143.         as carriage return/line feeds.
  5144.  
  5145.  ->       SET CR_IN (CR!CR_LF)
  5146.  
  5147.         SET CR_IN is equivalent to SET CR above.
  5148.  
  5149.  ->       SET DATABITS (7!8)
  5150.  
  5151.         SET DATA sets the communications port to 7 or 8 data bits
  5152.         (this does not affect W/XMODEM, YMODEM, or ZMODEM transfers).
  5153.  
  5154.        SET DBLCLICK #
  5155.  
  5156.         SET DBLCLICK specifies the interval (in MS) during which a
  5157.         double click of the mouse button may occur.
  5158.  
  5159.        SET DEFAULT <attr>
  5160.  
  5161.         SET DEFA sets the color for menu windows.  The change takes
  5162.         effect the next time a window is invoked (e.g. with an alt'd
  5163.         key).  The new color holds after the script terminates.
  5164.  
  5165.  
  5166.  
  5167.  
  5168.  
  5169. Version 2.8: 910717
  5170.  
  5171. COM-AND: IBM PC Communication Script Language                 Page  89
  5172.  
  5173.  
  5174. VI.    SET Commands (continued)
  5175.  
  5176.  
  5177.     A. Basic set (continued)
  5178.  
  5179.        SET DIAL NAME # <string>
  5180.        SET DIAL NUMB # <string>
  5181.        SET DIAL RATE # <string>
  5182.        SET DIAL PARI # <string>
  5183.        SET DIAL DATA # <string>
  5184.        SET DIAL STOP # <string>
  5185.        SET DIAL SCRI # <string>
  5186.  
  5187.            SET DIAL <field> stores the given string into the stated
  5188.            field (name, number, ...).  Each field is differently sized.
  5189.            Dialing directory entry numbers range from 1-100.
  5190.  
  5191.  ->       SET DISPLAY (ON!OFF)
  5192.  
  5193.         SET DISPLAY sets and resets the display of received charac-
  5194.         ters.  You may use this to suppress (OFF) received text
  5195.         while you wait for an appropriate response.
  5196.  
  5197.  ->       SET DLDIR <string>
  5198.  
  5199.         SET DLDIR establishes a default path for downloaded files
  5200.         when the file name given is not pathed.
  5201.  
  5202.         The <string> provided may be of the form: d:\path...\path
  5203.         The <string> operand is limited to 26 characters.
  5204.  
  5205.        SET DOSLEVEL <number>
  5206.  
  5207.         SET DOSLEVEL establishes an error level (default 0) to be
  5208.         returned to the invoking program when COM-AND terminates.
  5209.         Among other things, this provides a means to exit COM-AND
  5210.         but retain control of processing (via a batch file).
  5211.  
  5212.        SET DPREFIX <string>
  5213.  
  5214.         SET DPREFIX specifies the prefix used to build a dialing
  5215.         command.
  5216.  
  5217.        SET DROPDTR (ON!OFF)
  5218.  
  5219.         SET DROPDTR specifies method used (issue modem escape+hangup
  5220.         string, or drop DTR) to hangup.
  5221.  
  5222.  
  5223.  
  5224. Version 2.8: 910717
  5225.  
  5226. COM-AND: IBM PC Communication Script Language                 Page  90
  5227.  
  5228.  
  5229. VI.    SET Commands (continued)
  5230.  
  5231.  
  5232.     A. Basic set (continued)
  5233.  
  5234.        SET DSUFFIX <string>
  5235.  
  5236.         SET DSUFFIX specifies the suffix used to build a dialing
  5237.         command.
  5238.  
  5239.        SET DTR (ON!OFF)
  5240.  
  5241.         SET DTR raises and lowers the DTR signal to the modem.
  5242.  
  5243.  ->       SET DUPLEX (HALF!FULL)
  5244.  
  5245.         SET DUPLEX turns on (HALF) and off (FULL) local echo.
  5246.  
  5247.  ->       SET ENQ (OFF!CISB)
  5248.  
  5249.         SET ENQ CISB allows automatic file transfers initiated by
  5250.         CIS.  SET ENQ OFF ignores ENQ characters.
  5251.  
  5252.        SET EXIT <script name>
  5253.  
  5254.         SET EXIT specifies a script file name to be invoked upon
  5255.         termination of COM-AND.  Termination occurs manually with
  5256.         Alt-X, or through the script command BYE.  When terminated
  5257.         and an EXIT script has been set, COM-AND invokes the script,
  5258.         after testing for carrier.  When an EXIT script is set, the
  5259.         only way to terminate COM-AND is through the script itself.
  5260.         i.e.  no EXIT script is specified in the EXIT script, and
  5261.         the EXIT script performs a BYE command.
  5262.  
  5263.         Note that the EXIT script function is cleared when it is
  5264.         invoked...  i.e.  an EXIT script must re-specify an EXIT
  5265.         script name if the function is to be preserved (and COM-AND
  5266.         not to terminate).
  5267.  
  5268.         Note that COM-AND must be ABLE to find the EXIT script on
  5269.         termination.  It is best if all EXIT scripts reside in the
  5270.         COM-AND= environment variable pointed subdirectory.
  5271.  
  5272.        SET EXQUERY (ON!OFF)
  5273.  
  5274.         SET EXQUERY sets/resets the query-on-exit function.
  5275.  
  5276.  
  5277.  
  5278.  
  5279. Version 2.8: 910717
  5280.  
  5281. COM-AND: IBM PC Communication Script Language                 Page  91
  5282.  
  5283.  
  5284. VI.    SET Commands (continued)
  5285.  
  5286.  
  5287.     A. Basic set (continued)
  5288.  
  5289.        SET FAILURE (ON!OFF)
  5290.  
  5291.         SET FAILURE sets and resets the FAILURE condition tested by
  5292.         the IF statement.  SET FAILURE may be used to modify various
  5293.         conditions setting and resetting SUCCESS/FAILURE.
  5294.  
  5295.        SET FLAG [(#)] (ON!OFF)
  5296.  
  5297.         The SET FLAG instruction sets and resets one of 10 flags.
  5298.         Flags may be tested with the IF statement.
  5299.  
  5300.  ->       SET FLOWCTRL (ON!OFF)
  5301.  
  5302.         SET FLOWCTRL turns on and off software flow control used
  5303.         during receipt of text from the host.  This command is global
  5304.         (SET ASCII FLOW is local to ASCII SENDs), affecting both
  5305.         display receipt and ASCII sends.
  5306.  
  5307.        SET FOUND (ON!OFF)
  5308.  
  5309.         SET FOUND sets and resets the FOUND condition tested by
  5310.         the IF statement.  SET FOUND may be used to imitate FIND
  5311.         statement returns.
  5312.  
  5313.  ->       SET HARDFLOW (ON!OFF)
  5314.  
  5315.         SET HARD enables and disables unidirectional hardware flow
  5316.         control.  Flow control is performed at the hardware level by
  5317.         raising RTS and waiting (for up to 20 seconds) for CTS.  Note
  5318.         that HARDFLOW is overridden by RTSFLOW (below).  This method
  5319.         is rarely used today.
  5320.  
  5321.        SET HMOUSE #
  5322.  
  5323.         SET HMOUSE specifies the mouse horizontal sensitivity.
  5324.  
  5325.        SET INAFTER (ON!OFF)
  5326.  
  5327.         SET INAFTER turns on and off modem initialization after
  5328.         hangup.
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334. Version 2.8: 910717
  5335.  
  5336. COM-AND: IBM PC Communication Script Language                 Page  92
  5337.  
  5338.  
  5339. VI.    SET Commands (continued)
  5340.  
  5341.  
  5342.     A. Basic set (continued)
  5343.  
  5344.        SET INTRINSIC (ON!OFF)
  5345.  
  5346.         SET INTRINSIC enables (ON) and disables (OFF) COM-AND's
  5347.         handling of strings that (potentially) contain intrinsic
  5348.         functions.  When disabled, strings containing intrinsic
  5349.         functions are NOT converted.
  5350.  
  5351.        SET KBDBUFFER (ON!OFF)
  5352.  
  5353.         SET KBDBUF turns on and off the keyboard display buffer.
  5354.  
  5355.  ->       SET KERMIT <subcommand>
  5356.  
  5357.         The SET KERMIT subcommands are discussed below ("C").
  5358.  
  5359.        SET LD # <string>
  5360.  
  5361.            SET LD stores the given string into the given LD directory
  5362.            entry:  1,2,3, or 4 is required, 1="+",2="-",3="#",4="@" in
  5363.            the Alt-D LD directory.
  5364.  
  5365.        SET LINKED (ON!OFF)
  5366.  
  5367.         SET LINKED sets and resets the LINKED condition tested by
  5368.         the IF statement.  SET LINKED may be used to imitate script
  5369.         execution through Alt-D.
  5370.  
  5371.        SET MACRO # <string>
  5372.  
  5373.            SET MACRO stores the given string into the given MACRO dir-
  5374.            ectory entry:  0-9.
  5375.  
  5376.        SET MASK (ON!OFF)
  5377.  
  5378.         SET MASK sets and resets the 7 bit mask of COM-AND.
  5379.  
  5380.        SET MCONNECT <string>
  5381.  
  5382.         SET MCONNECT specifies the modem connect string used to
  5383.         recognize a successful dialing function.
  5384.  
  5385.  
  5386.  
  5387.  
  5388.  
  5389. Version 2.8: 910717
  5390.  
  5391. COM-AND: IBM PC Communication Script Language                 Page  93
  5392.  
  5393.  
  5394. VI.    SET Commands (continued)
  5395.  
  5396.  
  5397.     A. Basic set (continued)
  5398.  
  5399.        SET MCR <value>
  5400.  
  5401.         SET MCR write a value to the currently selected port's
  5402.         modem control register.  It is suggested that this be
  5403.         avoided in most cases (danger!).
  5404.  
  5405.        SET MDCHAR <value>
  5406.  
  5407.         SET MDCHAR sets an alternate modem delay character used
  5408.         as 1/2 second delays in TRANSMIT and in modem strings. Note
  5409.         that this value is retained after the script terminates.
  5410.  
  5411.        SET MDELAY #
  5412.  
  5413.         SET MDELAY specifies the intercharacter time (in MS) for
  5414.         strings issued to the modem (e.g. dialing strings).
  5415.  
  5416.  ->       SET MENUMODE (ON!OFF)
  5417.  
  5418.         SET MENUMODE specifies the new MENUMODE value.    It takes
  5419.         effect only upon completion of the script.
  5420.  
  5421.        SET MESCAPE <string>
  5422.  
  5423.         SET MESCAPE specifies the string to be used to get the
  5424.         attention of the modem (e.g. before hangup).
  5425.  
  5426.        SET MHANGUP <string>
  5427.  
  5428.         SET MHANGUP specifies the string used (if DROPDTR is OFF)
  5429.         to hangup the phone.
  5430.  
  5431.        SET MINIT <string>
  5432.  
  5433.         SET MINIT specifies the string transmitted to the modem
  5434.         when COM-AND is loaded.
  5435.  
  5436.        SET MUSIC (ON!OFF)
  5437.  
  5438.         SET MUSIC sets and resets COM-AND's processing of music
  5439.         escape sequences.  Music escape sequences are received:
  5440.         "ESC [ M <string> <control-N>'.
  5441.  
  5442.  
  5443.  
  5444. Version 2.8: 910717
  5445.  
  5446. COM-AND: IBM PC Communication Script Language                 Page  94
  5447.  
  5448.  
  5449. VI.    SET Commands (continued)
  5450.  
  5451.  
  5452.     A. Basic set (continued)
  5453.  
  5454.        SET OVENTRY NONE!<address>)
  5455.  
  5456.         SET OVEN establishes the address (or none) to be executed
  5457.         when the current overlay is terminated (e.g. when a new
  5458.         overlay is loaded, or on Alt-X).
  5459.  
  5460.  ->       SET PARITY (EVEN!ODD!NONE)
  5461.  
  5462.         SET PARITY sets the communications line parity.
  5463.  
  5464.        SET PCJR (ON!OFF)
  5465.  
  5466.         SET PCJr sets and resets a PCJr mode, which suspends the
  5467.         comm line during disk I/O.  This only effects transcripts,
  5468.         Windowed XMODEM and Windowed Kermit.
  5469.  
  5470.  ->       SET PORT (COM1!COM2!COM3!COM4)
  5471.  
  5472.         SET PORT declares the communications port to be used.
  5473.         This command resets the communications line.
  5474.  
  5475.        SET QUIET (ON!OFF)
  5476.  
  5477.         SET QUIET turns on and off bell character suppression.
  5478.  
  5479.  ->       SET RDELAY <number>
  5480.  
  5481.         SET RDELAY sets the duration (in seconds) of the delay
  5482.         between Alt-R and script DIAL statement redial attempts.
  5483.  
  5484.        SET RDISPLAY (ON!OFF)
  5485.  
  5486.         SET RDISPLAY sets and resets the display of received text.
  5487.         You may use this to suppress (OFF) received text while you
  5488.         wait for an appropriate response.
  5489.  
  5490.        SET RDMAX <number>
  5491.  
  5492.         A script author may set a limit to the number of redials per-
  5493.         formed through a DIAL statement.  This feature is available
  5494.         only in the script that sets it (at this time).
  5495.  
  5496.  
  5497.  
  5498.  
  5499. Version 2.8: 910717
  5500.  
  5501. COM-AND: IBM PC Communication Script Language                 Page  95
  5502.  
  5503.  
  5504. VI.    SET Commands (continued)
  5505.  
  5506.  
  5507.     A. Basic set (continued)
  5508.  
  5509.        SET RECHO (ON!OFF)
  5510.  
  5511.         SET RECHO sets and resets the echo of received characters.
  5512.         This might be enabled (ON), for example, in a script that
  5513.         performed a 'HOST' mode for outside callers.
  5514.  
  5515.        SET REMAP (ON!OFF)
  5516.  
  5517.         SET REMAP enables (on) and disables (off) keyboard remapping.
  5518.         A remap must first be created and placed into a file COM-AND
  5519.         .RMP (for example using the supplied REMAP.CMD script).
  5520.  
  5521.  ->       SET REMOTE (ON!OFF)
  5522.  
  5523.         SET REMOTE enables (on) and disables (off) the ability to
  5524.         execute script functions through received commands.  REMOTE
  5525.         commands are received: "ESC,^,<script command> <cr>".
  5526.  
  5527.        SET REMFTNS (ON!OFF)
  5528.  
  5529.         SET REMFTN enables (on) and disables (off) transmission of
  5530.         function key values to a remote Doorway-like utility.  When
  5531.         this is ON, function key pop-ups in COM-AND are inhibited.
  5532.  
  5533.        SET RLEOK (ON!OFF)
  5534.  
  5535.         SET RLEOK sets and resets the possibility of RLE display
  5536.         during normal receive functions.
  5537.  
  5538.        SET RMODE (ASCII!BINARY)
  5539.  
  5540.         SET RMODE affects the RGET command subsequent.    By default,
  5541.         the RMODE setting is ASCII.  When set to ASCII, RGETs ignore
  5542.         nulls and line feeds, end on a carriage return (or length),
  5543.         and backspace/rubouts are implemented (and not buffered).
  5544.         When the mode is binary, nulls, carriage returns, line feeds,
  5545.         backspaces and rubouts are buffered.
  5546.  
  5547.        SET RTS (ON!OFF)
  5548.  
  5549.         SET RTS sets and resets request-to-send bit of the modem.
  5550.         Generally, this capability should be avoided.
  5551.  
  5552.  
  5553.  
  5554. Version 2.8: 910717
  5555.  
  5556. COM-AND: IBM PC Communication Script Language                 Page  96
  5557.  
  5558.  
  5559. VI.    SET Commands (continued)
  5560.  
  5561.  
  5562.     A. Basic set (continued)
  5563.  
  5564.        SET RTSD (ON!OFF)
  5565.  
  5566.         SET RTSD enables (on) and disables (off) RTS Discipline
  5567.         in COM-AND.  When enabled, RTS is raised before every write
  5568.         and lowered after.  When disabled, RTS is not lowered, and
  5569.         the script controls RTS (via SET RTS above).
  5570.  
  5571.        SET RTSF (ON!OFF)
  5572.  
  5573.         SET RTSF enables (on) and disables (off) bidirectional flow
  5574.         control.  When this flow control is enabled the RTS line is
  5575.         used to signal the modem that COM-AND is able (or not able)
  5576.         to receive characters.    This method of flow control is re-
  5577.         quired by some (very new) modems.  Refer to Appendix J for
  5578.         more discussion.
  5579.  
  5580.        SET SILENCE <seconds>
  5581.  
  5582.         SET SILENCE sets and resets the timeout used by ON SILENCE
  5583.         GOSUB.    The trap defaults to 300 seconds.  Note that SET
  5584.         SILENCE changes only the timeout, not the trap clock.
  5585.  
  5586.        SET SLOWOUT (ON!OFF)
  5587.  
  5588.         SET SLOWOUT sets and resets 'slow output' during file trans-
  5589.         fers.  COM-AND usually performs transfers at machine speed
  5590.         (interrupt driven writes);  Some network modems cannot take
  5591.         this speed.
  5592.  
  5593.  ->       SET SOFTFLOW (ON!OFF)
  5594.  
  5595.         SET SOFTFLOW sets and resets software flow control (XON/XOFF)
  5596.         as used in receive and ASCII SEND.
  5597.  
  5598.        SET STATUS (ON!OFF)
  5599.  
  5600.         SET STATUS enables and disables the status line display.
  5601.         When OFF, the last line is used for received text display.
  5602.  
  5603.  ->       SET STOPBITS (1!2)
  5604.  
  5605.         SET STOP sets the communications port to 1 or 2 stop bits.
  5606.  
  5607.  
  5608.  
  5609. Version 2.8: 910717
  5610.  
  5611. COM-AND: IBM PC Communication Script Language                 Page  97
  5612.  
  5613.  
  5614. VI.    SET Commands (continued)
  5615.  
  5616.  
  5617.     A. Basic set (continued)
  5618.  
  5619.  ->       SET SUCCESS (ON!OFF)
  5620.  
  5621.         SET SUCCESS sets and resets the SUCCESS condition tested by
  5622.         the IF statement.  SET SUCCESS be used to modify various
  5623.         conditions that set/reset SUCCESS/FAILURE.
  5624.  
  5625.  ->       SET SWRITE (BIOS!DIRECT!DOS)
  5626.  
  5627.         SET SWRITE sets COM-AND to use either BIOS or direct screen
  5628.         buffer access for menu saves/restores.    Direct access is much
  5629.         faster (of course), however, a certain few machines are not
  5630.         compatible to the extent of screen memory address.
  5631.  
  5632.         SET SWRITE DOS only affects text written to the screen.
  5633.         When used, text received is passed to the console device.
  5634.  
  5635.         SET SWRITE BIOS affects both text written to the screen
  5636.         and the method used for screen saves.  BIOS is used in both
  5637.         cases.    If both SWRITE DOS and SWRITE BIOS are set, text goes
  5638.         through DOS, and screen save/restores go through BIOS.
  5639.  
  5640.        SET TEXT <attr>
  5641.  
  5642.         SET TEXT sets the color for text display.  The change takes
  5643.         effect the next time a character is displayed (it does not
  5644.         repaint).  The new color holds after the script terminates.
  5645.  
  5646.         NOTE: To change the color attribute for the entire screen:
  5647.  
  5648.               SET TEXT <attr>    ; Set text attr for subsequent chars
  5649.               SET COLOR "_COLOR"; Repaint screen and border
  5650.  
  5651.        SET TIMER [(#)]
  5652.  
  5653.         The SET TIMER instruction sets the timestamp for one of 10
  5654.         timers.  Timers are read using the TSINCE statement.
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662.  
  5663.  
  5664. Version 2.8: 910717
  5665.  
  5666. COM-AND: IBM PC Communication Script Language                 Page  98
  5667.  
  5668.  
  5669. VI.    SET Commands (continued)
  5670.  
  5671.  
  5672.     A. Basic set (continued)
  5673.  
  5674.        SET TTHRU (ON!OFF)
  5675.  
  5676.         The SET TTHRU sets the script processor to allow (ON) or not
  5677.         allow (OFF) typethrough during the script.  When set OFF,
  5678.         keystrokes are queued and will be read by KEYGET, ATGET, MAT-
  5679.         GET, GET and MGET.
  5680.  
  5681.         Note that TYPETHRU is a 'global' condition, whereas HITKEY is
  5682.         a 'local' condition.  Typethrough is suspended after HITKEY
  5683.         is tested, until the key is read.  Once the key is read, the
  5684.         HITKEY condition is disabled and typethrough is allowed
  5685.         (unless you've SET TTHRU OFF).
  5686.  
  5687.         Note: Use of SET TTHRU may inhibit termination with ESCape!
  5688.  
  5689.        SET TUNE <string>
  5690.  
  5691.         The SET TUNE sets the alarm tune to the BASIC encoded play
  5692.         statement in <string>.    The ERROR condition is set if the
  5693.         string cannot be parsed (and the alarm is not set).  Refer
  5694.         to Appendix C for the syntax of the play statement.
  5695.  
  5696.        SET VMOUSE #
  5697.  
  5698.         SET HMOUSE specifies the mouse vertical sensitivity.
  5699.  
  5700.        SET WAITFOR (ON!OFF)
  5701.  
  5702.         SET WAITFOR sets and resets the WAITFOR condition tested
  5703.         by the IF statement.  SET WAITFOR may be used to modify the
  5704.         results of a WAITFOR instruction.
  5705.  
  5706.        SET WATCHDOG <seconds>
  5707.  
  5708.         SET WATCHDOG sets the XOFF watchdog timer timeout.  When an
  5709.         XOFF is received a timer begins.  If no XON is received with-
  5710.         in <timer> seconds, the XOFF condition is cancelled.
  5711.  
  5712.         WARNING:  Script authors who use this command to increase the
  5713.         default XOFF timeout run a SERIOUS risk of locking up their
  5714.         machines.  XOFF is a frequent noise character...  Without the
  5715.         watchdog timer, any noise character might stop COM-AND cold.
  5716.  
  5717.  
  5718.  
  5719. Version 2.8: 910717
  5720.  
  5721. COM-AND: IBM PC Communication Script Language                 Page  99
  5722.  
  5723.  
  5724. VI.    SET Commands (continued)
  5725.  
  5726.  
  5727.     A. Basic set (continued)
  5728.  
  5729.        SET WRAP (ON!OFF)
  5730.  
  5731.         SET WRAP controls the action taken when the cursor reaches
  5732.         the rightmost column of the screen.  When WRAP is OFF, each
  5733.         character received is displayed in that column until a cr/lf.
  5734.  
  5735.        SET XSUI <number>
  5736.  
  5737.         SET XSUI sets the frequency (as an interval of blocks) with
  5738.         which COM-AND updates its protocol status screens during a
  5739.         file transfer.    XSUI is mnemonic for 'xfer screen update
  5740.         interval'.
  5741.  
  5742.         At 9600 baud and above, the time it takes to paint the status
  5743.         screen becomes a significant percentage of the overall time
  5744.         spent.    Setting the update interval to '5' will have visible
  5745.         impact at 2400 baud.
  5746.  
  5747.        SET ZMODEM <subcommand>
  5748.  
  5749.         The SET ZMODEM subcommands are discussed below ("D").
  5750.  
  5751.  
  5752.  
  5753.  
  5754.  
  5755.  
  5756.  
  5757.  
  5758.  
  5759.  
  5760.  
  5761.  
  5762.  
  5763.  
  5764.  
  5765.  
  5766.  
  5767.  
  5768.  
  5769.  
  5770.  
  5771.  
  5772.  
  5773.  
  5774. Version 2.8: 910717
  5775.  
  5776. COM-AND: IBM PC Communication Script Language                 Page 100
  5777.  
  5778.  
  5779. VI.    SET Commands (continued)
  5780.  
  5781.  
  5782.     B. SET ASCII subcommands
  5783.  
  5784.  ->       SET ASCII BLANKEX (ON!OFF)
  5785.  
  5786.         SET ASCII BLAN sets and resets blank line expansion for the
  5787.         SENDFILE ASCII function (if the line is empty, one blank is
  5788.         sent if this flag is on).
  5789.  
  5790.  ->       SET ASCII CHARPACE <number>
  5791.  
  5792.         SET ASCII CHARPACE sets an intercharacter delay (in milli-
  5793.         seconds for the SENDFILE ASCII function.
  5794.  
  5795.  ->       SET ASCII ECHO (ON!OFF)
  5796.  
  5797.         SET ASCII ECHO enables (if set) the text echo during a
  5798.         SENDFILE ASCII function (only during current script).
  5799.  
  5800.        SET ASCII FLOW (ON!OFF)
  5801.  
  5802.         SET ASCII FLOW sets and resets flow control SENDFILE ASCII
  5803.         function.  When on, flow control is respected.
  5804.  
  5805.  ->       SET ASCII LINEPACE <number>
  5806.  
  5807.         SET ASCII LINE sets an delay at end-of-line (CR) in tenths
  5808.         of seconds for the SENDFILE ASCII function.
  5809.  
  5810.  ->       SET ASCII PACECHAR <number>
  5811.  
  5812.         SET ASCII PACE sets a pace character for the SENDFILE ASCII
  5813.         function.  The value provided is the decimal ascii value of
  5814.         the pace character (use 0 to turn this off).
  5815.  
  5816.        SET ASCII QUIET (ON!OFF)
  5817.  
  5818.         SET ASCII QUIET disables (if set) the alarm at the end of
  5819.         a SENDFILE ASCII function (only during current script).
  5820.  
  5821.        SET ASCII TABEX (ON!OFF)
  5822.  
  5823.         SET ASCII TABEX sets and resets tab expansion for the
  5824.         SENDFILE ASCII function.
  5825.  
  5826.  
  5827.  
  5828.  
  5829. Version 2.8: 910717
  5830.  
  5831. COM-AND: IBM PC Communication Script Language                 Page 101
  5832.  
  5833.  
  5834. VI.    SET Commands (continued)
  5835.  
  5836.  
  5837.     B. SET ASCII subcommands (continued)
  5838.  
  5839.  ->       SET ASCII UP_LF (LF!STRIP)
  5840.  
  5841.         SET ASCII UP_LF sets and resets LF stripping during a
  5842.         SENDFILE ASCII function.  Note that "UP_LF CR_LF" is
  5843.         not implemented at this time.
  5844.  
  5845.        SET ASCII UP_Z (STOP!SEND)
  5846.  
  5847.         SET ASCII UP_Z sets and resets control-z handling for the
  5848.         SENDFILE ASCII function.  When STOP, the transfer stops at
  5849.         a control-z (and the control-z is not transmitted).
  5850.  
  5851.  
  5852.  
  5853.     C. SET KERMIT subcommands
  5854.  
  5855.  ->       SET KERMIT 8QUOTE <number>
  5856.  
  5857.         SET KERMIT 8QUOTE sets the 8-bit quote character used in
  5858.         KERMIT transfers.  This value may be inspected and changed
  5859.         through Alt-K.    The <number> is the decimal ascii value of
  5860.         the 8-bit quote character to be used.
  5861.  
  5862.  ->       SET KERMIT BLOCKCHECK (1!2!3)
  5863.  
  5864.         SET KERMIT BLOCK sets the length of the blockcheck used in
  5865.         KERMIT transfers.  This value may be inspected and changed
  5866.         through Alt-K.    The blockcheck may be 1, 2 or 3 bytes long.
  5867.  
  5868.  ->       SET KERMIT CQUOTE <number>
  5869.  
  5870.         SET KERMIT CQUOTE sets the control quote character used in
  5871.         KERMIT transfers.  This value may be inspected and changed
  5872.         through Alt-K.    The <number> is the decimal ascii value of
  5873.         the control quote character to be used.
  5874.  
  5875.  ->       SET KERMIT EOLCHAR <number>
  5876.  
  5877.         SET KERMIT EOLCHAR sets the end-of-line character used in
  5878.         KERMIT transfers.  This value may be inspected and changed
  5879.         through Alt-K.    The <number> is the decimal ascii value of
  5880.         the end-of-line character to be used.
  5881.  
  5882.  
  5883.  
  5884. Version 2.8: 910717
  5885.  
  5886. COM-AND: IBM PC Communication Script Language                 Page 102
  5887.  
  5888.  
  5889. VI.    SET Commands (continued)
  5890.  
  5891.  
  5892.     C. SET KERMIT subcommands (continued)
  5893.  
  5894.        SET KERMIT MARK <number>
  5895.  
  5896.         SET KERMIT MARK sets the packet mark character used in
  5897.         KERMIT transfers.  This value may be inspected and changed
  5898.         through Alt-K.    The <number> is the decimal ascii value of
  5899.         the packet mark character to be used.
  5900.  
  5901.  ->       SET KERMIT PADCHAR <number>
  5902.  
  5903.         SET KERMIT PADCHAR sets the pad character used in KERMIT
  5904.         transfers.  This value may be inspected and changed through
  5905.         Alt-K.    The <number> is the decimal ascii value of the pad
  5906.         character to be used.
  5907.  
  5908.  ->       SET KERMIT PADNUM number
  5909.  
  5910.         SET KERMIT PADNUM sets the number of pad characters (if
  5911.         any) to be used during KERMIT transfers.  This value may be
  5912.         inspected and changed through Alt-K.
  5913.  
  5914.        SET KERMIT REPEAT <number>
  5915.  
  5916.         SET KERMIT REPEAT sets the repeat quote character used in
  5917.         KERMIT transfers.  This value may be inspected and changed
  5918.         through Alt-K.    The <number> is the decimal ascii value of
  5919.         the repeat quote character to be used.
  5920.  
  5921.        SET KERMIT WINDOW <number>
  5922.  
  5923.         SET KERMIT WINDOW sets the maximum window size for KERMIT
  5924.         transfers.  A window maximum of 0 stops windowed transfers.
  5925.         COM-AND places an upper limit on this size (currently the
  5926.         limit is 8).
  5927.  
  5928.  
  5929.  
  5930.  
  5931.  
  5932.  
  5933.  
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939. Version 2.8: 910717
  5940.  
  5941. COM-AND: IBM PC Communication Script Language                 Page 103
  5942.  
  5943.  
  5944. VI.    SET Commands (continued)
  5945.  
  5946.  
  5947.     D. SET ZMODEM subcommands
  5948.  
  5949.        SET ZMODEM AUTO (ON!OFF)
  5950.  
  5951.         ZMODEM download is capable of automatically starting when
  5952.         the sender begins transmission.  You may control whether
  5953.         COM-AND will automatically begin the receive.  [Note that
  5954.         during scripted operation, auto-ZMODEM only occurs when the
  5955.         display is being performed.]
  5956.  
  5957.        SET ZMODEM BLOCK <number>
  5958.  
  5959.         SET ZMODEM BLOCK sets a maximum blocksize for ZMODEM sends.
  5960.         When a blocksize is set (rather than negotiated), the trans-
  5961.         fer reverts to half duplex (send, ACK, send, ACK).  This is
  5962.         provided for special cases (badly errored lines).  It is not
  5963.         recommended, generally speaking.
  5964.  
  5965.         Blocksize is limited to 1024.  SET ZMODEM BLOCK 0 returns
  5966.         COM-AND's ZMODEM to full duplex (and automatic block sizing).
  5967.  
  5968.        SET ZMODEM RECOVER (ON!OFF)
  5969.  
  5970.         SET ZMODEM RECOVER enables and disables ZMODEM's recovery
  5971.         feature.  When a receive is intended for an existing file
  5972.         (intended to be a the result of a previous, failed, trans-
  5973.         fer), the transfer will pick up at the end of file (where the
  5974.         last one stopped), if enabled.    When disabled, transfers go
  5975.         to a unique file name ($ terminated as required).
  5976.  
  5977.  
  5978.  
  5979.  
  5980.  
  5981.  
  5982.  
  5983.  
  5984.  
  5985.  
  5986.  
  5987.  
  5988.  
  5989.  
  5990.  
  5991.  
  5992.  
  5993.  
  5994. Version 2.8: 910717
  5995.  
  5996. COM-AND: IBM PC Communication Script Language                 Page 104
  5997.  
  5998.  
  5999. VII.    String Intrinsics
  6000.  
  6001.  
  6002.     Certain string values are treated as having an intrinsic meaning
  6003.     by the script processor.  All intrinsic string values must have
  6004.     an underscore ("_") in column 0 of the string, and otherwise be
  6005.     alone in the string (note that only the first 4 characters of the
  6006.     intrinsic keyword are significant).   For example:
  6007.  
  6008.          S0 = "_Date"            ; is equivalent to
  6009.          S0 = "_DateToday"       ; .. where contiguous text is ignored
  6010.  
  6011.     But  S0 = "_Date today" would not be treated as containing an
  6012.     intrinsic value.
  6013.  
  6014.     When the script processor encounters an intrinsic function, it
  6015.     replaces the value with the computed value.  String intrinsic
  6016.     functions are:
  6017.  
  6018.  
  6019.     _ABLA         ASCII Blank-expand flag
  6020.     _ACCF         Current accessory file
  6021.     _ACHA         ASCII Character pace delay (ms)
  6022.     _ADVE         ADVErtisement Flag on/off
  6023.     _AECH         ASCII Echo flag
  6024.     _AFLO         ASCII Flow control flag
  6025.     _ALAR         ALARm Flag on/off
  6026.     _ALIN         ASCII Line pace time (.01 ms)
  6027.     _ALLO         0,1,2... number of dynamic variables allocated
  6028.     _APAC         ASCII Pace character (Decimal ASCII value)
  6029.     _AQUI         ASCII Quiet flag
  6030.     _ATAB         ASCII tab expand flag
  6031.     _ATIM         Alarm time (secs)
  6032.     _AUPZ         ASCII Send ctl-z flag (STRIP!SEND)
  6033.     _BAR         (numeric) Status line color attribute
  6034.     _BELL         Bell tone (hz)
  6035.     _BKSC         Backscreen buffer size (pages)
  6036.     _BREA         Break duration (ms)
  6037.     _BSIN         Backspace IN (NONDESTRUC!DESTRUC)
  6038.     _BSOU         Backspace out (BACKSP!DELETE)
  6039.     _BSUP         BSUPpress Flag on/off
  6040.     _CALL         Last dialed dialing directory entry
  6041.     _CDIS         Control-char display flag on/off
  6042.     _CDRE         CDREspect Flag on/off
  6043.     _CHAT         CHAT Flag on/off
  6044.     _CHLI         Chat lines
  6045.  
  6046.  
  6047.  
  6048.  
  6049. Version 2.8: 910717
  6050.  
  6051. COM-AND: IBM PC Communication Script Language                 Page 105
  6052.  
  6053.  
  6054. VII.    String Intrinsics (continued)
  6055.  
  6056.  
  6057.     _CLFI         Call Log file name
  6058.     _CLOC         CLOCk Flag on/off
  6059.     _CLOG         CLOGging Flag on/off
  6060.     _COLO         Color flag on/off
  6061.     _COMM         Return comm mode: BIOS or DIRECT
  6062.     _CONN         Connection (formatted: Y/N)
  6063.     _CRLF         CR -> CRLF flag (ON, OFF values, ON = CR->CRLF)
  6064.     _DATE         Current date (formatted: mm/dd/yyyy)
  6065.     _DBLC         Double click interval in MS
  6066.     _DEFA         (numeric) Menu window color attribute
  6067.     _DIRF         Current dialing file
  6068.     _DLDI         Read current download drive:subdirectory
  6069.     _DOW         Day of week (0 -> Sunday, 1 -> Monday, etc)
  6070.     _DPRE         Dialing prefix (from Alt-S)
  6071.     _DROP         Drop DTR flag
  6072.     _DSUF         Dialing suffix (from Alt-S)
  6073.     _DUPL         Duplex setting (HALF!Full)
  6074.     _EFFI         Last transfer efficiency
  6075.     _ELAP         Elapsed time since call (formatted hh:mm:ss:tt)
  6076.     _EMUL         EMULATION (TTY!ANSI!VIDTEX!...)
  6077.     _ERRO         Last transfer error text (formatted: nn: text)
  6078.     _EXIT         Return current exit script name
  6079.     _EXQU         EXit QUery Flag on/off
  6080.     _FLOW         (soft) FLOW Flag on/off
  6081.     _HARD         Hardware flow control flag (UNIDIRECTIONAL)
  6082.     _HMOU         Mouse horizontal (mickeys)
  6083.     _IFIL         FOPENI (script input) file name
  6084.     _INAF         Init modem after hangup on/off
  6085.     _K8QU         KERMIT 8 bit quote
  6086.     _KBDB         KBDBuf Flag on/off
  6087.     _KCHK         KERMIT Block check
  6088.     _KCQU         KERMIT control quote character
  6089.     _KEOL         KERMIT EOL character
  6090.     _KMAR         KERMIT Mark character
  6091.     _KNUM         KERMIT number pads
  6092.     _KPAD         KERMIT pad character
  6093.     _KREP         KERMIT Repeat character
  6094.     _KWIN         KERMIT maximum window
  6095.     _LEGE         Returns last LEGEND string displayed (or null)
  6096.     _LOGG         LOGging Flag on/off
  6097.     _LOGH         LOG Held Flag on/off
  6098.     _LOGM         LOGMarked Flag on/off
  6099.     _MACF         Current macro file
  6100.     _MASK         (7 bit) MASK Flag on/off
  6101.  
  6102.  
  6103.  
  6104. Version 2.8: 910717
  6105.  
  6106. COM-AND: IBM PC Communication Script Language                 Page 106
  6107.  
  6108.  
  6109. VII.    String Intrinsics (continued)
  6110.  
  6111.  
  6112.     _MCON         Modem connect string (from Alt-S)
  6113.     _MDCH         Modem delay character
  6114.     _MDEL         Modem character delay (ms)
  6115.     _MENU         Menu mode Flag on/off
  6116.     _MESC         Modem escape string (from Alt-S)
  6117.     _METH         Last transfer method
  6118.     _MHAN         Modem hangup string (from Alt-S)
  6119.     _MINI         Modem initialization string (from Alt-S)
  6120.     _MOUS         Return mouse presence: YES/NO
  6121.     _MUSI         MUSIc Flag on/off
  6122.     _NULL         Null value (empty string)
  6123.     _OFIL         FOPENO (script output) file name
  6124.     _ONES         Current ON ESCAPE GOSUB label (8 characters)
  6125.     _OVER         Return OVERLAY file name last loaded (or null)
  6126.     _OVEN         Overlay end entry address (or NONE)
  6127.     _PARM         Current comm parms (formatted as COMPARM statement)
  6128.     _PCJR         PCJR Flag on/off
  6129.     _PORT         Return current port number (BIOS or DIRECT comm)
  6130.     _PRIN         PRINter Flag on/off
  6131.     _QUIE         QUIEt Flag on/off
  6132.     _RDEL         Reconnect delay (secs)
  6133.     _RDIS         RDISplay Flag on/off
  6134.     _RDMA         ReDial MAximum value (0 -> no limit set)
  6135.     _RDPN         ReDial Pass Number on which CONNECT last occurred
  6136.     _RECH         RECHo Flag on/off
  6137.     _REMA         Remapping on/off
  6138.     _REMO         REMOte Flag on/off
  6139.     _REMF         Remote function key usage on/off
  6140.     _RLEO         RLEOk Flag on/off
  6141.     _RTSD         RTSDiscipline Flag on/off
  6142.     _RTSF         RTSFlow control on/off (BIDIRECTIONAL)
  6143.     _RUNT         Return Runtime invocation: YES/NO (see below)
  6144.     _SCRI         Current script file name
  6145.     _SILE         Duration (in MS) of ON SILENCE timeout
  6146.     _SIZE         Last transfer size
  6147.     _SLOW         SLOW Flag on/off
  6148.     _SSIZ         Current screen size (# lines)
  6149.     _STAT         Status line displayed (on/off)
  6150.     _SUBD         Read current drive:subdirectory
  6151.     _SWRI         Screen write (DOS!BIOS!DIRECT)
  6152.     _TEXT         (numeric) Text window color attribute
  6153.     _TIME         Current time (formatted: hh:mm:ss:tt)
  6154.     _TRAN         In/Out Translate on/off
  6155.     _TRFI         Last transferred file (except multiple transfers)
  6156.     _TRTI         Last transfer time
  6157.  
  6158.  
  6159. Version 2.8: 910717
  6160.  
  6161. COM-AND: IBM PC Communication Script Language                 Page 107
  6162.  
  6163.  
  6164. VII.    String Intrinsics (continued)
  6165.  
  6166.  
  6167.     _TTHR         TTHRu Flag on/off
  6168.     _UART         Return UART type (-1,0,...3: see below)
  6169.     _VMOU         Mouse vertical (mickeys)
  6170.     _XSUI         Transfer screen update interval
  6171.     _ZAUT         ZMODEM auto download flag
  6172.     _ZBLO         ZMODEM maximum blocksize
  6173.     _ZREC         ZMODEM download recovery flag
  6174.  
  6175.  
  6176.     Intrinsic returned values are left justified in the string (with the
  6177.     exception of "_PARM", which does not justify " 300" in the string).
  6178.  
  6179.  
  6180.     The returned value may or may not be blank padded.  [Blank padding
  6181.     is of concern in some cases.  The construction 'Sx = Sx&""' may be
  6182.     used to remove trailing spaces.]
  6183.  
  6184.  
  6185.     Note that when a batch file transfer is performed (e.g.  KERMIT),
  6186.     only the last file name transferred is reported.
  6187.  
  6188.  
  6189.     In the case of ZMODEM and YMODEM-Batch the file name is always null,
  6190.     by definition of the protocol's last file name transferred.
  6191.  
  6192.  
  6193.     The file transfer intrinsics only refer to binary protocols.  They do
  6194.     not report ASCII transfers.
  6195.  
  6196.  
  6197.     The "_UART" intrinsic returns the values -1,0,1...3 according to the
  6198.     UART type found when the current port was opened.  These values mean:
  6199.  
  6200.          -1 -> No UART was detected
  6201.           0 -> 8250 type UART detected (NO FIFO buffering)
  6202.         1/2 -> 16450/16500 UART detected (NO FIFO buffering)
  6203.           3 -> 16550A type UART detected (FIFO buffering)
  6204.  
  6205.  
  6206.     The "_RUNT" intrinsic may be used to distinguish automatic scripts
  6207.     (COM-AND.CMD and INSTALL.CMD) from all other scripts.  These scripts
  6208.     are automatically invoked at run-time (INSTALL being invoked only in
  6209.     certain cases).  "_RUNT" returns YES during automatic run-time
  6210.     scripts.
  6211.  
  6212.  
  6213.  
  6214. Version 2.8: 910717
  6215.  
  6216. COM-AND: IBM PC Communication Script Language                 Page 108
  6217.  
  6218.  
  6219. VIII.    Script Errors
  6220.  
  6221.  
  6222.     Errors are reported in the form:  <line #>: <error text>
  6223.  
  6224.     Error texts are:   Invalid token
  6225.  
  6226.                Unexpected end of file
  6227.  
  6228.                Unexpected token
  6229.  
  6230.                Missing token
  6231.  
  6232.                Stack overflow
  6233.  
  6234.                Stack underflow
  6235.  
  6236.                Unexpected characters at end of line
  6237.  
  6238.                Unexpected CASE
  6239.                Unexpected DEFAULT
  6240.                Unexpected ENDCASE
  6241.                Unexpected ENDSWITCH
  6242.                Unexpected ELSE
  6243.                Unexpected ENDIF
  6244.                Unexpected RETURN
  6245.                Unexpected ENDFOR
  6246.                Unexpected UNTIL
  6247.                Unexpected ENDWHILE
  6248.                Unexpected FRETURN
  6249.  
  6250.  
  6251.     Note:  COM-AND does not terminate in all cases where an error is
  6252.     encountered.  Stack over/underflow errors always terminate a
  6253.     script, as do the unexpected CASE/DEFAULT/ENDCASE/ENDSWITCH/
  6254.     ELSE/ENDIF/RETURN errors.  Unexpected end-of-file (when a GOTO
  6255.     branches to a label that does not exist) terminates the script.
  6256.     Other errors do not terminate the script.
  6257.  
  6258.  
  6259.     Note: PROCOMM does not accept a command on a labelled line.
  6260.     However, PROCOMM does not issue an error message at that point
  6261.     either.  COM-AND will report 'unexpected characters at end of
  6262.     line' when this is encountered, and ignore the command.
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.  
  6269. Version 2.8: 910717
  6270.  
  6271. COM-AND: IBM PC Communication Script Language                 Page 109
  6272.  
  6273.  
  6274. IX.    ASPECT 1.x and PROCOMM 2.x scripts
  6275.  
  6276.  
  6277.     COM-AND will execute most scripts written for PROCOMM 2.x and for
  6278.     the ASPECT 1.x script language (tm DataStorm).    However, the ASPECT
  6279.     language is a small subset of the COM-AND script language.  Although
  6280.     COM-AND will execute most PROCOMM scripts, PROCOMM will not execute
  6281.     most COM-AND scripts.  To retain ability to execute a script you
  6282.     write under PROCOMM:
  6283.  
  6284.        o     ONLY use statements marked '->' in the discussion above.
  6285.          These statements are compatible with the ASPECT language.
  6286.  
  6287.     o    ONLY use constructions highlighted '->' in the discussion above.
  6288.          For example:  COM-AND will accept (and PROCOMM won't):
  6289.  
  6290.          STRCAT S0 S1(5:10)      ; Extract substring and concatenate
  6291.  
  6292.     o    REFER to the PROCOMM document (or ASPECT manual for full dis-
  6293.          cussion of ANY statement you wish to employ.
  6294.  
  6295.     o    Avoid numeric variables N10-N99
  6296.  
  6297.     o    Avoid string variables S10-S29
  6298.  
  6299.     o    Avoid ALL string variables V0-Vn
  6300.  
  6301.     o    Avoid ALL usage of FLAG variables
  6302.  
  6303.     o    Use full keywords;  do not abbreviate to 4 characters.
  6304.  
  6305.  
  6306.  
  6307.  
  6308.  
  6309.  
  6310.  
  6311.  
  6312.  
  6313.  
  6314.  
  6315.  
  6316.  
  6317.  
  6318.  
  6319.  
  6320.  
  6321.  
  6322.  
  6323.  
  6324. Version 2.8: 910717
  6325.  
  6326. COM-AND: IBM PC Communication Script Language                 Page 110
  6327.  
  6328.  
  6329. IX.    ASPECT 1.x and PROCOMM 2.x scripts
  6330.  
  6331.  
  6332.     Unimplemented ASPECT commands
  6333.     -----------------------------
  6334.  
  6335.     Every attempt has been made to provide a script language that is
  6336.     compatible with PROCOMM.  However, certain commands do not apply to
  6337.     COM-AND.  Others have been changed for more or less obvious reasons.
  6338.     Changes and optional usages have been highlighted above.
  6339.  
  6340.  
  6341.     The following ASPECT commands have not been implemented:
  6342.  
  6343.  
  6344.  *    HELP
  6345.  *    HOST
  6346.  *    KERMSERV FINISH
  6347.  *    KERMSERV GETFILE
  6348.  *    KERMSERV LOGOUT
  6349.  *    KERMSERV SENDFILE
  6350.  *    SET ASCII DN_CR (CR!CR_LF!STRIP)
  6351.  *    SET ASCII DN_LF (LF!CR_LF!STRIP)
  6352.  *    SET ASCII UP_CR (CR!CR_LF!STRIP)
  6353.  *    SET CR_OUT (CR!CR_LF)
  6354.  *    SET ENQ ON         ; SET ENQ OFF!CISB implemented
  6355.  *    SET HOSTPSWD <string>
  6356.  *    SET KERMIT PACKSIZE <number>
  6357.  *    SET KERMIT HANDSHAKE <number>
  6358.  *    SET KERMIT FILETYPE (TEXT!BINARY)
  6359.  *    SET SCROLL (ON!OFF)
  6360.  *    SET SHELLPSWD <string>
  6361.  *    SET SOUND (ON!OFF)
  6362.  *    SET TXPACE <number>  ; Partially implemented as SET ASCII CHARPACE
  6363.  *    SNAPSHOT
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379. Version 2.8: 910717
  6380.  
  6381. COM-AND: IBM PC Communication Script Language                 Page 111
  6382.  
  6383.  
  6384. X.    Program Requirements
  6385.  
  6386.  
  6387.     This program will only function on an IBM PC or DOS compatible
  6388.     machine.  COM-AND does direct to screen buffer fetches and stores
  6389.     (unless BIOS screen updates are directed using the /C switch or the
  6390.     Alt-O options menu).
  6391.  
  6392.  
  6393.     COM-AND is TopView aware even without the /C switch or Alt-O option.
  6394.  
  6395.  
  6396.     COM-AND supports MDA, CGA, EGA and Hercules.  COM-AND uses a Micro-
  6397.     soft Mouse if one is available...
  6398.  
  6399.  
  6400.     COM-AND disk I/O is done through the 'Handle' oriented I/O routines
  6401.     added to DOS 2.0.  Therefore DOS 2.0 is a minimum requirement.
  6402.  
  6403.  
  6404.     COM-AND (Version 2.8) requires 256K for itself.  You need 384K
  6405.     minimally to use COM-AND and the DOS Gateway, and more to take
  6406.     advantage of accessories.
  6407.  
  6408.  
  6409.  
  6410.  
  6411.  
  6412.  
  6413.  
  6414.  
  6415.  
  6416.  
  6417.  
  6418.  
  6419.  
  6420.  
  6421.  
  6422.  
  6423.  
  6424.  
  6425.  
  6426.  
  6427.  
  6428.  
  6429.  
  6430.  
  6431.  
  6432.  
  6433.  
  6434. Version 2.8: 910717
  6435.  
  6436. COM-AND: IBM PC Communication Script Language                 Page 112
  6437.  
  6438.  
  6439. XI.    Program and Author Information
  6440.  
  6441.  
  6442.     This program was written using Microsoft Macro-Assembler.  The
  6443.     author likes assembler.  Assembly language is an entirely appro-
  6444.     priate vehicle for some of the program, and a not-inappropriate
  6445.     vehicle for the rest of it.  Everything, in moderation...
  6446.  
  6447.  
  6448.     COM-AND has been written by, and is supported by R. Scott McGinnis
  6449.     of Chicago (CABER Software), Illinois.    My PLINK and GEnie IDs are:
  6450.     TARTAN.  My CIS ID is 73147,2665.  Comment and suggestions (and
  6451.     criticism in moderation) are welcomed:
  6452.  
  6453.              CABER Software
  6454.              R. (Scott) McGinnis
  6455.              P.O. Box 3607 Mdse Mart
  6456.              Chicago, IL 60654-0607
  6457.  
  6458.  
  6459.  
  6460.     I must thank Mike Todd and John Poindexter of the Source for their
  6461.     strenuous testing and excellent suggestions.  Mike and John have
  6462.     pushed me hard, and I thank them.  This script language is in large
  6463.     part shaped by these gentlemen.
  6464.  
  6465.  
  6466.     I also thank my wife, Elizabeth, who supported me whole-heartedly
  6467.     in this effort.  She is my lady and my love.
  6468.  
  6469.  
  6470.     This program (Version 2.8) may be distributed freely along with its
  6471.     accessories with the caveat that the Author information displayed at
  6472.     program termination is not removed.  If the program is USED after a
  6473.     reasonable period of evaluation, a registration of $50.00 is
  6474.     required.
  6475.  
  6476.  
  6477.     PROCOMM, PCPLus, and ASPECT are trademarks of the DataStorm cor-
  6478.     poration.  DSZ is a trademark of OMEN Technology.  Windows is a
  6479.     trademark of the MicroSoft Corporation.  DesqView is a trademark
  6480.     of the QuarterDeck Corporation.  Smartmodem is a trademark of the
  6481.     Hayes Corporation.
  6482.  
  6483.  
  6484.  
  6485.  
  6486.  
  6487.  
  6488.  
  6489. Version 2.8: 910717
  6490.  
  6491. COM-AND: IBM PC Communication Script Language                 Page 113
  6492.  
  6493.  
  6494. A.    Example scripts
  6495.  
  6496.  
  6497.     A script to dial a modem direct, send two carriage returns, and
  6498.     wait for a logon prompt looks like:
  6499.  
  6500.     ------------------------------------------------------------------
  6501.     DEFTIME "60"            ; Wait 60 seconds for an incoming string
  6502.     IF NOT LINKED        ; If script not invoked from Alt-D
  6503.        MESSAGE "^GDialing direct"
  6504.        DIAL "1"             ; Call dial dir entry number 1 (PLINK)
  6505.        IF FAILED        ; IF esc out
  6506.           EXIT        ; terminate script
  6507.           ENDIF        ; End if failed
  6508.        ENDIF        ; End if not linked
  6509.  
  6510.     PAUSE "5"               ; Wait for the modem to settle down
  6511.     TRANSMIT "!"            ; Transmit Carriage return <CR>
  6512.     PAUSE "1"               ; Wait 1 sec
  6513.     TRANSMIT "!"            ; Transmit Carriage return <CR>
  6514.     WAITFOR "USER ID:"      ; Wait for the 'USER ID' prompt
  6515.  
  6516.     SET BSUPPRESS OFF    ; Turn off blank line suppression
  6517.     SET MASK ON        ; Turn on high bit mask
  6518.     SET CDISPLAY ON     ; Display control characters
  6519.     ALARM            ; Sound alarm:    we're done
  6520.     -------------------------------------------------------------------
  6521.  
  6522.  
  6523.  
  6524.  
  6525.  
  6526.  
  6527.  
  6528.  
  6529.  
  6530.  
  6531.  
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.  
  6542.  
  6543.  
  6544. Version 2.8: 910717                           Appendices
  6545.  
  6546. COM-AND: IBM PC Communication Script Language                 Page 114
  6547.  
  6548.  
  6549. A.    Example scripts (continued)
  6550.  
  6551.  
  6552.     A script to dial GEnie, and logon makes special provisions to turn
  6553.     echo off (mask it, anyway) during logon:
  6554.  
  6555.     ------------------------------------------------------------------
  6556.     DEFTIME "60"            ; Wait 60 seconds for an incoming string
  6557.     IF NOT LINKED        ; If not from Alt-d
  6558.        MESSAGE "^GDialing GEnie direct"
  6559.        DIAL "4"             ; Call dial dir entry number 4 (GEnie)
  6560.        IF FAILED        ; IF esc out
  6561.           EXIT        ; terminate script
  6562.           ENDIF        ; Endif failed
  6563.        ENDIF        ; End test if linked
  6564.  
  6565.     PAUSE "3"               ; Wait for the modem to settle down
  6566.     TRANSMIT "hhh"          ; Transmit
  6567.     WAITFOR "U#="           ; Wait for the 'USER ID' prompt
  6568.  
  6569.     SET BSUPPRESS ON    ; Turn on blank line suppression
  6570.     SET MASK ON        ; Turn on high bit mask
  6571.     SET CDISPLAY OFF    ; Control character display
  6572.     SET DUPLEX FULL     ; Turn off local echo for ID/psw
  6573.     ALARM            ; Sound alarm
  6574.  
  6575.     MESSAGE "^MEnter ID,password for GEnie:"
  6576.     MGET S0         ; Get ID/psw
  6577.     TRANSMIT S0        ; Transmit ID/psw
  6578.     TRANSMIT "^M"           ; .. and a final c/r
  6579.     SET DUPLEX HALF     ; Turn echo back on
  6580.     ------------------------------------------------------------------
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.  
  6597.  
  6598.  
  6599. Version 2.8: 910717                           Appendices
  6600.  
  6601. COM-AND: IBM PC Communication Script Language                 Page 115
  6602.  
  6603.  
  6604. A.    Example scripts (continued)
  6605.  
  6606.  
  6607.     A script to dial Telenet (entry number 10 in the dialing directory
  6608.     assumed, and make connection according to the parameters set
  6609.     looks like:
  6610.  
  6611.     ------------------------------------------------------------------
  6612.     LEGEND " Dialing Telenet... "
  6613.     DEFTIME "60"            ; Wait 60 seconds for an incoming string
  6614.     IF NOT LINKED        ; If script not invoked from Alt-D
  6615.        DIAL "10"            ; Call dial dir entry number 10 (Telenet)
  6616.        IF FAILED        ; IF esc out
  6617.           EXIT        ; terminate script
  6618.           ENDIF        ; End if failed
  6619.        ENDIF        ; End if not linked
  6620.  
  6621.     COMPARMS S1            ; Get current settings
  6622.     IF STRCMP "N" S1(5:5)           ; If no parity
  6623.        IF STRCMP "2400" S1(0:3)     ; If 2400 baud connect Send @D<cr>
  6624.           PAUSE 1            ;    Wait for the modem to settle
  6625.           TRANS "@"                 ;    Send @D<cr> slowly
  6626.           PAUSE 1            ;    Wait a moment
  6627.           TRANS "D"                 ;    Set to 8N1
  6628.           PAUSE 1            ;    Wait a moment
  6629.        ELSE             ; ELSE 300/1200 (send <cr>D<cr>)
  6630.           PAUSE "1"                 ;    Wait for the modem to settle
  6631.           TRANSMIT "!D"             ;    Transmit Carriage return <CR> D
  6632.           ENDIF
  6633.     ELSE                ; ELSE even or odd parity
  6634.        PAUSE "1"                    ;    Wait for the modem to settle
  6635.        TRANSMIT "!"                 ;    Transmit Carriage return <CR>
  6636.        ENDIF
  6637.     PAUSE "1"                       ; Wait 1 sec
  6638.     TRANSMIT "!"                    ; Transmit Carriage return <CR>
  6639.  
  6640.     WAITFOR "TERMINAL="     ; Wait for the prompt
  6641.     TRANSMIT "D1!"          ; Set terminal type
  6642.     WAITFOR "@"             ; Wait for next prompt
  6643.     SET BSUPPRESS OFF    ; Turn off blank line suppression
  6644.     SET MASK ON        ; Turn on high bit mask
  6645.     SET CDISPLAY ON     ; Display control characters
  6646.     ALARM            ; Sound alarm:    we're done
  6647.     ------------------------------------------------------------------
  6648.  
  6649.  
  6650.  
  6651.  
  6652.  
  6653.  
  6654. Version 2.8: 910717                           Appendices
  6655.  
  6656. COM-AND: IBM PC Communication Script Language                 Page 116
  6657.  
  6658.  
  6659. B.    HOST and BBS scripts
  6660.  
  6661.  
  6662.     Included with this release of COM-AND are two large scripts.  The
  6663.     HOST.CMD script supports a limited Host mode for callers to your PC;
  6664.     BBS.CMD supports a more extensive BBS function (with multiple users,
  6665.     mail, upload/download files, bulletins and so on).
  6666.  
  6667.  
  6668.     The advantage of a scripted HOST or BBS mode is flexibility.  You
  6669.     may use a script as supplied, or tailor it to your needs.  As the
  6670.     supplied scripts use a public domain graphic path display utility
  6671.     (TREED), you will want to remove the function (at least the prompt
  6672.     for it) if you don't have the program.  You may wish to add other
  6673.     functions.
  6674.  
  6675.  
  6676.     Documentation has been provided with each of the scripts.  For those
  6677.     interested in having a simple HOST mode, or a simple BBS, refer to
  6678.     the scripts archive (CAxx-3) included with this distribution.
  6679.  
  6680.  
  6681.     A version of the BBS script (constantly evolving) is maintained for
  6682.     COM-AND support and distribution by SupportWare in Long Beach, CA.
  6683.     SupportWare supports, markets and distributes COM-AND (among other
  6684.     products).  The version of this script used by SupportWare provides
  6685.     instant access, after BBS registration, and many more features.
  6686.  
  6687.  
  6688.     Mike Todd, the sysop of the BBS and President of SupportWare always
  6689.     has the most current release (or beta) of COM-AND available on that
  6690.     board.    Mike also makes the version of the BBS script he uses (con-
  6691.     siderably extended beyond the functions in this release) available
  6692.     as a SupportWare product.
  6693.  
  6694.     SupportWare may be contacted:  Voice:  (213) 439-6104
  6695.                        BBS:    (213) 439-7714 (1200/2400 8n1)
  6696.                        UNISON: MIKETODD (PARTI: Mike Todd)
  6697.                        Mail:   SupportWare
  6698.                            P.O.Box 14927
  6699.                            Long Beach CA, 90803-1449
  6700.  
  6701.  
  6702.     Mike is always in contact with the author of COM-AND and up-to-date
  6703.     on COM-AND developments.  Many innovations in the use of COM-AND and
  6704.     COM-AND scripts are available first through the SupportWare BBS (and
  6705.     are Mike's suggestions, embodied, t'boot).  Having read this far, the
  6706.     author recommends you call SupportWare!
  6707.  
  6708.  
  6709.  
  6710. Version 2.8: 910717                           Appendices
  6711.  
  6712. COM-AND: IBM PC Communication Script Language                 Page 117
  6713.  
  6714.  
  6715. C.    External protocol drivers
  6716.  
  6717.  
  6718.     COM-AND supports external protocol drivers through its F1 (acces-
  6719.     sories) menu.  You may edit the entries in the F1 menu to load and
  6720.     execute just about any program you might wish (and have memory for).
  6721.     If you limit the F1 entries to simple script invocations, you may
  6722.     also use the script name through F2.
  6723.  
  6724.  
  6725.     For example, you might wish to use a different implementation of
  6726.     ZMODEM than COM-AND's.  [COM-AND implements a complete ZMODEM.  How-
  6727.     ever, some of the management and transfer options are not available
  6728.     through COM-AND.] You might do this with Chuck Forsberg's DSZ.COM
  6729.     program, if you have registered it.  DSZ is a module that may be run
  6730.     from within other comm programs to perform ZMODEM transfers (and
  6731.     X/Ymodem transfers too).  DSZ is revised quite often (to expand its
  6732.     function), and is available on most systems.
  6733.  
  6734.  
  6735.     For downloading purposes, no script is needed to invoke DSZ.  How-
  6736.     ever, as mentioned above, the F1 entry will be coded to use a script
  6737.     to allow the same script to be manual invoked through F2.  The file
  6738.     name used for the downloaded file will be determined by the sender.
  6739.     Revise an F1 entry (with the 'r' subcommand) as follows:
  6740.  
  6741.         Name:        Download using YMODEM
  6742.         Subdirectory:    (whatever subdirectory your DSZ occupies)
  6743.         Program:        (leave this field blank)
  6744.         Script:        DSZDOWN.CMD
  6745.  
  6746.     The script DSZDOWN.CMD could be written:
  6747.     ------------------------------------------------------------------
  6748.     COMPARMS S1        ; read current settings
  6749.     S2 =  "DSZ.COM port " * S1(14:14) * " rb " ; Ask for YMODEM rcv
  6750.     RUN S2            ; Load and run DSZ
  6751.     ------------------------------------------------------------------
  6752.     Note: change " rb " to " rz " for ZMODEM
  6753.     ------------------------------------------------------------------
  6754.  
  6755.  
  6756.  
  6757.  
  6758.  
  6759.  
  6760.  
  6761.  
  6762.  
  6763.  
  6764.  
  6765. Version 2.8: 910717                           Appendices
  6766.  
  6767. COM-AND: IBM PC Communication Script Language                 Page 118
  6768.  
  6769.  
  6770. C.    External protocol drivers (continued)
  6771.  
  6772.  
  6773.     DSZ requires a file name for uploading.  You may accomplish this by
  6774.     editing the F1 menu as follows, and creating the following script
  6775.     to request a file name and load DSZ.
  6776.  
  6777.         Name:        Upload using YMODEM
  6778.         Subdirectory:    (whatever subdirectory DSZ/DSZUP occupies)
  6779.         Program:        (leave this field blank)
  6780.         Script:        DSZUP.CMD
  6781.  
  6782.  
  6783.     The script DSZUP.CMD could be written:
  6784.     ------------------------------------------------------------------
  6785.     MESSAGE "^MEnter the upload file name: "
  6786.     GET S0            ; Read keyboard
  6787.     COMPARMS S1        ; read current settings
  6788.     S2 =  "DSZ.COM port " * S1(14:14) * " sb " * S0 ; ask for YMODEM
  6789.     sb" RUN S2                  ; Load and run DSZ
  6790.     ------------------------------------------------------------------
  6791.     Note: change " sb " to " sz " for ZMODEM
  6792.     ------------------------------------------------------------------
  6793.  
  6794.  
  6795.     DSZ defaults to COM1 and your current baud rate.  The above scripts
  6796.     adjust for the comm port you're using.
  6797.  
  6798.  
  6799.     NOTE: DSZ is user supported.  If you use it, please register it!
  6800.     DSZ may be found on most bulletin boards, and on every major system.
  6801.     Registration information is provided with every release of DSZ.
  6802.  
  6803.  
  6804.     NOTE: More functional scripts for invocation of DSZ are included in
  6805.     the scripts arcive file released with COM-AND.    A pop-up window is
  6806.     used to query the file name, and so on.
  6807.  
  6808.  
  6809.  
  6810.  
  6811.  
  6812.  
  6813.  
  6814.  
  6815.  
  6816.  
  6817.  
  6818.  
  6819.  
  6820. Version 2.8: 910717                           Appendices
  6821.  
  6822. COM-AND: IBM PC Communication Script Language                 Page 119
  6823.  
  6824.  
  6825. D.    Encoded music
  6826.  
  6827.  
  6828.     Beginning with version 2.3, COM-AND uses encoded music strings for
  6829.     several different purposes:
  6830.  
  6831.     .  If the file COM-AND.TUN exists on the default drive:subdirectory
  6832.        (or on the COM-AND= drive:subdirectory), and it contains a valid
  6833.        encoded music string (not to exceed 40 notes), COM-AND will use
  6834.        the encoded string for its alarm.
  6835.  
  6836.     .  The alarm tune may be changed with a "SET TUNE" command through
  6837.        a script file.  The new alarm tune holds until it is changed,
  6838.        or until COM-AND is terminated.
  6839.  
  6840.     .  A script may PLAY an encoded music string during its execution
  6841.        (up to 80 notes).
  6842.  
  6843.     .  An escape sequence to play music has been implemented (for some
  6844.        RBBS boards).  The escape sequence is "ESC [M <music string> ^N"
  6845.        allowing up to 255 characters for the <music string>.
  6846.  
  6847.  
  6848.     Music strings are encoded using the BASICA 2.0 PLAY statement syntax.
  6849.     Commands are single characters, followed by one or more parameters.
  6850.     Blanks and commas are allowed for readability.    Case is not signifi-
  6851.     cant.  Commands are:
  6852.  
  6853.     .  A through G:  Play a note in the current octave
  6854.  
  6855.        A note command plays a note in the current octave.  It may be
  6856.        optionally followed by: (1) # (sharp), + (sharp), and - (flat),
  6857.        (2) a duration value (1 through 64, see "L" below),  and (3) one
  6858.        or more periods (dotting) extending the duration by 3/2.  If no
  6859.        duration number is specified the duration is the current default
  6860.        (set by "L", beginning at 4 with each string).  Example:
  6861.  
  6862.         A-16    A-flat in the current octave (sixteenth note)
  6863.  
  6864.        Blanks and commas ARE NOT allowed within the note declaration;
  6865.        e.g. no blank should occur between the command and a flat/sharp.
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.  
  6872.  
  6873.  
  6874.  
  6875. Version 2.8: 910717                           Appendices
  6876.  
  6877. COM-AND: IBM PC Communication Script Language                 Page 120
  6878.  
  6879.  
  6880. D.    Encoded music (continued)
  6881.  
  6882.  
  6883.     .  O #        Set the current octave
  6884.  
  6885.        There are 7 octaves, numbered 0 through 6.  Middle-C begins octave
  6886.        number 3.  Each string defaults at the start to octave number 4.
  6887.  
  6888.     .  >        Raise the octave by 1
  6889.  
  6890.        The current octave is raised with this command.
  6891.  
  6892.     .  <        Lower the octave by 1
  6893.  
  6894.        The current octave is lowered with this command.
  6895.  
  6896.     .  N #        Play note number 0-84
  6897.  
  6898.        Each octave contains 12 notes (C,C#/D-,D,D#/E-, etc).  Notes are
  6899.        numbered from the 0th octave beginning with 1.  0 is a rest.
  6900.        Note numbers may be followed by duration (blank separated from
  6901.        the note number) and dotting as in the note command.  Example:
  6902.  
  6903.         N36 4.    Middle-C, 3/8ths (dotted quarter)
  6904.  
  6905.     .  L #        Set default duration for following notes
  6906.  
  6907.        The duration of a note is specified as a number, 1 through 64.
  6908.        L1 is a whole note, L2 is a half note, L3 is a triplet, L4 is
  6909.        a quarter note, and so on.  The actual duration (in time) for
  6910.        notes is set through the T (Tempo) command, below.
  6911.  
  6912.     .  P        Pause (rest)
  6913.  
  6914.        Rests may be encoded, using this command with duration and
  6915.        dotting as with the note command.  Example:
  6916.  
  6917.         P1.    Pause for a whole and a half
  6918.  
  6919.     .  T #        Tempo (number of quarter notes per minute)
  6920.  
  6921.        Tempo is specified as a count of quarter notes per minute.  The
  6922.        tempo is allowed to range between 32 and 255, defaulting to 120.
  6923.  
  6924.  
  6925.  
  6926.  
  6927.  
  6928.  
  6929.  
  6930. Version 2.8: 910717                           Appendices
  6931.  
  6932. COM-AND: IBM PC Communication Script Language                 Page 121
  6933.  
  6934.  
  6935. D.    Encoded music (continued)
  6936.  
  6937.  
  6938.     .  MN        Normal
  6939.  
  6940.        Each note plays 7/8ths of the time specified (1/8th silence).
  6941.  
  6942.     .  MS        Staccato
  6943.  
  6944.        Each note plays 3/4s of the time specified (1/4 period silence).
  6945.  
  6946.     .  ML        Legato
  6947.  
  6948.        Each note plays the full period specified.
  6949.  
  6950.  
  6951.     Each encoded music string is an entity itself.    Defaults are reset
  6952.     at the beginning of each string.  Defaults are: T120,O4,L4,MN
  6953.     For example, the DRAGNET "dum-dee-dum dum" might be played:
  6954.  
  6955.         PLAY "ms t250 o2 c2d8e-cp4g-1 p2 >c2d8e-cp4g-1 p2"
  6956.  
  6957.  
  6958.  
  6959.  
  6960.  
  6961.  
  6962.  
  6963.  
  6964.  
  6965.  
  6966.  
  6967.  
  6968.  
  6969.  
  6970.  
  6971.  
  6972.  
  6973.  
  6974.  
  6975.  
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985. Version 2.8: 910717                           Appendices
  6986.  
  6987. COM-AND: IBM PC Communication Script Language                 Page 122
  6988.  
  6989.  
  6990. E.    File transfer error numbers
  6991.  
  6992.  
  6993.     COM-AND reports file transfer errors with a number and an explanation
  6994.     on the screen.    When an error is logged to the call-log, however,
  6995.     COM-AND only logs a number.  Error numbers are:
  6996.  
  6997.     DOS errors:
  6998.  
  6999.      1  Invalid function number (from INT 21H)
  7000.      2  File not found
  7001.      3  Path not found
  7002.      4  Too many open files (no handles left)
  7003.      5  Access denied
  7004.      6  Invalid Handle
  7005.      7  Memory control blocks destroyed
  7006.      8  Insufficient memory
  7007.      9  Invalid Memory block address
  7008.     10  Invalid environment
  7009.     11  Invalid format
  7010.     12  Invalid access code
  7011.     13  Invalid data
  7012.     14  Short write.  Disc Full?  Error # generated here
  7013.     15  Invalid drive was specified
  7014.     16  Attempted to remove current directory
  7015.     17  Not same device
  7016.     18  No more files
  7017.  
  7018.  
  7019.  
  7020.  
  7021.  
  7022.  
  7023.  
  7024.  
  7025.  
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.  
  7040. Version 2.8: 910717                           Appendices
  7041.  
  7042. COM-AND: IBM PC Communication Script Language                 Page 123
  7043.  
  7044.  
  7045. E.    File transfer error numbers (continued)
  7046.  
  7047.  
  7048.     Program errors (internally generated):
  7049.  
  7050.      1  Other side cancelled        ; All protocols
  7051.      2  Handshake failed            ; ..
  7052.      3  Block sequence error        ; ..
  7053.      4  Complement error            ; ..
  7054.      5  Checksum mismatch            ; ..
  7055.      6  CRC mismatch            ; ..
  7056.      7  Short block received        ; ..
  7057.      8  We cancelled            ; ..
  7058.      9  NAK rcvd/xmitted - retrying     ; ..
  7059.     10  Timeout                ; ..
  7060.     11  Cancelled by operator        ; ..
  7061.     12  Timeout waiting for rcvr ACK    ; ..
  7062.     13  ENQ received during block        ; CISB
  7063.     14  Unrecognized command received    ; All protocols
  7064.     15  ETX received            ; ..
  7065.     16  Buffer overflow            ; ..
  7066.     17  Wait ACK received from CIS        ; ..
  7067.     18  Send initiate received        ; Kermit
  7068.     19  File Header received        ; All protocols
  7069.     20  Send-initiate sent            ; ..
  7070.     21  End-of-transfer sent        ; ..
  7071.     22  Other side not using batch        ; Batch-Ymodem
  7072.     23  File name not received        ; All protocols
  7073.     24  Negotiation packet received     ; CIS Quick-B
  7074.     25  Application inquiry packet received ; CIS Quick-B
  7075.     26  Insufficent space for rcv        ; KERMIT/Batch YMODEM
  7076.     27  Carrier has been dropped        ; All protocols
  7077.     28  ZMODEM frame end            ; ZMODEM (internal error)
  7078.     29  ZMODEM encryption requested     ; ZMODEM
  7079.     30  ZMODEM file skipped         ; ZMODEM
  7080.     31  ZMODEM waiting recovery        ; ZMODEM (internal error)
  7081.  
  7082.  
  7083.  
  7084.  
  7085.  
  7086.  
  7087.  
  7088.  
  7089.  
  7090.  
  7091.  
  7092.  
  7093.  
  7094.  
  7095. Version 2.8: 910717                           Appendices
  7096.  
  7097. COM-AND: IBM PC Communication Script Language                 Page 124
  7098.  
  7099.  
  7100. F.    EBL (Extended Batch Language)
  7101.  
  7102.  
  7103.     Extended Batch Language (EBL) is a command programming language that
  7104.     may be used as a direct replacement of DOS batch files.  It may also
  7105.     be used in conjunction with DOS batch files.
  7106.  
  7107.  
  7108.     A superb example of EBL's power may be seen in the system SIGCOM,
  7109.     which is a communications system for use in the IBMSIG on UNISON
  7110.     (originally created for The SOURCE).  SIGCOM uses EBL to integrate
  7111.     COM-AND with the editor EDWIN and Vern Buerg's LIST.
  7112.  
  7113.  
  7114.     One of the unique features of EBL is its global variables ( %A..%O ).
  7115.     String or numerical values may be assigned to the global variables
  7116.     through EBL batch files.  Once a value is assigned to one of these 15
  7117.     variables it is accessible to other EBL files until it is re-
  7118.     assigned.  This is a powerful feature which allows the passing of
  7119.     parameters from one EBL file to another.  COM-AND makes these global
  7120.     variables available for use in script files through its EBL script
  7121.     command.  The global variables are much more useful than variables in
  7122.     the DOS environment since the global variables are not dependent on
  7123.     whether they are assigned in a child or parent process.
  7124.  
  7125.  
  7126.     Global variables may be set by an EBL file run through COM-AND and
  7127.     then be available to other EBL files run through other COM-AND script
  7128.     files, or run from DOS after exiting COM-AND.  This is not true of
  7129.     normal DOS environment variables.  In a multi-tasking environment
  7130.     such as DESQview each window has its own DOS environment and there is
  7131.     no convenient way to pass DOS environment variables from one window
  7132.     to another.  With the COM-AND EBL command the capability exists to
  7133.     pass data from one window to COM-AND in another window through the
  7134.     EBL global variables.
  7135.  
  7136.  
  7137.     Extended Batch Language may be obtained from SEAWARE Corporation,
  7138.     P.O.  Box 1656, Delray Beach, FL 33444, 800-634-8188 or 407-392-2046.
  7139.     Registration fee is $49.  Extended Batch Language is copyrighted by
  7140.     Seaware Corp.  1982,83,84,85,86,87.
  7141.  
  7142.  
  7143.     The latest version of SIGCOM, the communication system for using the
  7144.     features of UNISON and the IBM Special Interest Group (IBMSIG), is
  7145.     always available from Mike Todd on UNISON via the ID MIKETODD or the
  7146.     IBMSIG EXCHANGE topics in PARTI for details on downloading or having
  7147.     diskettes mailed to your door.
  7148.  
  7149.  
  7150. Version 2.8: 910717                           Appendices
  7151.  
  7152. COM-AND: IBM PC Communication Script Language                 Page 125
  7153.  
  7154.  
  7155. G.    Manual settings and scripts
  7156.  
  7157.  
  7158.     1. Alt-S (Setup window)
  7159.  
  7160.        1)  Modem init string       SET MINIt <str>           _MINI
  7161.        2)  Modem dial prefix       SET DPREfix <str>           _DPRE
  7162.        3)  Modem dial suffix       SET DSUFfix <str>           _DSUF
  7163.        4)  Hang-up string           SET MHANg <str>           _MHAN
  7164.        5)  Escape string           SET MESCape <str>           _MESC
  7165.        6)  Connect string           SET MCONnect <str>           _MESC
  7166.        7)  Call log file           CLOG OPEN <str>           _CLFI
  7167.        8)  Dialing directory       DLOAD <str>               _DIRF
  7168.        9)  Macro directory           MLOAD <str>               _MACF
  7169.        10) RLE temp file           -----               -----
  7170.        11) Accessory direc           ALOAD <str>               _ACCF
  7171.        12) Backscreen Buffer       SET BKSC #               _BKSC
  7172.        13) Break delay           SET BREAK #               _BREA
  7173.        14) Alarm duration           SET ATIME #               _ATIM
  7174.        15) Modem character delay       SET MDELay #            _MDEL
  7175.        16) Reconnect delay           SET RDELay #            _RDEL
  7176.        17) Chat window size        SET CHLInes #           _CHLI
  7177.        18) Mouse vertical           SET VMOUse #            _VMOU
  7178.        19) Mouse horizontal        SET HMOUse #            _HMOU
  7179.        20) Mouse dbl click interval    SET DBLCLICK #           _DBLC
  7180.        21) Bell tone           SET BELL #               _BELL
  7181.        22) Modem delay character       SET MDCHAR #            _MDCH
  7182.        23) Xfer screen upd           SET XSUI #               _XSUI
  7183.  
  7184.        24) Save these values       UPDATE (*)               RESET
  7185.  
  7186.  
  7187.        (*) Note: UPDATE and RESET do not apply to these settings alone.
  7188.            Both commands (UPDATE and RESET) apply to ALL Alt-S, Alt-O,
  7189.            Alt-P, Alt-K, Alt-J settings.  RESET further closes and re-
  7190.            opens the comm port.
  7191.  
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.  
  7198.  
  7199.  
  7200.  
  7201.  
  7202.  
  7203.  
  7204.  
  7205. Version 2.8: 910717                           Appendices
  7206.  
  7207. COM-AND: IBM PC Communication Script Language                 Page 126
  7208.  
  7209.  
  7210. G.    Manual settings and scripts (continued)
  7211.  
  7212.  
  7213.     2. Alt-O (Options window)
  7214.  
  7215.        1)  Echo received characters    SET DUPLEX HALF!FULL        _DUPL
  7216.        2)  Mask received characters    SET MASK ON!OFF           _MASK
  7217.        3)  Keyboard display        SET KBDBuf ON!OFF           _KBDB
  7218.        4)  Chat mode           SET CHAT ON!OFF           _CHAT
  7219.        5)  Suppress blank lines       SET BSUPpress ON!OFF        _BSUP
  7220.        6)  Alarm noise           SET ALARM ON!OFF           _ALAR
  7221.        7)  Exit query (Alt-X)       SET EXQUery ON!OFF           _EXQU
  7222.        8)  Mark transcript           LOG MARKED ON!OFF           _LOGM
  7223.        9)  Initial advertisement       SET ADVERT ON!OFF           _ADVE
  7224.        10) Use BIOS for screen saves   SET SWRITE BIOS!DIRECT      _SWRI
  7225.        11) Use DOS for screen writes   SET SWRITE DOS!BIOS!DIRECT  _SWRI
  7226.        12) Display control characters  SET CDISPlay ON!OFF           _CDIS
  7227.        13) Software flowctl (XON/XOFF) SET FLOW ON!OFF           _FLOW
  7228.        14) Unidirectional hdwe flowctl SET HARD ON!OFF           _HARD
  7229.        15) Bidirectional hdwe flow ctl SET RTSF ON!OFF           _RTSF
  7230.        16) Drop DTR to hangup       SET DROP ON!OFF           _DROP
  7231.        17) Init modem after hangup       SET INAF ON!OFF           _INAF
  7232.        18) Translate (in and out)       SET TRANslate ON!OFF        _TRAN
  7233.        19) Keyboard remapping       SET REMAP ON!OFF           _REMA
  7234.        20) Nondestructive bksp       SET BACK IN (NOND!DEST)     _BSIN
  7235.        21) Send DELETE as bksp       SET BACK OUT (BACK!DELE)    _BSOU
  7236.        22) CR -> CRLF in display       SET CR CR!CRLF           _CRLF
  7237.        23) Call logging on           SET CLOG ON!OFF           _CLOG
  7238.        24) On screen clock           SET CLOCK ON!OFF           _CLOC
  7239.        25) Suppress bells           SET QUIET ON!OFF           _QUIE
  7240.        26) Menu mode           SET MENUMODE ON!OFF           _MENU
  7241.        27) Respect modem CD        SET CDRESpect ON!OFF        _CDRE
  7242.        28) PCJr (disc suspends comm)   SET PCJR ON!OFF           _PCJR
  7243.        29) Capture/display RLE files   SET RLEOk ON!OFF           _RLEO
  7244.        30) Allow MUSIC strings       SET MUSIC ON!OFF           _MUSI
  7245.        31) Allow REMOTE commands       SET REMOTE ON!OFF           _REMO
  7246.        32) Set slow xfer output       SET SLOW ON!OFF           _SLOW
  7247.        33) Auto ZMODEM download       SET ZMODEM AUTO ON!OFF      _ZAUT
  7248.        34) ZMODEM download recovery    SET ZMODEM RECOVER ON!OFF   _ZREC
  7249.  
  7250.        33) Save these values       UPDATE (*)               RESET
  7251.  
  7252.  
  7253.        (*) Note: UPDATE and RESET do not apply to these settings alone.
  7254.            Both commands (UPDATE and RESET) apply to ALL Alt-S, Alt-O,
  7255.            Alt-P, Alt-K, Alt-J settings.  RESET further closes and re-
  7256.            opens the comm port.
  7257.  
  7258.  
  7259.  
  7260. Version 2.8: 910717                           Appendices
  7261.  
  7262. COM-AND: IBM PC Communication Script Language                 Page 127
  7263.  
  7264.  
  7265. G.    Manual settings and scripts (continued)
  7266.  
  7267.  
  7268.     3. Alt-P (Parameters window)
  7269.  
  7270.        1)     300,E,7,1           SET BAUDRATE 300, +below    _PARM
  7271.        2)    1200,E,7,1           SET BAUDRATE 1200,+below     "
  7272.        3)    2400,E,7,1           SET BAUDRATE 2400,+below     "
  7273.        4)    4800,E,7,1           SET BAUDRATE 4800,+below     "
  7274.        5)    9600,E,7,1           SET BAUDRATE 9600,+below     "
  7275.        6)  19200,E,7,1           SET BAUDRATE 19K, +below     "
  7276.        ..    ..               ..                 "
  7277.        10)     300,N,8,1           SET BAUDRATE 300, +below     "
  7278.        11)    1200,N,8,1           SET BAUDRATE 1200,+below     "
  7279.        12)    2400,N,8,1           SET BAUDRATE 2400,+below     "
  7280.        13)    4800,N,8,1           SET BAUDRATE 4800,+below     "
  7281.        14)    9600,N,8,1           SET BAUDRATE 9600,+below     "
  7282.        15) 19200,N,8,1           SET BAUDRATE 19K, +below     "
  7283.        ..    ..               ..                 "
  7284.        19) EVEN               SET PARITY EVEN         "
  7285.        20) ODD               SET PARITY ODD         "
  7286.        21) NONE               SET PARITY NONE         "
  7287.        22) 7 bits               SET DATABITS 7         "
  7288.        23) 8 bits               SET DATABITS 8         "
  7289.        24) 1 bit               SET STOPBITS 1         "
  7290.        25) 2 bits               SET STOPBITS 2         "
  7291.        26) COM1               SET PORT COM1         "
  7292.        27) COM2               SET PORT COM2         "
  7293.        28) COM3               SET PORT COM3         "
  7294.        29) COM4               SET PORT COM4         "
  7295.        30) Set base/IRQ           SET COMBASE;    COMBASE <port> Nx
  7296.                        SET COMVECT;    COMVEC  <port> Nx
  7297.        31) Save               UPDATE (*, see Alt-S)       RESET
  7298.  
  7299.  
  7300.  
  7301.  
  7302.  
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.  
  7314.  
  7315. Version 2.8: 910717                           Appendices
  7316.  
  7317. COM-AND: IBM PC Communication Script Language                 Page 128
  7318.  
  7319.  
  7320. G.    Manual settings and scripts (continued)
  7321.  
  7322.  
  7323.     4. Alt-K (KERMIT defaults window)
  7324.  
  7325.        1)  Mark character           SET KERMIT MARK #           _KMAR
  7326.        2)  Number of pads           SET KERMIT PADNUM #           _KNUM
  7327.        3)  Pad character           SET KERMIT PADCHAR #        _KPAD
  7328.        4)  Packet terminator       SET KERMIT EOLCHAR #        _KEOL
  7329.        5)  Control quote           SET KERMIT CQUOTE #           _KCQU
  7330.        6)  Binary quote           SET KERMIT 8QUOTE #           _K8QU
  7331.        7)  Check field len           SET KERMIT BLOCKCHECK 1!2!3 _KCHK
  7332.        8)  Compression flag        SET KERMIT REPEAT #           _KREP
  7333.        9)  Max window size           SET KERMIT WINDOW #           _KWIN
  7334.  
  7335.        10) Reset to default values       -----
  7336.        11) Save current values       UPDATE  (*, see Alt-S)      RESET
  7337.  
  7338.  
  7339.     5. Alt-J (Colors window)
  7340.  
  7341.        1)  Color               SET COLOR ON!OFF           _COLO
  7342.        2)  Text foreground           COLOR <attr>, SET TEXT      _TEXT
  7343.        3)  Text background           "             "               "
  7344.        4)  Menu foreground           SET DEFAULT <attr>           _DEFA
  7345.        5)  Menu background           "                             "
  7346.        6)  Screen bar foreground       SET BAR <attr>           _BAR
  7347.        7)  Screen bar background       "                             "
  7348.  
  7349.        8)  Save these values       UPDATE (*, see Alt-S)       RESET
  7350.  
  7351.  
  7352.  
  7353.  
  7354.  
  7355.  
  7356.  
  7357.  
  7358.  
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370. Version 2.8: 910717                           Appendices
  7371.  
  7372. COM-AND: IBM PC Communication Script Language                 Page 129
  7373.  
  7374.  
  7375. G.    Manual settings and scripts (continued)
  7376.  
  7377.  
  7378.     6. Help (General help list)
  7379.  
  7380.  
  7381.        F1        Accessories         ACCESSORY #
  7382.        F2        Perform script         EXECUTE <string>
  7383.        F3        Current d:subdir     CHDIR <string>
  7384.        F4        DLoad d:subdir         SET DLDIR <string> (26 chars)
  7385.        F5        ASCII Upload         SENDFILE ASCII <name>
  7386.        F6        ASCII Download         GETFILE ASCII <name>
  7387.        F7        Toggle disc log      LOG OPEN <str>,LOG CLOSE
  7388.        F8        Toggle KBD disp      SET KBDBuf ON!OFF
  7389.        F9        Toggle log hold      LOG SUSPEND, LOG RESUME
  7390.        F10        This screen         HELP
  7391.        PgUp     Upload a file         SENDFILE <method> ...
  7392.        PgDn     Download a file      GETFILE <method> ...
  7393.        Alt-0/9    Execute a macro      MACRO #
  7394.        Alt-F10    DOS Gateway         SHELL
  7395.        Alt-hyphen    Remote function keys SET REMFTN ON!OFF
  7396.        Alt-equal    Menu mode         SET MENU ON!OFF
  7397.        Ctrl-End    Break             BREAK [#]
  7398.        Ctrl-PrtSc    Toggle printer         SET PRINTER ON!OFF
  7399.        Alt-A    Toggle Chat mode     SET CHAT ON!OFF
  7400.        Alt-B    Redisplay         -----
  7401.        Alt-C    Clear screen         CLEAR <attr>
  7402.        Alt-D    Dial             DIAL #
  7403.        Alt-E    Toggle echo         SET DUPLEX FULL!HALF
  7404.        Alt-F    File directory         DIR
  7405.        Alt-G    Toggle blank-lines   SET BSUP ON!OFF
  7406.        Alt-H    Hang up          HANGUP
  7407.        Alt-I    Program info         VERSION Sx
  7408.        Alt-J    Set screen colors    above
  7409.        Alt-K    Set KERMIT parms     above
  7410.        Alt-L    Toggle 25/43 lines   SET 25, SET 43
  7411.        Alt-M    Define a macro         SET MACRO # <string>
  7412.        Alt-N    Encrypt/Decrypt      ENCRYPT ..., DECRYPT ...
  7413.        Alt-O    Set options         above
  7414.        Alt-P    Set comm params      above
  7415.        Alt-R    Redial last number   DIAL
  7416.        Alt-S    Initial values         above
  7417.        Alt-T    Time(s) and alarm    SET ALARM
  7418.        Alt-U    Annotate call log    CLOG <string>
  7419.        Alt-V    Emulation         EMULATE <method>
  7420.        Alt-W    Playback         TYPE <string>
  7421.        Alt-X    Terminate program    BYE
  7422.        Alt-Z    Toggle 7bit mask     SET MASK ON!OFF
  7423.  
  7424.  
  7425. Version 2.8: 910717                           Appendices
  7426.  
  7427. COM-AND: IBM PC Communication Script Language                 Page 130
  7428.  
  7429.  
  7430. H.    STACK and Macro keycodes
  7431.  
  7432.  
  7433.     COM-AND application keystrokes may be created in a script itself.
  7434.     The script must (1) turn off the keyboard, (2) stack the keystrokes
  7435.     and (3) terminate the script.  For example, making a script:
  7436.  
  7437.          SET TTHRU OFF        ; Turn off keyboard
  7438.          STACK "^@<SOURCE!"         ; Stack command to invoke F2
  7439.          EXIT            ; Terminate script to execute
  7440.  
  7441.     actually invokes the F2 (execute script) window, and passes the
  7442.     name "SOURCE" with a terminating carriage return to the F2 window.
  7443.     The ^@ indicates that the following character is to be interpreted
  7444.     as an 'extended keystroke', i.e. not-ASCII.  The extended
  7445.     character set is:
  7446.  
  7447.     Macro seq    Key     Macro seq      Key         Macro seq      Key
  7448.     ---------    ---     ---------    -----         ---------    -----
  7449.     ^@;          F1     ^@^^    Alt-A         ^@1    Alt-N
  7450.     ^@<          F2     ^@1    Alt-B         ^@^X    Alt-O
  7451.     ^@=          F3     ^@.    Alt-C         ^@^Y    Alt-P
  7452.     ^@>          F4     ^@ (space) Alt-D         ^@^P    Alt-Q
  7453.     ^@?          F5     ^@^R    Alt-E         ^@^S    Alt-R
  7454.     ^@@          F6     ^@!    Alt-F         ^@^_    Alt-S
  7455.     ^@A          F7     ^@"        Alt-G        ^@^T       Alt-T
  7456.     ^@B          F8     ^@#    Alt-H         ^@^V    Alt-U
  7457.     ^@C          F9     ^@^W    Alt-I         ^@/    Alt-V
  7458.     ^@D         F10     ^@$    Alt-J         ^@^Q    Alt-W
  7459.     ^@I        PgUp     ^@%    Alt-K         ^@-    Alt-X
  7460.     ^@Q        PgDn     ^@&    Alt-L         ^@^U    Alt-Y
  7461.     ^@u     Ctl-End     ^@2    Alt-M         ^@,    Alt-Z
  7462.  
  7463.     Note, too, that Alt-A (requiring "^^") is unprogrammable.  It may
  7464.     be entered as decimal 30 (use Alt and numeric pad keys).
  7465.  
  7466.  
  7467.     In the above example, the F2 key was represented by "^@<".  When the
  7468.     F2 key is pressed a window is opened and a search for all files *.CMD
  7469.     and *.ENF takes place.    In simpler terms, pressing the F2 key takes
  7470.     TIME.  COM-AND defines the ASCII value 255 as a short cut to execute
  7471.     a script.  The macro:  " SOURCE!" has the same effect, and doesn't
  7472.     open the script window.  If the first character following the 255 is
  7473.     ".", the text will be executed as a single script command.  Other-
  7474.     wise, the text is interpreted as a script file name to be executed.
  7475.  
  7476.  
  7477.  
  7478.  
  7479.  
  7480. Version 2.8: 910717                           Appendices
  7481.  
  7482. COM-AND: IBM PC Communication Script Language                 Page 131
  7483.  
  7484.  
  7485. I.    Dynamic String Variables
  7486.  
  7487.  
  7488.     With version 2.6, script authors may now ALLOCATE string variables
  7489.     in addition to the 30 static string variables always available.  The
  7490.     variables are used as V0,V1,...  and may be used in any statement now
  7491.     now supporting static string variables (S0,S1...).  There are a few
  7492.     differences, however.
  7493.  
  7494.     o    Allocated variables must be ALLOCATEd before they are used,
  7495.         once in a COM-AND session.  They do NOT necessarily need to
  7496.         be ALLOCATEd in the script that invokes them, however.
  7497.     o    Allocated variables are NOT deallocated when a script ends.
  7498.     o    Allocated variables are NOT cleared when a script terminates.
  7499.         One script may set values and a second may read them.
  7500.     o    Allocated variables ARE deallocated when COM-AND terminates.
  7501.  
  7502.  
  7503.     Dynamic variables are allocated from free memory, over and above the
  7504.     memory used by COM-AND normally.  Therefore, not all PC installations
  7505.     will allow dynamic allocation.    The ALLOCATE and LOAD ALLOCAT state-
  7506.     ments return SUCCESS/FAIL according to the result of the operation.
  7507.     A script author should only ALLOCATE as many variables (limited to
  7508.     100 max) as absolutely needed.
  7509.  
  7510.  
  7511.     Some large script systems will ALLOCATE variables and expect the area
  7512.     to be available during an entire COM-AND session.  Other scripts will
  7513.     have need for extended variables, but only during the single script's
  7514.     execution.  In a one-time case, the following is suggested:
  7515.  
  7516.     On initialization:
  7517.  
  7518.     DELETE "Script.dat"             ; Delete this script's save file
  7519.     STORE ALLOC "Script.dat"        ; Save current allocation, if any
  7520.     ALLOCATE <number>        ; Deallocate and allocate anew
  7521.     IF FAILED            ; If allocation failed
  7522.        MESS "Cannot allocate memory for variables"
  7523.        ...
  7524.        ENDIF
  7525.  
  7526.     On termination:
  7527.  
  7528.     DEALLOCATE            ; Clear our allocation
  7529.     IF ISFILE "Script.dat"          ; If something previously allocated
  7530.        LOAD ALLOCATED "Script.dat"
  7531.        DELETE "Script.dat"          ; Delete same file
  7532.        ENDIF
  7533.  
  7534.  
  7535. Version 2.8: 910717                           Appendices
  7536.  
  7537. COM-AND: IBM PC Communication Script Language                 Page 132
  7538.  
  7539.  
  7540. I.    Dynamic String Variables (continued)
  7541.  
  7542.  
  7543.     For the author preparing a suite of scripts expecting dynamic
  7544.     variables to be prepared prior to any one script's execution, it is
  7545.     suggested that one dynamic variable (say V0) contain a string that
  7546.     identifies the script-set.  Each script of the suite expecting the
  7547.     prepared area might then execute the following as it begins:
  7548.  
  7549.     IF NOT ALLOCATED        ; Somebody dealloc'd us
  7550.        LOAD ALLOC "Suite.dat"       ; Retrieve values from disc
  7551.        IF FAILED GOTO AllocErr    ; LOAD failed for some reason
  7552.        ENDIF
  7553.  
  7554.     IF NOT STRCMP V0 "My very own"
  7555.        LOAD ALLOC "Suite.dat"       ; Retrieve values from disc
  7556.        IF FAILED GOTO AllocErr    ; LOAD failed for some reason
  7557.        ENDIF
  7558.  
  7559.     ...                ; OK to proceed
  7560.  
  7561.  
  7562.     For this technique to be effective, the file containing dynamic
  7563.     variables must be updated by individual scripts as they exit.
  7564.  
  7565.  
  7566.     -------------------------------------------------------------------
  7567.     Note that the test for an allocated area is performed here BEFORE a
  7568.     dynamic variable (V0) is referenced.  The dynamic variables are valid
  7569.     syntactically ONLY when an area is allocated.  Because the interpre-
  7570.     tor evaluates ALL components of a condition, the following syntax,
  7571.     therefore, generates a syntax error when no area is allocated:
  7572.  
  7573.     IF NOT ALLOCATED or NOT STRCMP V0 "My very own"
  7574.        LOAD ALLOC "Suite.dat"       ; Retrieve values from disc
  7575.        IF FAILED GOTO AllocErr    ; LOAD failed for some reason
  7576.        ENDIF
  7577.  
  7578.  
  7579.     When "NOT ALLOCATED" is true, "NOT STRCMP V0 ..." is still executed.
  7580.     The reference to V0 in this case would therefore be a syntax error.
  7581.  
  7582.  
  7583.  
  7584.  
  7585.  
  7586.  
  7587.  
  7588.  
  7589.  
  7590. Version 2.8: 910717                           Appendices
  7591.  
  7592. COM-AND: IBM PC Communication Script Language                 Page 133
  7593.  
  7594.  
  7595. J.    Flow control methods
  7596.  
  7597.  
  7598.     Some variations on flow control are available through COM-AND.    The
  7599.     discussion here centers on the script commands controlling flow con-
  7600.     trol...  Note SOFT, HARD, and RTSF flow control default conditions
  7601.     may be set through Alt-O... whereas RTSD discipline is script-only.
  7602.  
  7603.  
  7604.     1) XON/XOFF flow control:
  7605.  
  7606.        SET SOFTFLOW ON
  7607.        SET HARDFLOW OFF        ; Default condition
  7608.        SET RTSDISCIPLINE ON     ; Default condition
  7609.        SET RTSFLOW OFF        ; Default condition
  7610.  
  7611.        This is the one everyone understands.  XOFFs are sent to tell the
  7612.        opposite side "whoa", and XON sent to say "have at it".
  7613.  
  7614.  
  7615.     2) Hardware flow control (unidirectional):
  7616.  
  7617.        SET SOFTFLOW OFF        ; Default condition
  7618.        SET HARDFLOW ON
  7619.        SET RTSDISCIPLINE ON     ; Default condition
  7620.        SET RTSFLOW OFF        ; Default condition
  7621.  
  7622.        This is the RS232 standard: COM-AND raises RTS before sending a
  7623.        character, and waits for the modem to raise CTS.  No provision is
  7624.        made for COM-AND to tell the modem "gimme a break, man".
  7625.  
  7626.  
  7627.     3) Hardware flow control (modified unidirectional):
  7628.  
  7629.        SET SOFTFLOW OFF        ; Default condition
  7630.        SET HARDFLOW ON
  7631.        SET RTSDISCIPLINE OFF
  7632.        SET RTSFLOW OFF        ; Default condition
  7633.        SET RTS ...            ; As needed, dynamically
  7634.  
  7635.        This is a curiosity implemented for some interesting devices that
  7636.        will not be discussed here.    This setting waits for CTS from the
  7637.        modem before sending, but gives control over RTS to a script.
  7638.  
  7639.  
  7640.  
  7641.  
  7642.  
  7643.  
  7644.  
  7645. Version 2.8: 910717                           Appendices
  7646.  
  7647. COM-AND: IBM PC Communication Script Language                 Page 134
  7648.  
  7649.  
  7650. J.    Flow control methods (continued)
  7651.  
  7652.  
  7653.     4) Hardware flow control (bidirectional):
  7654.  
  7655.        SET SOFTFLOW OFF        ; Default condition
  7656.        SET HARDFLOW OFF        ; Default condition
  7657.        SET RTSDISCIPLINE ON     ; Default condition
  7658.        SET RTSFLOW ON
  7659.  
  7660.        This is a bidirectional version of hardware flow control.  COM-AND
  7661.        waits for CTS before sending.  COM-AND raises and lowers RTS to
  7662.        signal its own buffer full conditions to the modem.
  7663.  
  7664.  
  7665.     5) Software AND hardware flow control (uni/bidirectional):
  7666.  
  7667.        SET SOFTFLOW ON
  7668.        SET HARDFLOW ON        ; RTSF overrides if RTSF ON
  7669.        SET RTSDISCIPLINE ON     ; Default condition
  7670.        SET RTSFLOW ...        ; ON or OFF (bi/unidirectional)
  7671.  
  7672.        Soft and Hard flow control (hardware flow control being either
  7673.        uni- or bidirectional) may be selected.  In most cases this is
  7674.        the desired setting when the modem requires a hard flow control,
  7675.        and the protocol/carrier requires a soft flow control.
  7676.  
  7677.  
  7678.     The following modems require bidirectional hardware flow control:
  7679.  
  7680.         MultiTech "Multimodem V.32" (possibly all MultiTechs that support
  7681.         PC to modem interface at different speed from the modem to host)
  7682.  
  7683.         US Robotics Courier 9600 HST
  7684.         Telebit T2500
  7685.  
  7686.  
  7687.  
  7688.  
  7689.  
  7690.  
  7691.  
  7692.  
  7693.  
  7694.  
  7695.  
  7696.  
  7697.  
  7698.  
  7699.  
  7700. Version 2.8: 910717                           Appendices
  7701.  
  7702. COM-AND: IBM PC Communication Script Language                 Page 135
  7703.  
  7704.  
  7705. K.    Machine Language Subroutines
  7706.  
  7707.  
  7708.     The script statements OVERLAY and SCALL offer means to extend the
  7709.     script language at a script author's discretion.  Needless to say,
  7710.     however, not all systems will support OVERLAY, and development of an
  7711.     OVERLAY proper is difficult, dangerous, and frustrating.
  7712.  
  7713.  
  7714.     The OVERLAY statement loads an EXE or COM file as an overlay to COM-
  7715.     AND.  The size of the code/data being loaded as an overlay is limited
  7716.     by available memory.  [It is NOT limited to 64K.].  Therefore, a
  7717.     given overlay will not run on all systems...  only those with
  7718.     sufficient available memory.
  7719.  
  7720.  
  7721.     An overlay is terminated when COM-AND terminates.  It may be cleared
  7722.     by a script itself, with the statement "OVERLAY CLEAR".  It is recom-
  7723.     mended that a script using overlay(s) terminate its overlay when the
  7724.     function is complete; the memory used for the overlay detracts from
  7725.     the space available for SHELL, and accessories.
  7726.  
  7727.  
  7728.     An overlay is entered with the SCALL instruction.  SCALL must specify
  7729.     the entry address relative to the first 64K of the overlay space.
  7730.     Thus, all entry points in an overlay MUST be in its first 64K.    The
  7731.     overlay is entered through a FAR CALL.    Thus, all entry points MUST
  7732.     be FAR procedures (with RETFs, not RETs).
  7733.  
  7734.  
  7735.     SCALL optionally specifies a parameter list to be passed to the over-
  7736.     lay procedure.    Parameters on this list are passed by reference
  7737.     through the stack.  Thus, all passed parameters MUST be simple
  7738.     variables (Nx, Sx, or Vx), and all passed parameters may be modified.
  7739.     On entry to an overlay procedure, the stack looks like:
  7740.  
  7741.  
  7742.  
  7743.  
  7744.  
  7745.  
  7746.  
  7747.  
  7748.  
  7749.  
  7750.  
  7751.  
  7752.  
  7753.  
  7754.  
  7755. Version 2.8: 910717                           Appendices
  7756.  
  7757. COM-AND: IBM PC Communication Script Language                 Page 136
  7758.  
  7759.  
  7760. K.    Machine Language Subroutines (continued)
  7761.  
  7762.  
  7763.     +------------------------+
  7764.     !    Segment (16 bits)     !        {
  7765.     +---              ---+        {
  7766.     !             ! SP+4n+2  {
  7767.     +-------      -------+        {    1st parm if 1 or more passed
  7768.     !             !        {    .. n = # parameters passed
  7769.     +---              ---+        {
  7770.     !    Offset (16 bits)     ! SP+4n    {
  7771.     +------------------------+
  7772.     //            //        {     ...
  7773.     +------------------------+
  7774.     !    Segment (16 bits)     !        {
  7775.     +---              ---+        {
  7776.     !             ! SP+6     { / 3rd parm if 3 parms passed
  7777.     +-------      -------+        {    2nd parm if 2 parms passed
  7778.     !             !        { \ 1st parm if 1 parm passed
  7779.     +---              ---+        {
  7780.     !    Offset (16 bits)     ! SP+4     {
  7781.     +------------------------+
  7782.     !    Segment (16 bits)     !        {
  7783.     +---              ---+        {
  7784.     !             ! SP+2     {
  7785.     +--- Return address   ---+        {    FAR CALL return address
  7786.     !             !        {
  7787.     +---              ---+        {
  7788.     !    Offset (16 bits)     ! SP+0     {
  7789.     +------------------------+
  7790.  
  7791.  
  7792.     Approximately 700 bytes of stack space are available when an overlay
  7793.     is entered.  An overlay requiring more stack space must provide its
  7794.     own stack (and mechanism to switch to its own stack when an overlay
  7795.     procedure is entered).
  7796.  
  7797.  
  7798.     The overlay may or may not pop the passed parameter references from
  7799.     the stack on return.  COM-AND resets the stack pointer as required.
  7800.     Similarly, the overlay procedure does not have to concern itself with
  7801.     saving and restoring certain registers.  COM-AND preserves all
  7802.     registers that it itself requires.
  7803.  
  7804.  
  7805.  
  7806.  
  7807.  
  7808.  
  7809.  
  7810. Version 2.8: 910717                           Appendices
  7811.  
  7812. COM-AND: IBM PC Communication Script Language                 Page 137
  7813.  
  7814.  
  7815. K.    Machine Language Subroutines (continued)
  7816.  
  7817.  
  7818.     Parameters passed/returned to/from an overlay have the form:
  7819.  
  7820.     o    Nx: the reference Segment:offset points directly to the
  7821.         integer variable.  It is 16 bits, in the usual lsb,msb form.
  7822.  
  7823.     o    Sx,Vx: the reference Segment:offset points to character 0 of
  7824.         a string variable.  String variables are 80 bytes wide, null
  7825.         filled on the right if short.  Care must be take NOT to store
  7826.         past 80 characters, as there's NO telling what might be lost.
  7827.  
  7828.  
  7829.     Variables come from different segments.  The developer of a machine
  7830.     language subroutine cannot expect all passed variables to have the
  7831.     same segment reference.
  7832.  
  7833.  
  7834.     During an overlay, it should be noted that the BIOS comm support in-
  7835.     terrupt (for the comm port COM-AND has open) is redirected through
  7836.     COM-AND.  Thus, interrupt driven reads and writes (at any speed sup-
  7837.     ported by COM-AND) may be performed through COM-AND.  The BIOS 'open'
  7838.     for the comm port COM-AND opened has its function no-op'd.
  7839.  
  7840.  
  7841.     The development of a nontrivial overlay for a script is difficult,
  7842.     to say the least.  Obvious errors will lock the machine up tight, or
  7843.     render the environment (and COM-AND) unstable.    Subtle errors may
  7844.     have the same effect, or worse.  Debugging an overlay is difficult.
  7845.  
  7846.  
  7847.     It is possible to develop an overlay using a high level language.
  7848.     However, each language compiler makes different provisions for the
  7849.     initialization of the environment.  An overlay, of course, does not
  7850.     automatically invoke the required initializations (e.g.  80x87 emu-
  7851.     lation library routines).  The developer of any high level language
  7852.     routine serving as a foreign subroutine must take this into account.
  7853.  
  7854.  
  7855.  
  7856.  
  7857.  
  7858.  
  7859.  
  7860.  
  7861.  
  7862.  
  7863.  
  7864.  
  7865. Version 2.8: 910717                           Appendices
  7866.  
  7867. COM-AND: IBM PC Communication Script Language                 Page 138
  7868.  
  7869.  
  7870. K.    Machine Language Subroutines (continued)
  7871.  
  7872.  
  7873.     Many uses for overlays require that severe modifications be made to
  7874.     the machine state during the overlay's life (e.g. hooking interrupt
  7875.     vectors).  Such overlays MUST be terminated in an orderly manner
  7876.     before COM-AND itself is terminated, if it is EVER to be used more
  7877.     than once.
  7878.  
  7879.  
  7880.     Adding to the difficulty, one script might load an overlay, and then
  7881.     another script replace it!  The script performing the replacement was
  7882.     probably written for a different purpose, and knows nothing of the
  7883.     critical nature of the first.
  7884.  
  7885.  
  7886.     The OVERLAY statement allows specification of an entry point to be
  7887.     executed when the overlay is terminated.  The end-entry point is
  7888.     executed by COM-AND when 1) COM-AND terminates and the overlay is
  7889.     still loaded, 2) when COM-AND replaces the overlay with another, and
  7890.     3) when COM-AND unloads the overlay (with OVERLAY CLEAR).
  7891.  
  7892.  
  7893.     In the above cases, THE END-ENTRY POINT IS NOT EXECUTED when 1) it
  7894.     was never specified, 2) it has already been executed through an
  7895.     SCALL, or 3) it has been changed or removed through the SET OVENTRY
  7896.     statement.
  7897.  
  7898.  
  7899.     No parameters may be passed to the end-entry address when called.
  7900.  
  7901.  
  7902.     A considerate author can unload one overlay, load a new overlay, and
  7903.     then replace the original overlay with its end-entry point intact.
  7904.     Intrinsics "_OVERLAY" and "_OVENTRY" are provided so that a script
  7905.     can 'read' the file name and end-entry point for an existing overlay,
  7906.     and replace them.  String variables set to the above two intrinsics
  7907.     are directly usable in an overlay statement (see TALKER.CMD).
  7908.  
  7909.     ---------------------------------------------------------------------
  7910.     One final caution.  During the development of TALKER.OVL, this author
  7911.     found MicroSoft's EXEPACK to emit executable object that is not load-
  7912.     able as an overlay.  This author does not recommend use of EXEPACK on
  7913.     overlay code until the code is proven to work, and then only with
  7914.     suspicion.
  7915.  
  7916.  
  7917.  
  7918.  
  7919.  
  7920. Version 2.8: 910717                           Appendices
  7921.  
  7922. COM-AND: IBM PC Communication Script Language                 Page 139
  7923.  
  7924.  
  7925. L.    CACMP
  7926.  
  7927.  
  7928.     Included with this release of COM-AND is a separate program, CACMP.
  7929.     Although CACMP has its own (separate document), it will be mentioned
  7930.     here, if only to refer the interested reader to CACMP.DOC.
  7931.  
  7932.  
  7933.     CACMP is a diagnostic and preprocessor for COM-AND scripts.  CACMP
  7934.     may be used simply to perform syntax and semantic review of a COM-AND
  7935.     script, or it may be used to strip/preprocess scripts for COM-AND.
  7936.  
  7937.  
  7938.     CACMP syntactically and semantically verifies a given script file.
  7939.     In addition, it will (optionally) perform the following functions:
  7940.  
  7941.         . Partially strip the script to output
  7942.         . Fully strip the script to output
  7943.         . Preprocess the script to output (for speed)
  7944.  
  7945.  
  7946.     The several levels of 'stripping', and 'preprocessing' are discussed
  7947.     in the CACMP documentation.  The interested reader is referred there.
  7948.  
  7949.  
  7950.  
  7951.  
  7952.  
  7953.  
  7954.  
  7955.  
  7956.  
  7957.  
  7958.  
  7959.  
  7960.  
  7961.  
  7962.  
  7963.  
  7964.  
  7965.  
  7966.  
  7967.  
  7968.  
  7969.  
  7970.  
  7971.  
  7972.  
  7973.  
  7974.  
  7975. Version 2.8: 910717                           Appendices
  7976.  
  7977. COM-AND: IBM PC Communication Script Language                 Page 140
  7978.  
  7979.  
  7980. M.    Script Language (Version 1.x)
  7981.  
  7982.  
  7983.     Version 1.x of PC-VCO included a primitive script facility.  That
  7984.     script language paralleled the original script language of PROCOMM
  7985.     version 1.x.  The only command whose meaning(s) changed was %F.  The
  7986.     %F paralleled the COM-AND Alt-P menu, as PROCOMM's %F paralleled its
  7987.     Alt-P menu.  Under most usages this make no difference.
  7988.  
  7989.     The introduction of the 2.x script processor retained the original
  7990.     script language as a subset.  A 1.x script command is signalled by a
  7991.     '%' sign.  The % must be followed by one, two or three alpha-numeric
  7992.     characters (no blanks) and possibly a quoted string (e.g.  "GENIE.
  7993.     CMD").  Text on a line not a part of a valid command is ignored.
  7994.     1.x script commands may not be mixed on a line with 2.x commands.
  7995.  
  7996.     As of version 2.7 of COM-AND the 1.x script processor is no longer
  7997.     available.  This appendix is provided for the decoding (should the
  7998.     need arise) of 1.x scripts.  The version 1.x command set was:
  7999.  
  8000.  ->    %A        Alarm
  8001.  ->    %B"str"         Default Drive/path
  8002.  ->    %C"nn"          Call directory number
  8003.  ->    %D"str"         DOS command
  8004.  ->    %En        Emulations:  unimplemented except for ANSI BBS
  8005.  *        %E0        Unimplemented
  8006.  *        %E1        Unimplemented
  8007.  *        %E2        Unimplemented
  8008.  *        %E3        Unimplemented
  8009.  *        %E4        Unimplemented
  8010.  *        %E5        Unimplemented
  8011.  *        %E6        Unimplemented
  8012.  ->        %E7        ANSI-BBS
  8013.  *        %E8        Unimplemented
  8014.  *        %E9        Unimplemented
  8015.  ->    %Fn        Comm Parms (equivalent to selection 'n' from Alt-P)
  8016.  ->    %G        Screen dump:  unimplemented
  8017.  ->    %H        Hang up
  8018.  ->    %I"str"         Wait for incoming string
  8019.  ->    %Jn        Send macro string 'n', n=0-9
  8020.  ->    %Ks        KERMIT server commands:  unimplemented
  8021.  *        %KMn        Unimplemented
  8022.  *        %KR        Unimplemented
  8023.  *        %KS"File_Name"  Unimplemented
  8024.  *        %KF        Unimplemented
  8025.  *        %KL        Unimplemented
  8026.  
  8027.  
  8028.  
  8029.  
  8030. Version 2.8: 910717                           Appendices
  8031.  
  8032. COM-AND: IBM PC Communication Script Language                 Page 141
  8033.  
  8034.  
  8035. M.    Script Language (Version 1.x, continued)
  8036.  
  8037.  
  8038.  ->    %Ls        Log commands
  8039.  ->        %LO "File_Name" Open log using "File_Name" (no default)
  8040.  ->        %LH        Hold logging
  8041.  ->        %LR        Resume logging
  8042.  ->        %LC        Close log
  8043.  ->    %M"str"         Display a message on the screen
  8044.  ->    %N"str"         Prompt for input and send
  8045.  ->    %Os        BIOS/Direct screen writes
  8046.  ->        %OB        Write to screen through BIOS
  8047.  ->        %OD        Write to screen direct
  8048.  ->    %P"nn"          Seconds to wait for an incoming string
  8049.  ->    %Q        Quit program
  8050.  ->    %R"nn"          Redial delay value
  8051.  ->    %Ss        Sound controls.
  8052.  ->        %SY        Allow alarm sounds
  8053.  ->        %SN        No alarm sounds (though alarm will delay)
  8054.  ->        %ST"nn"         Set delay for alarm (value in seconds)
  8055.  ->    %T"str"         Transmit string
  8056.  ->    %Us        Miscellaneous:    implemented as applicable
  8057.  ->        %U1        Clear screen
  8058.  *        %U2        Send CR as CR: unimplemented
  8059.  *        %U3        Send CR as CR/LF: unimplemented
  8060.  ->        %U4        Set full duplex (echoplex)
  8061.  ->        %U5        Set half duplex
  8062.  ->        %U6        Send Break signal
  8063.  *        %U7        Set line wrap on: unimplemented
  8064.  *        %U8        Set line wrap off: unimplemented
  8065.  *        %U9        Set Scroll on: unimplemented
  8066.  *        %U0        Set Scroll off: unimplemented
  8067.  ->    %Vs        Miscellaneous:    VCO specific subcommands
  8068.  *        %V0        Unimplemented (PC-VCO used for Voice)
  8069.  *        %V1        Unimplemented (PC-VCO used for Voice)
  8070.  *        %V2        Unimplemented (PC-VCO used for Voice)
  8071.         %V3        Blank line suppression on (Alt-G)
  8072.         %V4        Blank line suppression off (Alt-G)
  8073.         %V5        High bit masking on (Alt-Z)
  8074.         %V6        High bit masking off (Alt-Z)
  8075.         %V7        Chat mode on (Alt-A)
  8076.         %V8        Chat mode off (Alt-A)
  8077.         %V9        WXMODEM send allowed (not used now)
  8078.         %VA        WXMODEM send not allowed (not used now)
  8079.         %VB        WXMODEM receive allowed (not used now)
  8080.         %VC        WXMODEM receive not allowed (not used now)
  8081.         %VD"File_Name"  Unimplemented (PC-VCO FLB fname)
  8082.         %VE"File_Name"  Unimplemented (PC-VCO EXC fname)
  8083.  
  8084.  
  8085. Version 2.8: 910717                           Appendices
  8086.  
  8087. COM-AND: IBM PC Communication Script Language                 Page 142
  8088.  
  8089.  
  8090. M.    Script Language (Version 1.x, continued)
  8091.  
  8092.  
  8093.  ->    %Vs (continued)
  8094.  *        %VF        Unimplemented (PC-VCO use PLINK/CIS)
  8095.  *        %VG        Unimplemented (PC-VCO use GEnie/Delphi)
  8096.  ->    %W"nn"          Wait for a specified # seconds
  8097.  ->    %Xs        XMODEM receive/send
  8098.  ->        %XR"File_Name"
  8099.  ->        %XS"File_Name"
  8100.  ->    %Ys        ASCII Send
  8101.  *        %YP"nn"         Set pacing: unimplemented
  8102.  ->        %YT"File_name"  Transmit file_name using ASCII send
  8103.         %Y0"str"        Set host prompt character
  8104.         %Y1        Turn off host prompt character
  8105.         %Y2        Transmit linefeeds on
  8106.         %Y3        Transmit linefeeds off
  8107.         %Y4        Tab expansion on
  8108.         %Y5        Tab expansion off
  8109.         %Y6"nn"         Set intercharacter delay (in milliseconds)
  8110.  ->    %Zs        Translate tables:  unimplemented.
  8111.  *        %ZY        Translate table on:  unimplemented
  8112.  *        %ZN        Translate table off:  unimplemented
  8113.  
  8114.     Multiple 1.x commands may be placed on a single line.  SYNTAX errors
  8115.     are reported.  On 'end-of-file', COM-AND returns to the normal
  8116.     interactive mode (unless %Q was specified in the script).
  8117.     --------------------------------------------------------------------
  8118.     The notation '->' to the left of a script command indicates that it
  8119.     IS a part of the PROCOMM script language.  Unmarked extensions were
  8120.     added for COM-AND, to provide its features to script file users.
  8121.     --------------------------------------------------------------------
  8122.     The notation '*' to the left of a script command indicates that
  8123.     it is unimplemented (but will be accepted).  Commands marked 'unim-
  8124.     plemented' are parsed and accepted by COM-AND, but not executed.
  8125.  
  8126.  
  8127.  
  8128.  
  8129.  
  8130.  
  8131.  
  8132.  
  8133.  
  8134.  
  8135.  
  8136.  
  8137.  
  8138.  
  8139.  
  8140. Version 2.8: 910717                           Appendices
  8141.  
  8142. COM-AND: IBM PC Communication Script Language                 Page 143
  8143.  
  8144.  
  8145. N.    Language Summary
  8146.  
  8147.  
  8148.     Version 2.1 of COM-AND included a script processor that performed
  8149.     scripts written for PROCOMM 2.4.2 and also extended the script
  8150.     language considerably (substring extraction, concatenation, ...).
  8151.     When PROCOMM Plus was released, COM-AND's script language was again
  8152.     extended, to include ASPECT as a subset, and also to add functions
  8153.     requested by COM-AND users.  The resulting language syntax is
  8154.     summarized below.
  8155.  
  8156.  
  8157.     Between COM-AND 2.1 and COM-AND 2.2 a certain few instructions and
  8158.     usages did change, most notably the indexing of substrings.  COM-AND
  8159.     2.1 numbered characters in substrings from 1.  ASPECT added substring
  8160.     functions, but numbered characters from 0.  This author could not
  8161.     release a script language that contained both usages, and deferred to
  8162.     PCPlus.  For any inconvenience to COM-AND users, I apologize.
  8163.  
  8164.  
  8165.  
  8166.  
  8167.  
  8168.     -----------------------------------------------------------------
  8169.     The notation '->' to the left of a script command below indicates
  8170.     that it IS compatible with the ASPECT script language.
  8171.  
  8172.     -----------------------------------------------------------------
  8173.     The notation '*' to the left of a script command indicates that it
  8174.     is unimplemented (but will be accepted).  Commands marked 'unim-
  8175.     plemented' are parsed and accepted by COM-AND.  SYNTAX errors in
  8176.     command formation are not necessarily reported.
  8177.  
  8178.  
  8179.  
  8180.  
  8181.  
  8182.  
  8183.  
  8184.  
  8185.  
  8186.  
  8187.  
  8188.  
  8189.  
  8190.  
  8191.  
  8192.  
  8193.  
  8194.  
  8195. Version 2.8: 910717                           Appendices
  8196.  
  8197. COM-AND: IBM PC Communication Script Language                 Page 144
  8198.  
  8199.  
  8200. N.    Language Summary (continued)
  8201.  
  8202.  
  8203.   Page     Syntax              Comment
  8204.   ------ ------------------------------- -----------------------------
  8205.   11:     ACCESSORY <string>         ; Accessory directory entry # 1-50
  8206.   11: -> ADD Nx Ny Nz             ; Nz = Nx+Ny
  8207.   12: -> ALARM [<number>]         ; Time in seconds
  8208.   12:     ALOAD <string>          ; Load accessory directory
  8209.   12:     ALLOCATE <number>         ; Allocate up to 100 variables
  8210.   12:     ANAME Sx <number>         ; Acc Dir entry name
  8211.   13:     APGM Sx <number>         ; Acc Dir program invocation
  8212.   13:     ASCRIPT Sx <number>         ; Acc Dir script invocation
  8213.   13: -> ASSIGN Sx <string>         ; Set a value into Sx
  8214.   13:     ASUBDIR Sx <number>         ; Acc Dir subdirectory field
  8215.   13: -> ATGET row col attr len Sx     ; GET performed with positioning
  8216.   14: -> ATOI Sx Nx             ; Convert a str variable to num
  8217.   14: -> ATSAY row col attr <string>     ; MESSAGE performed with positioning
  8218.   14:     ATSCR row col len Sx         ; Read screen at location for len
  8219.   14: -> BOX row col row col attr     ; Draw a box (clear within)
  8220.   15: -> BREAK [<number>]         ; Time in milliseconds
  8221.   15: -> BYE                 ; Exit script and pgm - leave DTR
  8222.   15: -> CASE (<string>!<number>)     ; Within SWITCH/ENDSWITCH
  8223.   15: -> CHDIR <string>          ; Change d:\path
  8224.   16: -> CLEAR <attr>             ; Clear screen
  8225.   16:     CLOG OPEN <string>         ; Open call-logging file by name
  8226.   16:     CLOG CLOSE             ; Close call-logging
  8227.   16:     CLOG <string>             ; Write to call-log if open
  8228.   17:     COLOR <attr>             ; Set screen text color
  8229.   17:     COMBASE <port> Nx         ; Get base addr of COMx
  8230.   17:     COMPARMS Sx             ; Return current comm parm settings
  8231.   17:     COMVECTOR <port> Nx         ; Get vector # for COMx
  8232.   18:     CONCAT Sx [(##)!*] <string>     ; Concatenate text to Sx [at col ##]
  8233.   18: -> CONNECT             ; Exit script
  8234.   18:     CRC <string> Nx         ; Compute buffer CRC
  8235.   19:     CTOI Sx Nx             ; Character to value conversion
  8236.   19: -> CUROFF              ; Turn off cursor (EXIT turns on)
  8237.   19: -> CURON                 ; Turn on cursor (if off)
  8238.   19: -> CURSOR Nx Ny             ; Read cursor (nx=row,ny=col)
  8239.   19: -> CWHEN [(#)]             ; # = 0,1,2,...9
  8240.   20: -> DATE Sx (0!1)             ; System date
  8241.   20:     DBOX row col row col attr     ; Double line box (clear within)
  8242.   20:     DEALLOCATE             ; Deallocate dynamic variables
  8243.   20: -> DEC Nx              ; Decrement a numeric variables
  8244.   21:     DECRYPT <string><string><string>; Decrypt a file to a file using psw
  8245.   21: -> DEFAULT             ; Within SWITCH/ENDSWITCH
  8246.  
  8247.  
  8248.  
  8249.  
  8250. Version 2.8: 910717                           Appendices
  8251.  
  8252. COM-AND: IBM PC Communication Script Language                 Page 145
  8253.  
  8254.  
  8255. N.    Language Summary (continued)
  8256.  
  8257.  
  8258.   Page     Syntax              Comment
  8259.   ------ ------------------------------- -----------------------------
  8260.   21:     DEFTIME <number>         ; WAITFOR, etc in seconds
  8261.   21:     DELETE <string>         ; Delete a file by name (SUCCESS)
  8262.   22: -> DIAL <string>             ; Dialing directory entry # 1-100
  8263.   22: -> DIR <string>             ; Perform Alt-F directory function
  8264.   22:     DIRECTORY Sx [<number>]     ; Return dialing entry name
  8265.   23: -> DIV Nx Ny Nz             ; Nz = Nx/Ny
  8266.   23:     DLDIR Sx             ; Read current download d:subdir
  8267.   23:     DLOAD <string>          ; File name argument
  8268.   23:     DNUMBER Sx [<number>]         ; Return dialing entry number
  8269.   24:     DO                 ; Begin a DO-Loop clause (see UNTIL)
  8270.  
  8271.         DO ; Start loop here        ; Example
  8272.         ...                 ; Example
  8273.         UNTIL <condition>            ; Example
  8274.  
  8275.   25: -> DOS <string> [WAIT]         ; Perform a DOS command
  8276.   25:     DPARMS Sx [<number>]         ; Return dialing entry parms
  8277.   25:     DSCRIPT Sx [<number>]         ; Return dialing entry script
  8278.   26:     DWINDOW row,col,row,col     ; Set scrolling region
  8279.   26:     DWINDOW CLEAR             ; Reset scrolling region to original
  8280.   26:     EBL Sx <EBL var>         ; Access EBL global (%A-%O, &...)
  8281.   27:     EBLSET &<name> Sx         ; Set EBL extended variable
  8282.   27: -> ELSE                 ; Within IF/ENDIF
  8283.   27:     ELSE statement          ; ENDIF not required this form
  8284.   27: -> EMULATE (TTY!ANSI!VIDTEX!VT100!VT52)
  8285.   28:     ENCRYPT <string><string><string> [DES!SIM!AUT] ; Encrypt a file
  8286.   15: -> ENDCASE             ; Terminates CASE or DEFAULT clause
  8287.   35:     ENDFOR              ; Terminates a FOR Loop
  8288.   44: -> ENDIF                 ; Terminates an IF clause
  8289.   76: -> ENDSWITCH             ; Terminates a SWITCH clause
  8290.   82:     ENDWHILE             ; Terminates a WHILE clause
  8291.   28:     ENVIRON Sx <string>         ; Return environment variable value
  8292.   29: -> EXECUTE <string>         ; Chain to new script
  8293.   29: -> EXIT                 ; Terminate script
  8294.   29: -> FATSAY row col attr <fmtstr> <parms> ; Fmttd MESS performed with pos
  8295.   30:     FATTR Sx <file>         ; File attribute, binary, (SUCCESS)
  8296.   31:     FCALL <file>             ; CALL a file as a subroutine
  8297.   32: -> FCLOSEI             ; Close input file
  8298.   32: -> FCLOSEO             ; Close output file
  8299.   32:     FDATE Sx <file> [0!1]         ; Date last modified (SUCCESS flag)
  8300.   32:     FFIRST Sx             ; Initialize wildcard (SUCCESS flag)
  8301.  
  8302.  
  8303.  
  8304.  
  8305. Version 2.8: 910717                           Appendices
  8306.  
  8307. COM-AND: IBM PC Communication Script Language                 Page 146
  8308.  
  8309.  
  8310. N.    Language Summary (continued)
  8311.  
  8312.  
  8313.   Page     Syntax              Comment
  8314.   ------ ------------------------------- -----------------------------
  8315.   33: -> FGETC Sx             ; Read a character
  8316.   33: -> FGETS Sx             ; Read a record
  8317.   33: -> FIND Sx <string> [Nx]         ; Test for index in Sx
  8318.   34:     FNEXT    Sx [QUAL]         ; Next file after FFIRST (SUCCESS)
  8319.   34: -> FOPENI Sx [TEXT!BINARY]     ; Open a file for input
  8320.   34: -> FOPENO Sx [TEXT!BINARY!APPEND]  ; Open a file for output
  8321.   35:     FOR Nx = <val> <val> [<val>]     ; FOR Loop (init,final,step)
  8322.  
  8323.         FOR Nx = <val> <val> [<val>]    ; Example
  8324.         ...                ; Example
  8325.         ENDFOR                ; Example
  8326.  
  8327.   36: -> FPUTC Sx             ; Read a character
  8328.   36: -> FPUTS Sx             ; Read a record
  8329.   36: -> FREAD Sx Nx Ny          ; Read a record (Nx may be literal)
  8330.   37:     FREE  Sx <string>         ; Get available space on <disc>
  8331.   37:     FRESTORE[I!O]             ; Restore position from last FSAV
  8332.   37:     FRETURN             ; RETURN from an FCALL
  8333.   38:     FSAVE[I!O]             ; Save input/output file position
  8334.   38:     FSAVE[I!O] CLEAR         ; Clear stack of saved positions
  8335.   38:     FSAVE[I!O] SHIFT         ; Shift stack of saved pos down 1
  8336.   38:     FSAVE[I!O] POP          ; Throw away last saved position
  8337.   38:     FSIZE Sx <file>         ; File size, 7 digits, (SUCCESS)
  8338.   38:     FTIME Sx <file> [0!1]         ; Time last modified (SUCCESS flag)
  8339.   39: -> FWRITE Sx Nx             ; Write a record (Nx may be literal)
  8340.   39: -> GET Sx [<number>]         ; <number> = maximum length
  8341.   40: -> GETFILE ASCII      <string>     ; A.K.A. Buffer capture
  8342.   40: -> GETFILE BYMODEM         ; Batch YMODEM (True ... (TM))
  8343.   40: -> GETFILE BYMODEMG         ; Streaming YMODEM (batch)
  8344.   40: -> GETFILE CISB             ; CompuServe B-protocol
  8345.   40: -> GETFILE KERMIT          ; Kermit or SuperKermit
  8346.   40:     GETFILE QUICKB          ; CompuServe Quick B-protocol
  8347.   40: -> GETFILE RXMODEM  <string>     ; Relaxed CRC or Checksum XMODEM
  8348.   40: -> GETFILE WXMODEM  <string>     ; Windowed XMODEM
  8349.   40: -> GETFILE XMODEM   <string>     ; CRC or Checksum XMODEM
  8350.   40: -> GETFILE YMODEM   <string>     ; Simple YMODEM (not True ... (TM))
  8351.   40:     GETFILE ZMODEM          ; ZMODEM (batch)
  8352.   41: -> GOSUB <string>          ; Call a subroutine (and return)
  8353.   42: -> GOTO <string>             ; Branch (not into IF or SWITCH)
  8354.   43: -> HANGUP              ; Disconnect call
  8355.       *  HELP                 ; Help processor (unimplemented)
  8356.       *  HOST                 ; Host mode (unimplemented)
  8357.  
  8358.  
  8359.  
  8360. Version 2.8: 910717                           Appendices
  8361.  
  8362. COM-AND: IBM PC Communication Script Language                 Page 147
  8363.  
  8364.  
  8365. N.    Language Summary (continued)
  8366.  
  8367.  
  8368.   Page     Syntax              Comment
  8369.   ------ ------------------------------- -----------------------------
  8370.   44:     IF [NOT] ALPHA Sx         ; Test for alpha char
  8371.   44:     IF [NOT] ALLOCATED         ; Test for dynamic variables
  8372.   44: -> IF [NOT] CONNECTED         ; Test modem carrier (CD)
  8373.   44:     IF [NOT] CONTROL Sx         ; Test for control char
  8374.   44: -> IF [NOT] EOF             ; Test for EOF on input file
  8375.   44:     IF [NOT] ERROR          ; Test last instruction
  8376.   44: -> IF [NOT] FAILURE         ; .. NOT SUCCESS
  8377.   44:     IF [NOT] FCALLED         ; Test for FCALL return required
  8378.   44:     IF [NOT] FKEY             ; Test for ftn key pending
  8379.   44:     IF [NOT] FLAG [(#)]         ; Test flag variable
  8380.   44:     IF [NOT] FCALLED         ; Test for FCALL of script
  8381.   44:     IF [NOT] FIND Sx Sy [Nx]     ; Test for Sx .within. Sy
  8382.   44: -> IF [NOT] FOUND          ; Test last FIND statement
  8383.   44:     IF [NOT] FULL             ; Test if we have XOFFed host
  8384.   44: -> IF [NOT] HITKEY         ; Test for keypress pending
  8385.   44:     IF [NOT] ISDLFILE Sx         ; Test for file presence
  8386.   44: -> IF [NOT] ISFILE Sx         ; Test for file presence
  8387.   44:     IF [NOT] ISSCFILE Sx         ; Test for file presence
  8388.   44: -> IF [NOT] LINKED         ; If script executed from dialing
  8389.   44: -> IF [NOT] MONO             ; Test for monochrome adapter
  8390.   44:     IF [NOT] NULL Sx         ; Test for Sx blank or null
  8391.   44:     IF [NOT] NUMERIC Sx         ; Test for numeric character
  8392.   44:     IF [NOT] OVERLAY         ; Test for overlay loaded
  8393.   44:     IF [NOT] PRINTER         ; Test for PRINTER ON
  8394.   44:     IF [NOT] RECEIVE         ; Test for comm chars pending
  8395.   44:     IF [NOT] SPECIAL Sx         ; Test for special character
  8396.   44:     IF [NOT] STRCMP Sx Sy         ; Test Sx = Sy
  8397.   44: -> IF [NOT] SUCCESS         ; Test last statement
  8398.   44:     IF [NOT] TRACE          ; Test for tracing
  8399.   44: -> IF [NOT] WAITFOR         ; Test last WAITFOR statement
  8400.   44:     IF [NOT] XOFF             ; Test for XOFF condition
  8401.   44: -> IF [NOT] ZERO Nx         ; Test for Nx = 0
  8402.   44: -> IF [NOT] GT!LT!GE!LE!EQ Nx Ny     ; Test for Nx .condition. Ny
  8403.   44:     IF [NOT] NE Nx Ny         ; Test for not equal
  8404.   44:     IF [NOT] Nx GT!LT!GE!LE!EQ Ny     ; Test for Nx .condition. Ny
  8405.  
  8406.         Usual form        Alternative form     Alternative form
  8407.       -------------------+--------------------+----------------------
  8408.       ->    IF condition |  IF condition stmt |  IF condition
  8409.           [stmts]     |              |     [stmts]
  8410.       ->    ELSE     |              |  ELSE statement
  8411.           [stmts]     |              |
  8412.       ->    ENDIF     | (not ASPECT form)  | (not ASPECT form)
  8413.  
  8414.  
  8415. Version 2.8: 910717                           Appendices
  8416.  
  8417. COM-AND: IBM PC Communication Script Language                 Page 148
  8418.  
  8419.  
  8420. N.    Language Summary (continued)
  8421.  
  8422.  
  8423.   Page     Syntax              Comment
  8424.   ------ ------------------------------- -----------------------------
  8425.   49: -> INC Nx              ; Increment a numeric var
  8426.   49: -> INIT Nx <number>         ; Initialize a numeric variable
  8427.   50:     INPUT Nx <address>         ; Machine level INPUT
  8428.   50:     ISDLFILE <string>         ; Test for presence of a dload file
  8429.   50: -> ISFILE <string>         ; Test for presence of a file
  8430.   51:     ISSCFILE <string>         ; Test for presence of a script file
  8431.   51: -> ITOA Nx Sx             ; Numeric to string conversion
  8432.   51:     ITOC Nx Sx             ; Value to character conversion
  8433.       *  KERMSERV FINISH         ; Unimplemented
  8434.       *  KERMSERV GETFILE         ; Unimplemented
  8435.       *  KERMSERV LOGOUT         ; Unimplemented
  8436.       *  KERMSERV SENDFILE         ; Unimplemented
  8437.   52: -> KEYGET Sx             ; Read ('a', esc='1b', F1='3b00')
  8438.   52: -> KFLUSH              ; Flush keyboard buffer
  8439.   52:     LD Sx <number>          ; Return long dist string 1,2,3,4
  8440.   52:     LEGEND <string>         ; Text for status line
  8441.   53:     LENGTH Sx Nx             ; Compute length of string
  8442.   53:     LJ Sx                 ; Left justify string variable
  8443.   53:     LOAD (DIAL!MACR!ACCE!DEFA!ALLOC) [parms] ; Load file data
  8444.   53: -> LOCATE <number> <number>     ; Position cursor <row> <col>
  8445.   54: -> LOG OPEN <string>         ; Open disk/PRN logging
  8446.   54: -> LOG CLOSE             ; Close disk/PRN logging
  8447.   54: -> LOG SUSPEND             ; Suspend disk/PRN logging
  8448.   54: -> LOG RESUME             ; Resume disk/PRN logging
  8449.   54:     LOG MARKED (ON!OFF)         ; Set/reset log timestamping
  8450.   54:     LOWER Sx             ; Lower case contents of Sx
  8451.   54: -> MACRO <num> [Sx]         ; <num> = 0-9, Sx optional
  8452.   55:     MANUAL <number>         ; Invoke an interactive window
  8453.   55: -> MATGET row col attr len Sx     ; MGET performed with positioning
  8454.   56:     MCR Nx              ; Read the modem control register
  8455.   56: -> MDIAL <string>          ; Dial number in Sx manually
  8456.   56:     MDIR <string>             ; Create a subdirectory
  8457.   57: -> MESSAGE <string>         ; Write text to local console
  8458.   57: -> MGET Sx <number>         ; <number> = max length
  8459.   57: -> MLOAD <string>          ; File name argument
  8460.   58:     MSR Nx              ; Read the modem status register
  8461.   58: -> MUL Nx Ny Nz             ; Nz = Nx*Ny
  8462.   59:     Nx = expression         ; Compute a value and assign it
  8463.   60:     OUTPUT <address> Nx         ; Machine level OUTPUT
  8464.   60:     ON ESCAPE GOSUB <label>     ; Action on operator escape
  8465.   60:     ON ESCAPE CLEAR         ; Clear set action
  8466.   60:     ON SILENCE GOSUB <label>     ; Action on receive timeout
  8467.   60:     ON SILENCE CLEAR         ; Clear set action
  8468.  
  8469.  
  8470. Version 2.8: 910717                           Appendices
  8471.  
  8472. COM-AND: IBM PC Communication Script Language                 Page 149
  8473.  
  8474.  
  8475. N.    Language Summary (continued)
  8476.  
  8477.  
  8478.   Page     Syntax              Comment
  8479.   ------ ------------------------------- -----------------------------
  8480.   62:     OVERLAY <file> [<addr>]     ; Load .EXE or .COM overlay
  8481.   62:     OVERLAY CLEAR             ; Release overlay area
  8482.   62: -> PAUSE [<number>]         ; Time in seconds
  8483.   62:     PERFORM <string>         ; Perform string as command
  8484.   62:     PLAY <string>             ; Play a music string
  8485.   63:     PRESERVE Sx             ; Modify to avoid edits
  8486.   63: -> PRINTER (ON!OFF)         ; Turn printer copy on/off
  8487.   63:     PRINT <string>          ; Send <string> to LP1 printer
  8488.   63: -> QUIT                 ; Terminate script
  8489.   64:     RDIR <string>             ; Remove a subdirectory
  8490.   64:     READ Sx Nx Ny             ; Read a record (Nx may be literal)
  8491.   64:     RENAME Sx Sy             ; Rename a file by name (SUCCESS)
  8492.   65:     RESET                 ; Restore dfts to load-time values
  8493.   65:     RESTORE             ; Restore last saved area on screen
  8494.   65: -> RETURN              ; Return from GOSUB
  8495.   65:     REWIND              ; Rewind input (SUCCESS)
  8496.   65: -> RFLUSH              ; FLush receive buffer
  8497.   66: -> RGET Sx [<number> [<number>]]     ; <length> <delay in seconds>
  8498.   66:     RND <modulus> Nx         ; Return random number
  8499.   66:     RJ Sx                 ; Right justify string variable
  8500.   67: -> RUN <string> [WAIT]         ; Load and execute a program
  8501.   67:     SAVE row col row col         ; Save an area on the screen
  8502.   67:     SCALL <addr> [parms[,parms]]     ; Call an overlay procedure
  8503.   68: -> SCROLL cnt row col row col attr ; Scroll a region on the screen
  8504.   68:     SCREEN row col row col attr Sx  ; Multiline screen display
  8505.   69: -> SENDFILE ASCII     <string>     ; A.K.A. Buffer capture
  8506.   69: -> SENDFILE BYMODEM   <string>     ; Batch YMODEM (True ... (TM))
  8507.   69: -> SENDFILE BYMODEMG  <string>     ; Streaming YMODEM (batch)
  8508.   69: -> SENDFILE CISB             ; CompuServe B-protocol
  8509.   69: -> SENDFILE KERMIT    <string>     ; Kermit or SuperKermit
  8510.   69:     SENDFILE QUICKB         ; CompuServe Quick B-protocol
  8511.   69: -> SENDFILE RXMODEM   <string>     ; Relaxed CRC or Checksum XMODEM
  8512.   69: -> SENDFILE WXMODEM   <string>     ; Windowed XMODEM
  8513.   69: -> SENDFILE XMODEM    <string>     ; CRC or Checksum XMODEM
  8514.   69: -> SENDFILE YMODEM    <string>     ; Simple YMODEM (not True ... (TM))
  8515.   69:     SENDFILE ZMODEM    <string>     ; ZMODEM transfer (batch)
  8516.   85: -> SET <subcommand>         ; See below
  8517.   69: -> SHELL                 ; SHELL to DOS (must exit manually)
  8518.   70:     SNAME Sx             ; Name of current script file
  8519.       *  SNAPSHOT             ; Unimplemented
  8520.   70: -> SOUND Nx Ny             ; Sound frequency Nx for Ny msecs
  8521.   70:     SSIZE Nx             ; Return # screen lines
  8522.  
  8523.  
  8524.  
  8525. Version 2.8: 910717                           Appendices
  8526.  
  8527. COM-AND: IBM PC Communication Script Language                 Page 150
  8528.  
  8529.  
  8530. N.    Language Summary (continued)
  8531.  
  8532.  
  8533.   Page     Syntax              Comment
  8534.   ------ ------------------------------- -----------------------------
  8535.   71:     STACK <string>          ; Store <string> in BIOS kbd buffer
  8536.   71:     STACK CLEAR             ; Clear BIOS keyboard buffer
  8537.   71:     STORE (DIAL!MACR!ACCE!DEFA!ALLOC) [parms] ; Create new setting file
  8538.   72: -> STRCAT Sx Sy             ; Concatenate 2 strings
  8539.   72: -> STRCMP Sx Sy             ; Compare Sy to Sx (case sensitive)
  8540.   72: -> STRCPY Sx Sy             ; ASSIGN Sy to Sx
  8541.   73: -> STRFMT Sx <fmtstr> <parms>     ; Fmt Sx using <fmtstr> and <parm>
  8542.   74: -> SUB Nx Ny Nz             ; Nz = Nx-Ny
  8543.   74:     SUBDIR Sx             ; Set d:subdir into Sx
  8544.   74: -> SUBSTR Sx Sy <number> <number>  ; Take substr from Sy, place in Sx
  8545.   75:     SUSPEND FOR Nx Ny         ; Suspend for duration (h,m)
  8546.   75: -> SUSPEND UNTIL Nx Ny         ; Suspend until time (military fmt)
  8547.   76: -> SWITCH (Sx!Nx)          ; Variable to be tested
  8548.  
  8549.       ->    SWITCH (Sx!Nx)            ; Variable to be tested
  8550.       ->       CASE (<string>!<number>)     ; Match Sx and <string>
  8551.            ...                ; .. Execute if they match
  8552.       ->       ENDCASE                ; Each case must have an ENDCASE
  8553.       ->       CASE <string>            ; <String> = "_NULL" -> empty
  8554.            ...
  8555.       ->       ENDCASE                ; End of second case
  8556.            ...
  8557.       ->       DEFAULT                ; DEFAULT executed if no case
  8558.            ...                ; .. above matched
  8559.       ->       ENDCASE                ; End of DEFAULT case, too
  8560.       ->    ENDSWITCH                ; End of SWITCH domain
  8561.  
  8562.   77:     Sx(m:n) = expression         ; Concatenate strings and assign
  8563.   77: -> TERMINAL             ; Exit script
  8564.   78: -> TIME Sx [0!1]             ; System time (1 -> military fmt)
  8565.   78: -> TRACE (ON!OFF)          ; Script tracing
  8566.   78: -> TRANSMIT <string>         ; Send exactly <string>
  8567.   78:     TSINCE [(#)] Nx Ny Nz         ; Read time since timer (#) in h,m,s
  8568.   79: -> TYPE <string>             ; Display contents of a file (Alt-W)
  8569.   79:     UNTIL <condition as IF>     ; Terminates a DO-Loop
  8570.   79:     UPDATE              ; Update dft file
  8571.   79:     UPPER Sx             ; Upper case contents of Sx
  8572.   79:     VERSION Nx             ; Read COM-AND VERSION #
  8573.   80: -> WAITFOR <string> [<number>]     ; Optional time in seconds
  8574.   80:     WCLOSE              ; Close an open window
  8575.   81: -> WHEN [(#)] <string> <string>     ; <target> <response>
  8576.  
  8577.  
  8578.  
  8579.  
  8580. Version 2.8: 910717                           Appendices
  8581.  
  8582. COM-AND: IBM PC Communication Script Language                 Page 151
  8583.  
  8584.  
  8585. N.    Language Summary (continued)
  8586.  
  8587.  
  8588.   Page     Syntax              Comment
  8589.   ------ ------------------------------- -----------------------------
  8590.   82:     WHILE <condition>         ; Begins a conditional loop if true
  8591.  
  8592.         WHILE <condition>            ; Example
  8593.            ...                ; Example
  8594.            ENDWHILE             ; Example
  8595.  
  8596.   83:     WOPEN row col row col attr [label] ; Open window (label optional)
  8597.   84:     WRITE Sx [Nx]             ; Write a record (Nx optional)
  8598.  
  8599.   85:     SET 25              ; CGA/Mono
  8600.   85:     SET 43              ; EGA mode
  8601.   85:     SET ACCE NAME # <string>     ; Acc Dir entry name field
  8602.   85:     SET ACCE SUBD # <string>     ; Acc Dir entry subdir field
  8603.   85:     SET ACCE PGM  # <string>     ; Acc Dir entry pgm field
  8604.   85:     SET ACCE SCRI # <string>     ; Acc Dir entry script field
  8605.   85:     SET ADVERT (ON!OFF)         ; Set initial advert on/off
  8606.   85: -> SET ALARM (ON!OFF)         ; Disable alarm sound (see ATIME)
  8607.   85:     SET ANYWHEN (ON!OFF)         ; WHEN exact (off), or substr (on)
  8608.   100:-> SET ASCII <subcommand>      ; See below
  8609.   85: -> SET ATIME <number>         ; Alarm time in seconds
  8610.   85: -> SET BACKSPACE IN (NONDEST!DEST) ; Bkspace function when rcv'd
  8611.   85: -> SET BACKSPACE OUT (BACK!DELETE) ; Bkspace function when sent
  8612.   85:     SET BAR <attr>          ; Set status line color
  8613.   85: -> SET BAUDRATE (300!1200!2400!4800!9600!19K!38K!57K!115K)
  8614.   85:     SET BELL #             ; Set bell tone in Hz
  8615.   85:     SET BKSCREEN #          ; Backscreen size 0-64
  8616.   85: -> SET BREAK <number>         ; Time in milliseconds
  8617.   85:     SET BSUPPRESS (ON!OFF)      ; Blank line suppression
  8618.   85:     SET CALLLOG (ON!OFF)         ; Set/reset call logging
  8619.   85:     SET CDISPLAY (ON!OFF)         ; Control character display
  8620.   85:     SET CDRESPECT (ON!OFF)      ; Set/reset CD respect
  8621.   85:     SET CHAT (ON!OFF)         ; Chat mode
  8622.   85:     SET CHLINES #             ; Specify chat window size
  8623.   85:     SET CLOCK (ON!OFF!NEW)      ; Screen clock (new -> reset time)
  8624.   85:     SET COLOR (ON!OFF)         ; Set/reset color screen
  8625.   85:     SET COMBASE <port> Nx         ; Specify base address COMx
  8626.   85:     SET COMVECTOR <port> Nx     ; Specify vector # COMx
  8627.   85: -> SET CR     (CR!CR_LF)         ; CR received as CR or CR/LF
  8628.   85: -> SET CR_IN  (CR!CR_LF)         ; CR received as CR or CR/LF
  8629.       *  SET CR_OUT (CR!CR_LF)         ; Unimplemented
  8630.   85: -> SET DATABITS (7!8)         ; Set comm parm
  8631.  
  8632.  
  8633.  
  8634.  
  8635. Version 2.8: 910717                           Appendices
  8636.  
  8637. COM-AND: IBM PC Communication Script Language                 Page 152
  8638.  
  8639.  
  8640. N.    Language Summary (continued)
  8641.  
  8642.  
  8643.   Page     Syntax              Comment
  8644.   ------ ------------------------------- -----------------------------
  8645.   85:     SET DEFAULT <attr>         ; Set menu window color
  8646.   85:     SET DBLCLICK #          ; Dbl click interval in MS
  8647.   85:     SET DIAL NAME # <string>     ; Dial dir entry name field
  8648.   85:     SET DIAL NUMB # <string>     ; Dial dir entry number field
  8649.   85:     SET DIAL RATE # <string>     ; Dial dir entry rate field
  8650.   85:     SET DIAL PARI # <string>     ; Dial dir entry parity field
  8651.   85:     SET DIAL DATA # <string>     ; Dial dir entry dbits field
  8652.   85:     SET DIAL STOP # <string>     ; Dial dir entry stop field
  8653.   85:     SET DIAL SCRI # <string>     ; Dial dir entry script field
  8654.   85: -> SET DISPLAY (ON!OFF)         ; PC+ 1.1 SET RDISP equivalent
  8655.   85: -> SET DLDIR <string>         ; Set d:\path for downloads
  8656.   85:     SET DOSLEVEL <number>         ; Set pgm error level for batches
  8657.   85:     SET DPREFIX <string>         ; Specify dialing prefix
  8658.   85:     SET DROPDTR (ON!OFF)         ; Set hangup method
  8659.   85:     SET DSUFFIX <string>         ; Specify dialing suffix
  8660.   85:     SET DTR (ON!OFF)         ; Raise/lower DTR to modem
  8661.   85: -> SET DUPLEX (HALF!FULL)      ; Keyboard echo
  8662.       *  SET ENQ ON             ; Unimplemented
  8663.   85:     SET ENQ (OFF!CISB)         ; Automatic CIS file up/dn, VIDTEX
  8664.   85:     SET EXIT <scriptname>         ; Script on Alt-X, BYE
  8665.   85:     SET EXQUery (ON!OFF)         ; Set exit query flag
  8666.   85:     SET FAILURE (ON!OFF)         ; Set/reset FAILURE flag (IF test)
  8667.   85:     SET FLAG [(#)] (ON!OFF)     ; Set/reset flags
  8668.   85: -> SET FLOWCTRL (ON!OFF)         ; XON/XOFF flow control
  8669.   85:     SET FOUND (ON!OFF)         ; Set/reset FOUND flag (IF test)
  8670.   85: -> SET HARDFLOW (ON!OFF)         ; RTS/CTS discipline
  8671.   85:     SET HMOUSE #             ; Set mouse horiz sensitivity
  8672.       *  SET HOSTPSWD <string>         ; Unimplemented
  8673.   85:     SET INAFTER (ON!OFF)         ; Set script intrinsics on/off
  8674.   85:     SET INTRINSIC (ON!OFF)      ; Set init modem after hangup
  8675.   85:     SET KBDBUFFER (ON!OFF)      ; Keyboard display buffer
  8676.   101:-> SET KERMIT <subcommand>     ; See below
  8677.   85:     SET LD # <string>         ; LD dir entry (1-4)
  8678.   85:     SET LINKED (ON!OFF)         ; Set/reset LINKED flag (IF test)
  8679.   85:     SET MACRO # <string>         ; Macro dir entry (0-9)
  8680.   85:     SET MASK (ON!OFF)         ; 7/8 bit masking
  8681.   85:     SET MCONNECT <string>         ; Specify modem connect string
  8682.   85:     SET MDCHar <value>         ; Set modem delay char ASCII value
  8683.   85:     SET MCR <value>         ; Set modem control reg value
  8684.   85:     SET MDELAY #             ; Specify intercharacter delay
  8685.   85: -> SET MENUMODE (ON!OFF)         ; Turn on/off menu mode
  8686.   85:     SET MESCAPE <string>         ; Specify modem escape string
  8687.   85:     SET MHANGUP <string>         ; Specify hangup string
  8688.  
  8689.  
  8690. Version 2.8: 910717                           Appendices
  8691.  
  8692. COM-AND: IBM PC Communication Script Language                 Page 153
  8693.  
  8694.  
  8695. N.    Language Summary (continued)
  8696.  
  8697.  
  8698.   Page     Syntax              Comment
  8699.   ------ ------------------------------- -----------------------------
  8700.   85:     SET MINIT <string>         ; Specify modem init string
  8701.   85:     SET MUSIC (ON!OFF)         ; Set/reset music escape sequences
  8702.   85:     SET OVENTRY (NONE!<address>)     ; Set overlay end-entry address
  8703.   85: -> SET PARITY (EVEN!ODD!NONE)     ; Set comm parm
  8704.   85:     SET PCJR (ON!OFF)         ; Suspend comm during disk I/O
  8705.   85: -> SET PORT (COM1!COM2!COM3!COM4)  ; Set comm parm
  8706.   85:     SET QUIET (ON!OFF)         ; Suppress bells
  8707.   85: -> SET RDELAY <number>         ; Reconnect delay, in seconds
  8708.   85:     SET RDISPLAY (ON!OFF)         ; Receive character display
  8709.   85:     SET RDMAX <number>         ; Set redial limit count
  8710.   85:     SET RECHO (ON!OFF)         ; Received character echo (back out)
  8711.   85: -> SET REMOTE (ON!OFF)         ; Set/reset remote cmd processing
  8712.   85: -> SET REMFTNS (ON!OFF)         ; Set/reset remote function key use
  8713.   85:     SET RLEOK (ON!OFF)         ; Allow/disallow RLE's
  8714.   85:     SET RMODE (ASCII!BINARY)     ; RGET implements BS/rubout
  8715.   85:     SET RTS (ON!OFF)         ; Set/reset modem RTS bit
  8716.   85:     SET RTSD (ON!OFF)         ; Set/reset modem RTS discipline
  8717.   85:     SET RTSF (ON!OFF)         ; Set/reset RTS flow control
  8718.       *  SET SCROLL (ON!OFF)         ; Unimplemented
  8719.       *  SET SHELLPSWD <string>      ; Unimplemented
  8720.   85:     SET SILENCE <seconds>         ; Set ON SILENCE duration
  8721.   85:     SET SLOWOUT (ON!OFF)         ; Set slow writes
  8722.   85: -> SET SOFTFLOW (ON!OFF)         ; XON/XOFF flow control
  8723.       *  SET SOUND (ON!OFF)         ; Unimplemented
  8724.   85: -> SET STOPBITS (1!2)         ; Comm parm
  8725.   85: -> SET STATUS (ON!OFF)         ; Enable/disable status line
  8726.   85:     SET SUCCESS (ON!OFF)         ; Set/reset SUCCESS flag (IF test)
  8727.   85: -> SET SWRITE (BIOS!DIRECT!DOS)     ; Screen I/O update method
  8728.   85:     SET TEXT <attr>         ; Set text window color
  8729.   85:     SET TIMER [(#)]         ; Set timer number (#) to now
  8730.   85: -> SET TRANSLATE (ON!OFF)      ; Toggle translation
  8731.   85:     SET TTHRU (ON!OFF)         ; Set typethrough unconditionally
  8732.   85:     SET TUNE <string>         ; Set alarm tune using string
  8733.       *  SET TXPACE <number>         ; Implemented as SET ASCII CHARPACE
  8734.   85:     SET VMOUSE #             ; Set mouse vert sensitivity
  8735.   85:     SET WAITFOR (ON!OFF)         ; Set/reset WAITFOR flag
  8736.   85:     SET WATCHDOG <secs>         ; Set XOFF timeout in seconds
  8737.   85:     SET WRAP (ON!OFF)         ; Enable/disable line wrap at eol
  8738.   85:     SET XSUI <number>         ; Set xfer screen update interval
  8739.   103:     SET ZMODEM <subcommand>     ; See below
  8740.  
  8741.  
  8742.  
  8743.  
  8744.  
  8745. Version 2.8: 910717                           Appendices
  8746.  
  8747. COM-AND: IBM PC Communication Script Language                 Page 154
  8748.  
  8749.  
  8750. N.    Language Summary (continued)
  8751.  
  8752.  
  8753.   Page     Syntax              Comment
  8754.   ------ ------------------------------- -----------------------------
  8755.   100:-> SET ASCII BLANKEX (ON!OFF)     ; Blank line expansion ASCII send
  8756.   100:-> SET ASCII CHARPACE <number>     ; Time in MS between characters
  8757.       *  SET ASCII DN_CR (CR!CR_LF!STRIP); Unimplemented
  8758.       *  SET ASCII DN_LF (CR!CR_LF!STRIP); Unimplemented
  8759.   100:-> SET ASCII ECHO (ON!OFF)     ; Force Echo during SENDFILE ASCII
  8760.   100:     SET ASCII FLOW (ON!OFF)     ; ASCII send flow control used
  8761.   100:-> SET ASCII LINEPACE <number>     ; Delay between lines (1/10ths sec)
  8762.   100:-> SET ASCII PACECHAR <number>     ; Prompt from host (Decimal value)
  8763.   100:     SET ASCII QUIET (ON!OFF)     ; Disable alarm after SEND ASCII
  8764.   100:     SET ASCII TABEX (ON!OFF)     ; Tab expansion ASCII send
  8765.       *  SET ASCII UP_CR (CR!CR_LF!STRIP); Unimplemented
  8766.   100:-> SET ASCII UP_LF (LF!CR_LF!STRIP); CR_LF unimplemented
  8767.   100:     SET ASCII UP_Z (STOP!SEND)     ; Terminate ASCII send on ctl-z
  8768.  
  8769.  
  8770.   101:-> SET KERMIT 8QUOTE <number>     ; Decimal ascii value
  8771.   101:-> SET KERMIT BLOCKCHECK (1!2!3)     ; Block check character length
  8772.   101:-> SET KERMIT CQUOTE <number>     ; Decimal ascii value
  8773.   101:-> SET KERMIT EOLCHAR <number>     ; Decimal ascii value
  8774.       *  SET KERMIT HANDSHAKE <number>     ; Decimal ascii value
  8775.       *  SET KERMIT FILETYPE (TEXT!BINARY); Unimplemented
  8776.   101:     SET KERMIT MARK <number>     ; Decimal ascii value
  8777.       *  SET KERMIT PACKSIZE <number>     ; Decimal ascii value
  8778.   101:-> SET KERMIT PADCHAR <number>     ; Decimal ascii value
  8779.   101:-> SET KERMIT PADNUM number     ; Number of pads
  8780.   101:     SET KERMIT REPEAT <number>     ; Decimal ascii value
  8781.   101:     SET KERMIT WINDOW <number>     ; Decimal ascii value
  8782.  
  8783.  
  8784.   103:     SET ZMODEM AUTO (ON!OFF)     ; Auto downloading
  8785.   103:     SET ZMODEM BLOCK <number>     ; Decimal ascii value
  8786.   103:     SET ZMODEM RECOVER (ON!OFF)     ; Download recovery
  8787.  
  8788.  
  8789.  
  8790.  
  8791.  
  8792.  
  8793.  
  8794.  
  8795.  
  8796.  
  8797.  
  8798.  
  8799.  
  8800. Version 2.8: 910717                           Appendices
  8801.