home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / zcmd1761.zip / ZCOMMDOC.AH < prev    next >
Text File  |  1990-06-26  |  73KB  |  1,771 lines

  1.  
  2.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  3.         ZCOMM User Manual                                                  211
  4.  
  5.             character escape
  6.  
  7.         rmtcheck Sets the string to be sent to the modem or command to be
  8.             executed each time ZCOMM accepts a command line or ZMODEM protocol
  9.             Command Download from the remote caller when in Host Operation,
  10.             before that command is executed.
  11.  
  12.             SEE ALSO: rmtcmd, pwd string parameters
  13.  
  14.             EXAMPLE: set rmtcheck "@source D:remcheck.t"
  15.  
  16.  
  17.         rmtcmd Contains the command line entered by the caller or received by
  18.             ZMODEM protocol Command Download in Host Operation.  This may be
  19.             modified by an unrestricted script invoked via the rmtcheck string
  20.             parameter.
  21.  
  22.             SEE ALSO: rmtcheck string parameter, checkrmt.t script
  23.  
  24.         rname * Contains the name of the last file received by a protocol,
  25.             successful or not.
  26.  
  27.         rub Assigns a string or command to the RUBOUT (Shift Backspace) key.
  28.  
  29.         rxcnt A three digit number which counts the number of files that have
  30.             been created for receiving.  An incoming file with an illegal name
  31.             is changed to rename.n with n is incremented from the value stored
  32.             in rxcnt (or 0).
  33.  
  34.         rxlog * The filename that contains the log of received files.  If
  35.             empty (the default), this function is disabled.
  36.  
  37.         s   * Contains the current time in seconds since the last minute.
  38.  
  39.         s0...s9 These may be tested with the if %sN and if i%sN,string
  40.             commands, or expanded into a string using character escapes with
  41.             the "%sN" construction, where N is 1...9.  Use set param "" (empty
  42.             string enclosed by double quote characters) to set a string
  43.             parameter to empty.
  44.  
  45.         statlr May be used to place a messgae in the right side of the term
  46.             function status line, replacing the information normally displayed
  47.             there.
  48.  
  49.         Soft Keys The f1 to fa12 strings are executed by the respective keys
  50.             from the term function, review function, or command prompt.  In
  51.             the term function, soft keys definitions for fins, fdel, fhome,
  52.             fup, fdown, fpgup, fpgdn, fleft, fright, fend will override
  53.             ZCOMM's built-in definitions for these keys.  The built-in
  54.             definitions take precedence in the review function, conference
  55.             command, and at the command prompt.
  56.  
  57.  
  58.         (C) 1990 Omen Tech Inc                    Chapter 24 String Parameters
  59.  
  60.  
  61.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  62.         ZCOMM User Manual                                                  212
  63.  
  64.             Computers with the 101 key extended keyboard and ROM BIOS support
  65.             allow ZCOMM to distinguish the cursor cluster keys and the two new
  66.             function keys labelled F11 and F12.  Extended keyboard cursor
  67.             cluster keys may be reassigned with the fcdel, fcdown, fcend,
  68.             fchome, fcins, fcleft, fcpgdn, fcpgup, fcright, and fcup string
  69.             parameters.  The fnp5 key may be assigned to the "5" key on the
  70.             numeric pad.[2] ZCOMM's character escapes can be used to encode
  71.             special characters, including spaces and/or tabs.
  72.  
  73.             EXAMPLE: set bs "\177";  set rubout "\b" Swap backspace and rubout
  74.             for VMS
  75.  
  76.  
  77.             The contents of these keys may be displayed by ALT-K or by the
  78.             keys command.
  79.  
  80.             If the assigned string begins with "@" (commercial at), the string
  81.             is executed as a command.  A soft key command called from the term
  82.             function should not end with a t or f command because this would
  83.             cause excessive recursion (calling the term function from within
  84.             the term function).  (Use the create or open instead.)
  85.  
  86.             In the conference command, soft keys are inserted into the editing
  87.             window unless they are commands, which are executed.
  88.  
  89.             Soft keys are not executed from review or the command prompt
  90.             unless they are commands (beginning with "@").
  91.  
  92.             EXAMPLE: set f3 @rb Assigns the rb command to F3.
  93.  
  94.  
  95.  
  96.         t   expands to the current time and date each time it is used.
  97.  
  98.             SEE ALSO: d, h string parameters
  99.  
  100.         tab Assigns a string or command to the TAB key.
  101.  
  102.         telno The current telephone number string.
  103.  
  104.             SEE ALSO: mcommand string parameter
  105.  
  106.         tmp A string variable which may be used to indicate the directory used
  107.             for data to be transmitted or received.
  108.  
  109.  
  110.         __________
  111.  
  112.          2. Visible on extended 101 key keyboards with extended BIOS support
  113.             only
  114.  
  115.  
  116.  
  117.         (C) 1990 Omen Tech Inc                    Chapter 24 String Parameters
  118.  
  119.  
  120.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  121.         ZCOMM User Manual                                                  213
  122.  
  123.         tname * Contains the name of the last file sent with a protocol,
  124.             successful or not.
  125.  
  126.         txlog * The filename that contains the log of transmitted files.  If
  127.             empty (the default), this function is disabled.
  128.  
  129.         unrestrict Changes the password callers must match to allow remote
  130.             functions that are normally restricted such as erasing files,
  131.             listing and changing parameters, and changing to private
  132.             directories.  If unrestrict is empty (the default), the unrestrict
  133.             command will fail.
  134.  
  135.             SEE ALSO: unrestrict command
  136.  
  137.         w   Contains the day of the week (local time) as Mon, Tue, Wed, Thu,
  138.             Fri, Sat, or Sun.
  139.  
  140.         welcome is executed after the password (if any) has been demanded and
  141.             accepted.
  142.  
  143.             EXAMPLE: set welcome "@type welcome.txt; purgek; nulls 0"
  144.  
  145.  
  146.         xhelpfile The pathname that contains the online help file for host
  147.             mode commands.  This should be readable when ZCOMM is in
  148.             Restricted Host Operation.  Iff xhelpfile begins with the
  149.             character @, the rest of xhelpfile is treated as a Zcomm command.
  150.  
  151.             SEE ALSO: helpfile string parameters, help command
  152.  
  153.         xpassword * xpassword is a master password string that may be used to
  154.             generate a unique password for each system called.  xpassword is
  155.             encrypted by the name of the remote system (string parameter
  156.             remote) to generate a password unique to each remote system
  157.             called.  The generated password is transmitted as a result of a
  158.             Soft Key programmed with the \PXXXX construction described in
  159.             Chapter 25.  To view the generated password, set the remote string
  160.             parameter to the full remote system name as it appears in the
  161.             appropriate telephone directory (up to but not including any "-"
  162.             character), then keyboard lput \PXXXX from the main command
  163.             prompt.
  164.  
  165.             EXAMPLE: set f8 "\PXXXX" Programs F8 to transmit a 5 character
  166.             password from the term function.
  167.             Omen Technology Inc cannot accept responsibility for damages due
  168.             to the breaking of any codes used or generated by ZCOMM.
  169.  
  170.         uucplock Contains an optional UUCP lock file prefix for arbitrating
  171.             tty ports with the Unix UUCP program.  This is normally set
  172.             automatically, or from the UUCPLOCK environment variable.
  173.  
  174.  
  175.  
  176.         (C) 1990 Omen Tech Inc                    Chapter 24 String Parameters
  177.  
  178.  
  179.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  180.         ZCOMM User Manual                                                  214
  181.  
  182.             EXAMPLE: set uucplock "/usr/spool/locks/LCK.." Ee
  183.  
  184.         y*  All variable names beginning with "y" are reserved!
  185.  
  186.         y0...y127 Read only string parameters y0 to y127 expand to represent
  187.             lines displayed by the term function.  y0 corresponds to the
  188.             current partially finished line as displayed by the term function.
  189.             The last line referenced by y0...y127 becomes the y string
  190.             parameter current line used by the y, yb, and yf string
  191.             paramrters.  Each time the term function displays a newline from
  192.             the remote, the y parameter is set to the new, unfinished line
  193.             from the remote.
  194.  
  195.         y   expands to represent the y parameter current line.
  196.  
  197.         yb  Referencing the yb read only string parameter backs up the y
  198.             string parameter current line one line, and then represents that
  199.             line.
  200.  
  201.         yf  Referencing the yb read only string parameter advances the y
  202.             string parameter current line one line, and then represents that
  203.             line.
  204.  
  205.             SEE ALSO: H, h test conditions
  206.  
  207.         zmrxesc Requests the sending ZMODEM-90(TM) program[3] to escape the
  208.             specified additional control character(s).  Printing characters @
  209.             (40 hex) to _ (57 hex) escape the corresponding control characters
  210.             NULL (0) to US (1F) in both parities.
  211.  
  212.             EXAMPLE: set zmrxesc "@" Requests the sending program to escape
  213.             NULL (0) and NULL with 8th bit set (80 hex).
  214.  
  215.             SEE ALSO: zmtxesc string parameter
  216.  
  217.         zmtxesc Causes ZMODEM send commands to escape the specified additional
  218.             control character(s).  Printing characters @ (40 hex) to _ (57
  219.             hex) escape the corresponding control characters NULL (0) to US
  220.             (1F) in both parities.
  221.  
  222.             SEE ALSO: zmrxesc string parameter
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.         __________
  230.  
  231.          3. DSZ.COM does not support the zmrxesc string parameter.
  232.  
  233.  
  234.  
  235.         (C) 1990 Omen Tech Inc                    Chapter 24 Character Escapes
  236.  
  237.  
  238.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  239.         ZCOMM User Manual                                                  215
  240.  
  241.         25.  CHARACTER ESCAPES
  242.  
  243.         Some commands use strings with character escapes similar to those used
  244.         by the C programming language for describing string constants.  When
  245.         translating a string for character escapes, ZCOMM substitutes strings
  246.         (%svar) and then translates the result for backslash (\) encoded
  247.         character escapes.
  248.  
  249.                 String-Parameter    %svar
  250.                 Environment-Param   %SVAR
  251.                 % (per cent)        \045
  252.                 password*           \PXXXXXXX
  253.                 cleartext*          \C+clear-text+
  254.                 ciphertext*         \M+ciphertext+
  255.                 newline (LF)        \n
  256.                 return (CR)         \r
  257.                 tab (HT)            \t
  258.                 alarm (BEL)         \a
  259.                 backspace (BS)      \b
  260.                 form feed (FF)      \f
  261.                 escape (ESC)        \E
  262.                 transparent         \T
  263.                 lowercase           \L
  264.                 uppercase           \U
  265.                 octal byte          \nnn
  266.                 decimal byte        \dnnn
  267.                 hex byte            \xHH
  268.                 control char        \^C
  269.                 concatenation       \&
  270.                 backslash           \\
  271.  
  272.         To preserve compatibility with future TurboDial enhancements, a
  273.         backslash should not be followed by a character not listed above.
  274.  
  275.         %svar is replaced by the value of the corresponding string parameter.
  276.         The string parameter name must be written exactly, in the correct
  277.         case, with no extra letters or digits at the end.  Any non
  278.         alphanumeric character delimits the parameter name.  The DOS
  279.         environment is searched for parameters after exhausting the ZCOMM
  280.         string parameters.[1]
  281.  
  282.         \PXXXXXXX uses the xpassword and remote string parameters to generate
  283.         a password unique to each remote system, replacing each X character
  284.         with an upper case alphabetic character.* The xpassword parameter must
  285.         have at least as many characters as the number of characters used in
  286.  
  287.  
  288.         __________
  289.  
  290.          1. DOS environment parameters are upper case only
  291.  
  292.  
  293.  
  294.         (C) 1990 Omen Tech Inc                    Chapter 25 Character Escapes
  295.  
  296.  
  297.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  298.         ZCOMM User Manual                                                  216
  299.  
  300.         the \PXXXXX construction.
  301.  
  302.         SEE ALSO: xpassword, remote string parameters
  303.  
  304.         \M+ciphertext+ uses a cipher and the contents of the mpassword string
  305.         parameter to decrypt and transmit the cleartext equivalent to
  306.         ciphertext.  Ciphertext is delimited by the character immediately
  307.         following "M".
  308.  
  309.         \C+cleartext+ is treated as above, except for no decryption.
  310.  
  311.         EXAMPLE: \C+foobar+ is translated to foobar by ZCOMM's character
  312.         escape expansion.
  313.  
  314.  
  315.         A separate program pga encrypts instances of \C+cleartext+ into
  316.         \M+ciphertext+ according to a user specified master password.  Pga
  317.         also decrypts \M sequences to either cleartext, or encrypts them with
  318.         a new master password.  Please refer to Chapter 99.
  319.  
  320.         The \n, \r, \t, \b, \f, \E, \nnn, \xHH, \^C and \\ character escapes
  321.         generate the associated character.
  322.  
  323.         The \T character escape inhibits the processing of character eascpes
  324.         (but not string substitutions) in the remainder of the string.  It is
  325.         useful when the raw string contains backslashes which must not be
  326.         treated as character escapes.
  327.  
  328.         The \L character escape forces the rest of the string to lower case,
  329.         up to the next \ character.  Likewise, \U forces upper case.
  330.  
  331.         Octal byte escapes (\nnn) accept 1 to 3 octal digits terminated by the
  332.         first non octal digit.  Decimal byte escapes (\dnnn) accept 1 to 3
  333.         digits terminated by the first non digit.  Hex byte escapes (\xHH)
  334.         accept exactly 2 hex digits.  Control characters may also be
  335.         represented by \^C where C is the printing representation for Ctrl-C
  336.         and ^ is the circumflex character.
  337.  
  338.         The \& character escape generates nothing; it is useful to delimit the
  339.         lexical end of a string parameter name in string concatenation
  340.         applications.
  341.  
  342.  
  343.         25.1  Concatenating String Parameters
  344.  
  345.         To concatenate the contents of a string parameter with other
  346.         characters, one must escape the next character with a backslash if it
  347.         is a letter or digit.  The \& character escape expands to nothing.
  348.  
  349.         EXAMPLE: Assume string parameter s1 contains "foo".
  350.              putw "%s1\&bar"
  351.  
  352.  
  353.         (C) 1990 Omen Tech Inc                    Chapter 25 Character Escapes
  354.  
  355.  
  356.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  357.         ZCOMM User Manual                                                  217
  358.  
  359.         sends "foobar".
  360.              putw "%s1\142ar"
  361.         sends "foobar".
  362.              putw "%s1-skidoo"
  363.         sends "foo-skidoo".
  364.              putw "%s1bar"
  365.         is undefined.
  366.              putw "%s1\bar"
  367.         sends "foo<BS>ar"
  368.  
  369.         Failure to observe this property causes the sets and put commands to
  370.         give unexpected results.
  371.  
  372.         An encrypted password* is generated from the prototype string
  373.         \PXXXXXXXX where each X generates an upper case alphabetic character
  374.         by encrypting the leading letters of the remote system name by
  375.         xpassword.
  376.  
  377.         Only the leading letters of the remote system name are used to allow a
  378.         directory to have a number of alternate access methods for a given
  379.         system, yet produce the same automatic password.  For example,
  380.         "source", "source-telenet", "source300" would all generate the same
  381.         password, but "sourceb" would generate a different password.
  382.         xpassword must have at least as many characters as X characters in the
  383.         prototype string.
  384.  
  385.         Omen Technology Inc and sellers of ZCOMM cannot accept any
  386.         responsibility for damages due to the breaking of any ciphers used or
  387.         generated by ZCOMM.
  388.  
  389.         An arbitrary byte is generated by backslash followed by one to three
  390.         octal digits, backslash x followed by exactly two hex digits, or by
  391.         backslash circumflex followed by three decimal digits.  7 bit
  392.         transmission modes (7s, 7m, 7e, 7o) modify the parity bit of
  393.         characters transmitted by the term function during the put[w] command.
  394.  
  395.  
  396.         25.2  Quoting Strings
  397.  
  398.         Strings must be enclosed by double quotes (Shift ' on the IBM Personal
  399.         Computer) to allow white space and/or semicolon to be included in the
  400.         string.  If a string containing white space were not quoted, it would
  401.         be terminated by the first space or tab, and ZCOMM would consider the
  402.         rest of the intended string as another (incorrect) command.
  403.  
  404.         25.3  Layering of Escaped Characters
  405.  
  406.         Sometimes a string will be processed two (or more) times by ZCOMM's
  407.         character escapes.
  408.  
  409.              set fs2 "@accept s1 Name:; find \n%s1 %phones"
  410.  
  411.  
  412.         (C) 1990 Omen Tech Inc                      Chapter 25 Quoting Strings
  413.  
  414.  
  415.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  416.         ZCOMM User Manual                                                  218
  417.  
  418.         This example causes ZCOMM to ask for a name when F12 (shift F2) is
  419.         typed.  The name is read into string parameter S1, which is then used
  420.         as part of the argument for the find command.  The find command
  421.         searches the telephone directory for lines beginning with the string
  422.         you just typed in.  To match only lines starting with the given
  423.         string, a linefeed (\n) is prepended to the argument of the find
  424.         command.  When the obey command executes, the backslash-space
  425.         sequences translate to spaces, and the double backslash translates to
  426.         a single backslash.
  427.  
  428.         The space after "find" and after "%s1" must be escaped because the
  429.         obey command accepts a single string argument.  If these spaces were
  430.         not escaped, the obey command would not "see" the rest of the line
  431.         after "find".
  432.  
  433.         The find command performs its own character escape translation,
  434.         changing the \n to a linefeed character.
  435.  
  436.  
  437.         25.4  Regular Expressions
  438.  
  439.         Regular Expressions allow TurboDialTm scripts to search and parse data
  440.         from files, the keyboard, and remote computers.  Regular expressions
  441.         are used for string searching and parsing (splitting) with the ss and
  442.         egrep commands, and the h and H test conditions.
  443.  
  444.         Many DOS and Unix programs use regular expressions to search and parse
  445.         text, including grep, egrep, many flavors of EMACS, Brief, Epsilon,
  446.         ed, vi, sed, lex, and Perl.  The effort expended in learning how to
  447.         use regular expressions will be rewarded by the increased utility of
  448.         dozens of programs and tools, not just ZCOMM.
  449.  
  450.         ZCOMM regular expressions give "magic" meanings to the characters \ *
  451.         + ? . | ^ [ ] ( )
  452.  
  453.         A regular expression is zero or more branches, separated by |.  It
  454.         matches anything that matches one of the branches.
  455.  
  456.         A branch is zero or more pieces, concatenated.  It matches a match for
  457.         the first, if it is followed by a match for the second, etc.
  458.  
  459.         A piece is an atom possibly followed by *,+, or?.  An atom followed by
  460.         * matches a sequence of 0 or more matches of the atom.  An atom
  461.         followed by + matches a sequence of 1 or more matches of the atom.  An
  462.         atom followed by ? matches a match of the atom, or the null string.
  463.  
  464.         An atom is a regular expression in parentheses (matching a match for
  465.         the regular expression), a range (see below), .  (matching any single
  466.         character), ^ (matching the null string at the beginning of the input
  467.         string), $ (matching the null string at the end of the input string),
  468.         a \ followed by a single character (matching that character), or a
  469.  
  470.  
  471.         (C) 1990 Omen Tech Inc                  Chapter 25 Regular Expressions
  472.  
  473.  
  474.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  475.         ZCOMM User Manual                                                  219
  476.  
  477.         single character with no other significance (matching that character).
  478.  
  479.         A range is a sequence of characters enclosed in [].  It normally
  480.         matches any single character from the sequence.  If the sequence
  481.         begins with ^, it matches any single character not from the rest of
  482.         the sequence.  If two characters in the sequence are separated by -,
  483.         this is shorthand for the full list of ASCII characters between them
  484.         (e.g. [0-9] matches any decimal digit).  To include a literal ] in the
  485.         sequence, make it the first character (following a possible ^).  To
  486.         include a literal -, make it the first or last character.
  487.  
  488.         EXAMPLE: One can match separators (space, tabs, punctuation) by
  489.         excluding them from a range [^0-9A-Za-z] That means "match anything
  490.         except A to Z, or a to z, or 0 to 9.[2]
  491.  
  492.  
  493.         If a regular expression could match two different parts of the input
  494.         string, it will match the one which begins earliest.  If both begin in
  495.         the same place but match different lengths, or match the same length
  496.         in different ways, life gets messier, as follows.
  497.  
  498.         In general, the possibilities in a list of branches are considered in
  499.         left-to-right order, the possibilities for *, +, and ? are considered
  500.         longest-first, nested constructs are considered from the outermost in,
  501.         and concatenated constructs are considered leftmost-first.  The match
  502.         that will be chosen is the one that uses the earliest possibility in
  503.         the first choice that has to be made.  If there is more than one
  504.         choice, the next will be made in the same manner (earliest
  505.         possibility) subject to the decision on the first choice.  And so
  506.         forth.
  507.  
  508.         For example, `(ab|a)b*c' could match `abc' in one of two ways.  The
  509.         first choice is between `ab' and `a'; since `ab' is earlier, and does
  510.         lead to a successful overall match, it is chosen.  Since the `b' is
  511.         already spoken for, the `b*' must match its last possibility-the empty
  512.         string-since it must respect the earlier choice.
  513.  
  514.         In the particular case where no `|'s are present and there is only one
  515.         *, +, or ?, the net effect is that the longest possible match will be
  516.         chosen.  So `ab*', presented with `xabbbby', will match `abbbb'.  Note
  517.         that if `ab*' is tried against `xabyabbbz', it will match `ab' just
  518.         after `x', due to the begins-earliest rule.  (In effect, the decision
  519.  
  520.  
  521.         __________
  522.  
  523.          2. Ranges in regular expressions are in ASCII collating order.  For
  524.             example, the range [A-z] matches all the letters in either case,
  525.             PLUS all the funny characters between Z and a in the ASCII code
  526.             chart.
  527.  
  528.  
  529.  
  530.         (C) 1990 Omen Tech Inc                  Chapter 25 Regular Expressions
  531.  
  532.  
  533.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  534.         ZCOMM User Manual                                                  220
  535.  
  536.         on where to start the match is the first choice to be made, hence
  537.         subsequent choices must respect it even if this leads them to less-
  538.         preferred alternatives.)
  539.  
  540.         Case is significant in regular expressions.  Ranges may be used to
  541.         match characters in either case.  The regular expression [aA]ny
  542.         matches "any" or "Any".
  543.  
  544.         The regular expression subroutines and much of this description were
  545.         written at the University of Toronto.
  546.  
  547.         EXAMPLE: If s0 contains 1234567890 Hello There then the command
  548.  
  549.              ss s0 "(12.*0 ).*The(..)"
  550.  
  551.         results in
  552.  
  553.              z1='1234567890 '
  554.              z2='re'
  555.  
  556.         String parameter z0 contains the entire matched string, and may be
  557.         used for testing the success of the match with an if %z0 goto foundit
  558.         command.
  559.  
  560.  
  561.         EXAMPLE:      string = 'Here are 345 dots'
  562.              ss string "([0-9]+)"
  563.              z0= '345'
  564.  
  565.  
  566.  
  567.         EXAMPLE: Sometimes one needs to shorten a string which is too long.
  568.         The following loops while the length of subject is greater then 24.
  569.         One character is chopped off the end of the string each time the ss
  570.         command is executed.  The parentheses contain the portion of the
  571.         string that should be retained.
  572.  
  573.              while %sbj>24 ss sbj "(.*)[A-z]" sets sbj "%z1"
  574.  
  575.         An alternative:
  576.  
  577.              if %sbj>24 ss sbj ".........................";  sets sbj "%z1"
  578.  
  579.  
  580.         25.4.1  Sample Script - Browse/Download  The kcisdl.t script downloads
  581.         a file after it has been listed by the Compuserve Special Interest
  582.         Group DownLoad "bro" command.  The kcisdl.t script should be bound to
  583.         F3 with
  584.              set f3 "@source kcisdl.t"
  585.  
  586.         The Compuserve "browse" command displays file information and then
  587.  
  588.  
  589.         (C) 1990 Omen Tech Inc                  Chapter 25 Regular Expressions
  590.  
  591.  
  592.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  593.         ZCOMM User Manual                                                  221
  594.  
  595.         invites the user to download it:
  596.  
  597.         [73125,617]
  598.         P3YAM.ARC/binary          09-Jul-87 3224               Accesses: 13
  599.             Keywords: YAM PRO-YAM ZCOMM YAMDEMO
  600.  
  601.             Sample YAMscript, for handling messages and file up/downloads
  602.             with the popular PCBoard bulletin board systems.
  603.  
  604.         Disposition !
  605.  
  606.         Keyboarding F3 activates the script to scan the circular buffer for
  607.         the file name and download the file.
  608.  
  609.              if !h^\[ echo "Can't find Account Number"; return
  610.  
  611.         The h test condition searches backwards through the circular buffer
  612.         for a left square bracket ([).  Since "[" is a magic character for
  613.         regular expressions, it must be escaped.  The "^" magic character
  614.         anchors the search to the beginning of the line.  The script prints a
  615.         message and exits if the search was unsuccessful.
  616.  
  617.              ss yf "^[^     /]+"
  618.  
  619.         The yf string parameter accesses the next line in the circular buffer.
  620.         This line, which follows the uploader's account number, contains the
  621.         file name.  The ss command extracts the file name, discarding the rest
  622.         of the line starting with a possible file type designation
  623.         ("/binary").  As above, "^" matches the beginning of the line.  The
  624.         "[^    /]+" phrase matches a class of characters ("[") excluding ("^")
  625.         space, tab, and "/".  The trailing "+" matches one or more instances
  626.         of the search string, resulting in all characters starting at the
  627.         beginning of the line up to but not including the first space, tab, or
  628.         "/".
  629.  
  630.              setc s0 "\L%z0"
  631.  
  632.         Translate the file name in string parameter z0 to lower case.  (This
  633.         script is also used on Unix systems where most file names are lower
  634.         case.)
  635.  
  636.              if f%s0 echo "%z0 Exists: No Action taken."; return
  637.              echo "File name is %s0"
  638.              put "\025dow %s0/PRO:B\r"
  639.              pat 2i "\nFile name"
  640.              wait -f20
  641.              if 2 put "\025%s0\r"
  642.              ena -C;  return
  643.  
  644.         The remainder of the script generates commands using the parsed file
  645.         name.  The script enables Compuserve's B Protocol, allowing the
  646.  
  647.  
  648.         (C) 1990 Omen Tech Inc                  Chapter 25 Regular Expressions
  649.  
  650.  
  651.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  652.         ZCOMM User Manual                                                  222
  653.  
  654.         mainframe to initiate the download.
  655.  
  656.  
  657.         25.4.2  Magic Characters: Synopsis  ZCOMM regular expressions give
  658.         magic meanings to the characters \ * + ? . | ^ $ [ ] ( ) as follows:
  659.  
  660.         *  0 or more
  661.  
  662.         +  1 or more
  663.  
  664.         ?  0 or 1
  665.  
  666.         .  Any single character
  667.  
  668.         |  Branch separator (for matching)
  669.  
  670.            EXAMPLE: ss s0 "(^cc: *|^ *)([^ ]+)" The first () grouping matches
  671.            either "cc:" or a space at the begining of the line in s0.
  672.  
  673.  
  674.         ^  Matches beginning of line
  675.  
  676.         $  Matches end of line
  677.  
  678.         [] Single character(s) in a class
  679.  
  680.         [^] Single character(s) not in a class
  681.  
  682.         () Grouping (for parsing)
  683.  
  684.         ZCOMM regular expressions closely resemble those used by the Unix
  685.         egrep command.  The Unix ed and vi editors use regular expressions
  686.         with a slightly different syntax.  Epsilon and Brief editors for DOS
  687.         also use regular expressions.
  688.  
  689.         Regular Expression pattern matching is a software disicipline unto
  690.         itself.  Different program behave differently when matching ambiguous
  691.         patterns.  A number of Unix related books contain useful information
  692.         on the uses of Regular Expressions.
  693.  
  694.         In the meantime, practice makes perfect.  Setup some string variables
  695.         with strings to search and parse, and experiment with different ss
  696.         command search patterns.  A full screen editor that uses regular
  697.         expressions is a handy learning aid.
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.         (C) 1990 Omen Tech Inc                      Chapter 25 Test Conditions
  708.  
  709.  
  710.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  711.         ZCOMM User Manual                                                  223
  712.  
  713.         26.  TEST CONDITIONS (if, on, while commands)
  714.  
  715.         The following conditions may be tested with the if, on and while
  716.         commands.
  717.  
  718.         Where a string parameter is indicated, it is an error to specify a
  719.         nonexistient string parameter.
  720.  
  721.         When an immediate string argument is indicated, that argument is
  722.         delimited only by white space.  As a result, if "is1,hello&&L<5"
  723.         command ...  won't work as expected, but if is1,hello if "L<5" command
  724.         ...  will work.
  725.  
  726.         Some of the test conditions described below may be used with ">",
  727.         "==", "!=", or "<" for numeric comparisions.  The right hand argument
  728.         of a numeric comparision may be:
  729.  
  730.            + A decimal number.
  731.  
  732.              EXAMPLE:      if "L>5" abort
  733.  
  734.  
  735.            + A string paremeter which contains a decimal number.
  736.  
  737.              EXAMPLE: set maxloops "5"
  738.                   if "L>maxloops" abort
  739.  
  740.  
  741.            + The length of the string stored in a string parameter, denoted by
  742.              a leading % character.
  743.  
  744.              EXAMPLE: set s1 "Hello"
  745.                   set s2 "foo"
  746.                   if "%s1>%s2" echo "%s1 is longer than %s2"
  747.  
  748.  
  749.         These comparisions should be quoted in case a future version of ZCOMM
  750.         implements output redirection in the same manner as COMMAND.COM or the
  751.         Unix shell.  On 16 bit machines, 16 bit numerical values are used in
  752.         comparisions; numbers greater than 32767 should not be used.
  753.  
  754.         Numeric conditions may also be tested against a bit mask using the &
  755.         operator.
  756.  
  757.         EXAMPLE:      if s&64 echo "Caps Lock is ON"
  758.  
  759.  
  760.  
  761.         0...25 The specified pattern (see pattern command) was matched in the
  762.           last wait command.
  763.  
  764.  
  765.  
  766.         (C) 1990 Omen Tech Inc                      Chapter 26 Test Conditions
  767.  
  768.  
  769.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  770.         ZCOMM User Manual                                                  224
  771.  
  772.         %svar The specified string parameter svar (see the set command) is non
  773.           empty.  May be used with ">", "==", or "<" for numeric comparisions
  774.           of the string length of svar.
  775.  
  776.           EXAMPLE: if %s1 putw %s1
  777.  
  778.  
  779.           EXAMPLE: if %symbol>4 ss symbol "(.*)[A-z]"; sets symbol %z1
  780.           If the length of the string in string variable symbol exceeds 4,
  781.           chop off the rightmost letter.
  782.  
  783.  
  784.         ? The ?  numeric parameter counts the number of files sent or received
  785.           with a protocol, and the number of lines matched by the find
  786.           command.  The fFILE test condition (if true) assigns the file length
  787.           to the ?  parameter.  On 16 bit computers, file lengths greater than
  788.           32767 are represented as 32767.  With certain operating systems, the
  789.           exit status of a subprogram accessed by a DOS Gateway is stored in
  790.           the ?  numeric parameter.
  791.  
  792.           The ?  numeric parameter may then be tested with the ?  test
  793.           condition.  It can be used with ">", "==", or "<" for numeric
  794.           comparisions.
  795.  
  796.           EXAMPLE: p?0 find fizzbin *.txt; if ? echo "Found fizzbin"
  797.  
  798.  
  799.           SEE ALSO: ?  numeric parameter
  800.  
  801.         B True iff Ctrl-Break has been pressed since the last purgek command.
  802.  
  803.         Csvar True iff string parameter svar contains any control characters
  804.           less than 040 (hex 20) or rubout.
  805.  
  806.           EXAMPLE: if Cs0 echo "Please Retype
  807.  
  808.  
  809.         E True iff the elapsed time in seconds is non 0.  Used with ">", "==",
  810.           or "<" for numeric comparisions.
  811.           NOTE: Elapsed time may be off by up to one second.  On 16 bit
  812.           machines, the maximum testable value for elapsed time is 32767
  813.           seconds.
  814.  
  815.           EXAMPLE: if "E>300" off Disconnects the modem if the elapsed time is
  816.           greater than 300 seconds.
  817.  
  818.  
  819.           SEE ALSO: restime command
  820.  
  821.         F>N True iff more than N kilobytes (1 kilobyte = 1024 bytes) of free
  822.           space remain on the default drive.
  823.  
  824.  
  825.         (C) 1990 Omen Tech Inc                      Chapter 26 Test Conditions
  826.  
  827.  
  828.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  829.         ZCOMM User Manual                                                  225
  830.  
  831.           EXAMPLE: if "F>2000" usq hugefile.q
  832.  
  833.  
  834.         Hregular-expression Searches backward thru the circular buffer for the
  835.           next line matching regular-expression.  If the search is successful,
  836.           the y string parameter points to the matched line.
  837.  
  838.           The N test condition may be used to test the number of lines that
  839.           were searched before finding a match.
  840.  
  841.           EXAMPLE: To allow processing of information such as:
  842.                5 Review folder UFO  (0 stories) (a typical news item in the
  843.           Executive News Service), one must scan for lines with a certain
  844.           pattern (in this case the character "(" immediately followed by
  845.           1...9 indicating 1 or more stories).
  846.  
  847.                while "H\([1-9]" ss (rest of line)
  848.  
  849.           The above searches backwards for the next line containing "(1" to
  850.           "(9".  Note that "(" is a magic character in regular-expressions,
  851.           and must be escaped.
  852.  
  853.  
  854.           The h test condition is similar, but starts the search with the last
  855.           displayed line.
  856.  
  857.  
  858.           SEE ALSO: ens.t and kcdisl.t scripts, regular-expressions, y, yb,
  859.           y0...y127 string parameters, N test condition
  860.  
  861.         Isvara,svarb Tests whether the contents of string variable svara are
  862.           IDENTICAL to the contents of string variable svarb.  Case is
  863.           significant.
  864.  
  865.           EXAMPLE: if Is0,s9 goto exactmatch
  866.  
  867.  
  868.           SEE ALSO: i test condition (compares a string parameter and an
  869.           immediate string)
  870.  
  871.         Jsvar,string Tests whether any of the characters in the immediate
  872.           string string appear one or more times in string parameter svar.
  873.  
  874.           EXAMPLE:
  875.           if "Js0,!@#$%^&()_" echo "No funny characters"; goto getname
  876.  
  877.  
  878.         L>N True iff this while command has made more then N loops.
  879.  
  880.           EXAMPLE: while !1 put "\r" wait ife "L>5" off Disconnects the modem
  881.           if the while command has sent more than five "\r"'s.  The "L>N"
  882.  
  883.  
  884.         (C) 1990 Omen Tech Inc                      Chapter 26 Test Conditions
  885.  
  886.  
  887.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  888.         ZCOMM User Manual                                                  226
  889.  
  890.           should be quoted in case a future version of ZCOMM implements output
  891.           redirection in the same manner as command.com or the Unix shell.
  892.  
  893.  
  894.         N>N True iff the last h or H condition searched more than N lines
  895.           before a match.
  896.  
  897.           SEE ALSO: h and H test conditions
  898.  
  899.         Q>N True iff the number of active queue entries is greater than N.
  900.  
  901.         R>N After a zcommand "" command, evaluates true iff more than N
  902.           kilobytes (1 kilobyte = 1024 bytes) of free space remain on the
  903.           remote system's default disk drive.
  904.  
  905.           EXAMPLE: zcommand ""; if "R>1000" sz -y hugefile
  906.  
  907.  
  908.         S>N True iff the transmission speed is greater N bits per second.
  909.  
  910.           EXAMPLE: if S>2400 put "set verbose\r"
  911.  
  912.  
  913.         U True if ZCOMM was unrestricted when the first level of the current
  914.           set of scripts was activated.
  915.  
  916.           SEE ALSO: u test condition
  917.  
  918.         asvar The numeric value of the specified string parameter svar is non
  919.           zero.  May be used with ">", "==", or "<" for numeric comparisions.
  920.           The string variable may contain leading spaces or tabs, an optional
  921.           + or - sign, and digits.
  922.  
  923.           EXAMPLE: if "as1==30" goto seen30 Performs the goto if s1 contains
  924.           "30".
  925.  
  926.  
  927.         bTIME True if the current time is Before TIME.  TIME is written in the
  928.           form [yy[mm[dd]]]hhmm.  No further conditions may be given in the if
  929.           statement after the b condition.
  930.  
  931.           EXAMPLE: if b2300 return Returns from the script if the time is
  932.           before 11 p.m.
  933.  
  934.  
  935.           EXAMPLE: if b8512250900 return Returns from the script if the
  936.           date/time is before 9 a.m.  Christmas day in 1985.
  937.  
  938.  
  939.         c Carrier detect is present on the modem port.
  940.  
  941.  
  942.  
  943.         (C) 1990 Omen Tech Inc                      Chapter 26 Test Conditions
  944.  
  945.  
  946.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  947.         ZCOMM User Manual                                                  227
  948.  
  949.           EXAMPLE: if !c goto lostit
  950.  
  951.           NOTE: On Unix systems, a dis -d command must be given to "arm" the
  952.           system to detect carrier loss.
  953.  
  954.           SEE ALSO: d mode
  955.  
  956.         d{?ADLMPSTXZacdflmrtu} True iff the corresponding configuration is
  957.           true:
  958.  
  959.             ? True if an unrecoverable error or manual abort was detected on
  960.               the last protocol file transfer.
  961.  
  962.             A True if the term function's emulation Alternate Keypad Mode mode
  963.               is on.
  964.  
  965.             C>N Numeric, true if the display column is greater than N.
  966.  
  967.             D The script is running on a demonstration program.
  968.  
  969.             L True if ZCOMM is recording TurboLearn(TM) script information
  970.               (learn command).
  971.  
  972.             M True if term function Keyboard Mapping is on ("display mapkb").
  973.  
  974.             P Packet state is active (X.PC driver).
  975.  
  976.             R>N Numeric, true if the display row is greater than N.
  977.  
  978.               EXAMPLE:      set fa10
  979.               @pat 23cp \n "@lput \E[K if dR>23 lput \E[H\E[K"
  980.               When the Alt-F10 key is struck, a search pattern (23) is set.
  981.               This searches for each linefeed from the remote and performs a
  982.               local display clear to end of line on each new line.  If the
  983.               display row exceeds 23, jump to the top of the screen and clear
  984.               the first line.  This "trick" may be used to prevent scrolling
  985.               on displays that smear badly.
  986.  
  987.  
  988.             S The script is running on a shareware program (e.g., ZCOMM).
  989.  
  990.             T True if a higher level of the script has called the Term
  991.               Function.  When True, the script should return to the Term
  992.               Function; the script should not invoke the Term Function.
  993.  
  994.             X The X.PC commands are available.
  995.  
  996.               EXAMPLE: if dX goto xpclogin
  997.  
  998.  
  999.  
  1000.  
  1001.  
  1002.         (C) 1990 Omen Tech Inc                      Chapter 26 Test Conditions
  1003.  
  1004.  
  1005.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1006.         ZCOMM User Manual                                                  228
  1007.  
  1008.             Z The ZMODEM commands are available.
  1009.  
  1010.               EXAMPLE: if dZ sz -n logfile
  1011.  
  1012.  
  1013.             a>N True iff ZCOMM was called from the operating system with more
  1014.               than N arguments (counting the program name).
  1015.  
  1016.             c The color/graphics display is selected.
  1017.  
  1018.             d ZCOMM is executing under DOS.
  1019.  
  1020.             f The program is running in the foreground.  On DOS, a script is
  1021.               considered to be running in the foreground when it is NOT called
  1022.               by the Callout Queue as described in Chapter 27.  A program
  1023.               running in the background is unlikely to have an operator
  1024.               available for interaction.
  1025.  
  1026.               Under Unix, a script is considered to be running in the
  1027.               background if it is detached from possible keyboard input, and
  1028.               ZCOMM will exit when it reaches the main command prompt.
  1029.  
  1030.               SEE ALSO: fg, bg commands
  1031.  
  1032.             l>N True iff the script level (nesting) is greatern than N.
  1033.  
  1034.             m The monochrome display is selected.
  1035.  
  1036.             r Data Set Ready (DSR) on the modem is active.
  1037.  
  1038.             t ZCOMM is running under a Topview or DESQview virtual screen
  1039.               which may be smaller than the physical screen size
  1040.  
  1041.             u ZCOMM is executing under Unix/Xenix.
  1042.  
  1043.         e True iff an t, sz, or rz command terminated with an error, or if the
  1044.           term function has detected framing or overrun errors, since the last
  1045.           autodial.
  1046.  
  1047.         e>N True iff the e parameter (number of errors) is greater than N.
  1048.  
  1049.           EXAMPLE: if "e>5" off Disconnects the modem if more than 5 errors
  1050.           have been counted.
  1051.  
  1052.           The "e>N" should be quoted in case a future version of ZCOMM
  1053.           implements output redirection in the same manner as command.com or
  1054.           the Unix shell.
  1055.           NOTE: The e parameter is not compared within the term function, so
  1056.           "detection" may be delayed.
  1057.  
  1058.           SEE ALSO: e numeric parameter
  1059.  
  1060.  
  1061.         (C) 1990 Omen Tech Inc                      Chapter 26 Test Conditions
  1062.  
  1063.  
  1064.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1065.         ZCOMM User Manual                                                  229
  1066.  
  1067.         fFILE (No space between f and FILE).  Tests whether FILE exists as a
  1068.           normal readable file (not a directory or hidden file).  FILE is
  1069.           expanded for string parameters.  If the test is successful, the ?
  1070.           numeric parameter (testable with the ?  test condition) is set to
  1071.           the file length. [1] The N test condition reflects the number of
  1072.           links to the file.
  1073.  
  1074.           EXAMPLE: if fnit put "message\r"; f -xp nit; put "\r\336y" If nit
  1075.           exists, give a "message" command, upload the file, then send
  1076.           carriage return, pause, and the letter "y".
  1077.  
  1078.           When used in a numeric context, the fFILE test represents the size
  1079.           of the file in full kilobytes (1024 bytes), or 1, whichever is
  1080.           greater.
  1081.  
  1082.           EXAMPLE: if ffoo.bar>30 echo "File Longer than 30kb"
  1083.  
  1084.  
  1085.           EXAMPLE: if fspy.kgb if !? echo "Zero Length File"
  1086.  
  1087.           SEE ALSO: obey command
  1088.  
  1089.         g Tests whether term function file transmission flow is go (not
  1090.           stopped by an XOFF character).
  1091.  
  1092.           EXAMPLE: if !g echo "Remote has not sent XON"; pg1
  1093.  
  1094.  
  1095.           SEE ALSO: g mode, term function XON and XOFF
  1096.  
  1097.         hregular-expression Please refer to the Hregular-expression test
  1098.           condition.
  1099.  
  1100.         isvar,string Tests whether the contents of string variable svar are
  1101.           identical to the immediate string string.  Case is significant.  No
  1102.           further conditions may be given in the if statement after the i
  1103.           condition.  This test is useful in designing menu applications.  The
  1104.           menu script menu.hst uses this test condition extensively.
  1105.  
  1106.           EXAMPLE: accept s1 Choice:; if is1,a goto choicea Executes a goto
  1107.           choicea if the user keyboards an a in response to the "Choice:"
  1108.           prompt.
  1109.  
  1110.  
  1111.  
  1112.  
  1113.         __________
  1114.  
  1115.          1. On 16 bit computers, file lengths greater than 32767 are
  1116.             represented as 32767.
  1117.  
  1118.  
  1119.  
  1120.         (C) 1990 Omen Tech Inc                      Chapter 26 Test Conditions
  1121.  
  1122.  
  1123.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1124.         ZCOMM User Manual                                                  230
  1125.  
  1126.           SEE ALSO: I test condition (compares two string parameters)
  1127.  
  1128.         jsvar,string Tests whether the immediate string string is a substring
  1129.           of (contained somewhere within) the contents of string variable
  1130.           svar.  Lower case characters in string match characters in either
  1131.           case.  Upper case characters in string match upper case characters.
  1132.           No further conditions may be given in the if statement after the j
  1133.           condition.  This test is useful in designing menu applications, and
  1134.           for examining message lines read with the grab command.
  1135.  
  1136.           EXAMPLE: grab s1; if js1,sig= goto endofsig Executes a goto if the
  1137.           line read by the grab command contained "sig=" or "This SIG=".
  1138.  
  1139.  
  1140.         k One or more characters have been received from the keyboard and are
  1141.           in the interrupt queue awaiting processing.  Note: Keyboard
  1142.           characters are transmitted to the remote by the term function,
  1143.           except during a put command.
  1144.  
  1145.         l True if the line printer is ready to accept a character.
  1146.  
  1147.         m One or more characters have been received from the modem and are in
  1148.           the interrupt queue awaiting processing.
  1149.  
  1150.         n No pattern was matched as a result of the last wait command or
  1151.           search pending term function.  n detects a search timeout, loss of
  1152.           carrier detect signal, or manual exit with F1 or ALT-X.
  1153.  
  1154.         psvar,string Tests whether the immediate string string is a prefix of
  1155.           the contents of string variable svar.  The match is case sensitive.
  1156.           No further conditions may be given in the if statement after the p
  1157.           condition.  This test is useful for examining message lines read
  1158.           with the grab command.
  1159.  
  1160.           EXAMPLE: grab s1; if ps1,sig= goto endofsig Executes a goto if the
  1161.           line read by the grab command contained "sig=", but not if it
  1162.           contained "This sig=" or "SIG=".
  1163.  
  1164.  
  1165.         q>N True iff the number of free queue entries is greater than N.
  1166.  
  1167.         r True iff a receive file is open for capture.
  1168.  
  1169.           SEE ALSO: create, t commands
  1170.  
  1171.         s>N True iff the keyboard shift state is greater than N.
  1172.  
  1173.           EXAMPLE: if "s>63" echo "Caps Lock is Active"
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.         (C) 1990 Omen Tech Inc                      Chapter 26 Test Conditions
  1180.  
  1181.  
  1182.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1183.         ZCOMM User Manual                                                  231
  1184.  
  1185.         t True iff a transmit file is open.
  1186.  
  1187.           EXAMPLE: if !t echoc "%1 Short file! ";  goto foobar
  1188.  
  1189.  
  1190.           SEE ALSO: f, open commands
  1191.  
  1192.         u True if ZCOMM is unrestricted.
  1193.  
  1194.           SEE ALSO: U test condition
  1195.  
  1196.         v True if the v (Verbose) numeric parameter is non zero.
  1197.  
  1198.           EXAMPLE: if v s Displays the status on the console if the v numeric
  1199.           parameter (Verbose) is non zero.
  1200.  
  1201.  
  1202.         y ZCOMM accepts a single character from the keyboard, which is printed
  1203.           followed by a newline.  True if the character is "y" or "Y".  False
  1204.           the H numeric is non zero, and a character is not typed within the
  1205.           time limit set by that parameter.
  1206.  
  1207.           EXAMPLE: echo "Really quit?"; if y quit
  1208.  
  1209.  
  1210.         Compound tests may be formed with the unary ! (not), binary || (or),
  1211.         and binary && (and) operators.  The tests are evaluated strictly left
  1212.         to right.  The unary ! operator applies to the following operand only.
  1213.  
  1214.         EXAMPLE: if n&&!n||c echo "Carrier Detect Present" simply tests
  1215.         carrier because the result of the binary and operation above is always
  1216.         false.
  1217.  
  1218.         EXAMPLE: if !c||1||2 o abort Disconnects the modem and aborts the
  1219.         script if carrier detect is off, or if either pattern 1 or pattern 2
  1220.         were matched.
  1221.  
  1222.  
  1223.         EXAMPLE: on e>45||!c goto allsignd Each time the term function
  1224.         returns, branch to the end of the script if carrier detect is lost or
  1225.         more than 45 line hits have been detected.
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.         (C) 1990 Omen Tech Inc                       Chapter 26 Host Operation
  1239.  
  1240.  
  1241.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1242.         ZCOMM User Manual                                                  232
  1243.  
  1244.         27.  HOST OPERATION / REMOTE CONTROL
  1245.  
  1246.         ZCOMM Host Operation allows callers to access files, programs, and
  1247.         other computers with baud rate detection, speed conversion, and
  1248.         multiple layers of password access control.
  1249.  
  1250.         The comments in this chapter apply when ZCOMM is in Host Operation.
  1251.         Host Operation is entered by the host command.  The host command is
  1252.         given only from a script, such as the telephone directory "host"
  1253.         entry.
  1254.  
  1255.         In Host Operation, the default disk is set to the default disk as of
  1256.         when ZCOMM was started.  The port and baud rate are set to those in
  1257.         effect when the host command was given.  Normally the screen is
  1258.         cleared, unless the v numeric parameter is set >0.  The status line
  1259.         displays the number of Calls, Logins, Messages, and Scans since ZCOMM
  1260.         was invoked.  ZCOMM then awaits a carrier detect signal or character
  1261.         from the modem indicating an incoming call.
  1262.  
  1263.         While awaiting a call ZCOMM periodically scans the queue of outgoing
  1264.         message scripts if the callpath string parameter is set.*\*(ZZ*F
  1265.  
  1266.         The call3 string parameter may be used to display a help message which
  1267.         will show while ZCOMM is awaiting calls.
  1268.  
  1269.         EXAMPLE:      set call3
  1270.         @echo "Now awaiting incoming calls.  Press F1 to exit."
  1271.  
  1272.  
  1273.         When a character is received from the modem or the modem's carrier
  1274.         detect signal comes on, ZCOMM executes the baudstr string
  1275.         parameter.[1]
  1276.  
  1277.         Most contemporary modems can send a string indicating the incoming
  1278.         transmission speed.[2] The baud2.t script searchs for these strings
  1279.         and sets the transmission speed accordingly.  The caller does not have
  1280.         to hit carriage returns to allow ZCOMM to dtermine the transmission
  1281.         speed.  The call2 string parameter setting in the distribution
  1282.         phones.t file commands a Hayes compatible modem to transmit these
  1283.  
  1284.  
  1285.         __________
  1286.  
  1287.          0. The Callout Queue is described in a later subchapter.
  1288.  
  1289.          1. If the executed string begins with "@", the rest is treated as a
  1290.             command line, otherwise the string is sent to the modem.
  1291.  
  1292.          2. At the current speed, before switching to the speed of the
  1293.             incoming transmission
  1294.  
  1295.  
  1296.  
  1297.         (C) 1990 Omen Tech Inc                       Chapter 27 Host Operation
  1298.  
  1299.  
  1300.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1301.         ZCOMM User Manual                                                  233
  1302.  
  1303.         extended result codes.
  1304.  
  1305.         When ZCOMM completes execution of baudstr, ZCOMM checks the modem's
  1306.         carrier detect signal.  If carrier has disappeared, ZCOMM executes the
  1307.         call2 string parameter and resumes its vigil.
  1308.  
  1309.         If carrier is still present, ZCOMM increments the Call counter and
  1310.         switches to remote operation.  Remote operation allows characters to
  1311.         be keyboarded from either the local keyboarded, or by the caller.
  1312.         Remote operation also causes most screen output to be sent to the
  1313.         modem.
  1314.  
  1315.         Then ZCOMM executes the challenge string parameter.  The supplied
  1316.         CHALLENG.T script file first states the name of the system.
  1317.  
  1318.         If the string parameter password is set, the script demands a
  1319.         password.  The caller must enter it correctly, in the correct case, or
  1320.         be disconnected after three tries.  If password is empty, no password
  1321.         is demanded.
  1322.  
  1323.         The caller then enters his name.  Names with special characters are
  1324.         rejected.  The name link immediately accesss the link command.**[3]
  1325.         Otherwise, the script asks the caller to confirm the name just typed.
  1326.         If the script is exited with a fail command, ZCOMM terminates the
  1327.         call.
  1328.  
  1329.         Iff none of the previous activities has terminated the call, ZCOMM
  1330.         increments the login counter, sets Restricted and executes the welcome
  1331.         string parameter and then drops into remote command function.  Most
  1332.         commands are allowed remotely, except those that would disrupt the
  1333.         connection (port selection) or violate security if unrestricted
  1334.         privileges are not granted.
  1335.  
  1336.         The caller may request unrestricted privileges with the unrestrict
  1337.         command.* The caller must enter a password matching the unrestrict
  1338.         string parameter.
  1339.  
  1340.         The session is terminated by loss of carrier detect, the bye, o, or
  1341.         off command, or by typing F1 or NUKE (ALT-N) on the local keyboard.
  1342.  
  1343.         In Host Operation, ZCOMM will drop the call if it has to wait more
  1344.         than five minutes for the next command.  The j numeric parameter sets
  1345.         the connect time limit in seconds for restricted callers.  This limit
  1346.         is checked each time the host command prompt is displayed.
  1347.  
  1348.  
  1349.         __________
  1350.  
  1351.          3. The supplied CHALLENG.T script terminates the call when the link
  1352.             command exits.
  1353.  
  1354.  
  1355.  
  1356.         (C) 1990 Omen Tech Inc                       Chapter 27 Host Operation
  1357.  
  1358.  
  1359.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1360.         ZCOMM User Manual                                                  234
  1361.  
  1362.         If Restricted, pathnames are checked against the contents of string
  1363.         parameter home.  Absolute pathnames (beginning with \ or /) must
  1364.         include home as a prefix, and contain no references to parent
  1365.         directories (..).  This allows remote users to access a subtree of the
  1366.         disk without allowing access to other directories.  The string
  1367.         parameter rdisks should be set to include only the disks that are to
  1368.         be accessed by restricted callers.[4] The disks string parameter
  1369.         should be set to include the disks that are to be accessed remotely by
  1370.         any caller.
  1371.  
  1372.         ZCOMM's Kermit commands operate properly in Host Operation.
  1373.  
  1374.         When the caller disconnects by issuing a bye or off command or by
  1375.         dropping carrier, the exrc string parameter is executed.  exrc should
  1376.         contain commands to "clean up" after a host session.  If hardware
  1377.         handshaking is used, exrc should contain a handshake off command.
  1378.  
  1379.         The callout queue is scanned, and the call2 parameter is executed and
  1380.         ZCOMM resumes waiting for incoming calls.  The screen is then cleared
  1381.         unless the v numeric parameter is greater than 0.
  1382.  
  1383.         If the user keyboards F1 ZCOMM leaves host state and executes the
  1384.         outahost string parameter.
  1385.  
  1386.         27.1  Remote Execution of DOS Programs
  1387.  
  1388.         The !  command is allowed only if unrestricted privileges have been
  1389.         granted.  All the caveats mentioned under the !  command apply,
  1390.         especially since it may be inconvenient to reset the computer hardware
  1391.         from a distance.
  1392.  
  1393.         A DOS program invoked with the !  command will normally display on the
  1394.         local screen only.  The program's output may be redirected to the
  1395.         modem by referring to the DOS device corresponding to the modem port.
  1396.         For example, if serial port 1 (COM1) is being used for the modem
  1397.         connection, the following ZCOMM command will output to the modem.
  1398.  
  1399.              !chkdsk >com1
  1400.  
  1401.         Although input can be redirected from the modem, the modem status may
  1402.         not be appropriate for the desired operation.  Some careful checking
  1403.         beforehand may forestall the frustration of a distant computer tightly
  1404.         wedged beyond all hope.  Be especially careful to check what such
  1405.         commands might do in the event of line hits or loss of carrier detect.
  1406.  
  1407.  
  1408.         __________
  1409.  
  1410.          4. The pathnames private, messages, rxlog, txlog, and callers are not
  1411.             checked.  They cannot, however, be changed by a Restricted user.
  1412.  
  1413.  
  1414.  
  1415.         (C) 1990 Omen Tech Inc                       Chapter 27 Host Operation
  1416.  
  1417.  
  1418.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1419.         ZCOMM User Manual                                                  235
  1420.  
  1421.         The DOS "ctty" command may be used with caution.  It should be
  1422.         preceded with a DOS mode command to set 7 bits.  The caller should be
  1423.         using the same number of bits and parity as used with the DOS mode
  1424.         command.
  1425.  
  1426.         The following may be placed in a .BAT file to allow remote operation
  1427.         of DOS programs:
  1428.  
  1429.         mode com1:1200
  1430.         ctty com1
  1431.         command
  1432.         ctty con
  1433.  
  1434.         If these commands placed in "CT.BAT", then the caller can type !~ct to
  1435.         get a DOS "shell" (command.com).  When finished, give the DOS "exit"
  1436.         command.  CT.BAT then returns DOS control to the console and then
  1437.         returns to ZCOMM's Host Operation.
  1438.  
  1439.         Please refer to the DOS Gateway subchapter in Chapter for more
  1440.         information on running DOS programs under ZCOMM.
  1441.  
  1442.         The Doorway or similar programs may be useful for remote DOS program
  1443.         execution.  Doorway intercepts VIDEO BIOS calls and transmits ANSI
  1444.         escape sequences to regenerate the display on the calling terminal.
  1445.         Doorway may be set to use an extended keyboard mapping supported by
  1446.         ZCOMM's term function ALT-= toggle.
  1447.  
  1448.  
  1449.         DOS doesn't do anything intelligent with break or carrier dropout, so
  1450.         be careful.  ZCOMM will reinitialize the modem UART properly when it
  1451.         regains control.
  1452.  
  1453.         When the fabled multitasking DOS 5.0 becomes available (Real Soon
  1454.         Now), it may be possible to implement remote access more cleanly.
  1455.  
  1456.         27.2  Script for Host Operation
  1457.  
  1458.  
  1459.         host    echo "Host"
  1460.         host:   echo "Host1"
  1461.              set emdir /memo; set twxfile twx;
  1462.              set disks "c"
  1463.              set rdisks "c"
  1464.              set call1 ATZ\r\336ATZ\r
  1465.              set call2
  1466.         @bye; sleep 3; putw "\336ATZ\r\336\336ATX1 M0 S0=1\r"; clears
  1467.              set callpath /tmp/*.xx?
  1468.              set outahost ATZ\r
  1469.              : set rmtcmd "C:/host/checkrmt.t"
  1470.  
  1471.         The above lines set parameters used with Host Operation.  The call1
  1472.  
  1473.  
  1474.         (C) 1990 Omen Tech Inc                       Chapter 27 Host Operation
  1475.  
  1476.  
  1477.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1478.         ZCOMM User Manual                                                  236
  1479.  
  1480.         callpath, and rmtcmd lines must be commented out for use with ZCOMM.
  1481.  
  1482.              px2; py9600         : Set parameters for link cmd
  1483.              set linkpass "Giznoid"
  1484.              set outalink "@kill; put \r\4;o"
  1485.              port 2; o      : Drop DTR on the linked port
  1486.              port 1; bye;
  1487.              set rcmdlog "c:/tmp/rcmds"
  1488.              speed 1200 putw "ATZ\r"
  1489.              set callers "c:/host/callers"
  1490.              :Do NOT remove the "." in ".%lib..." below
  1491.              set baudstr "@gosub .%lib/baud2.t"
  1492.              set challenge "@gosub .%lib/challeng.t"
  1493.              set welcome "@type welcome.txt; purgek; nulls 0"
  1494.              set password "Change This Already"
  1495.              set rxlog "c:/host/rxlog"; set txlog "c:/host/txlog";
  1496.              set unrestrict ""
  1497.              set xhelpfile "/host/xyamhelp.t"
  1498.              set home "/host"; cd
  1499.              set private "/private"; set messages "/host/messages"
  1500.              set emdir "/memo"; set twxfile "twx";
  1501.              set answerback "\r\nJ. Fred Muggs\r\n\21"
  1502.              set outahost "ATZ\r"
  1503.              set menu "/host/hostmenu"
  1504.              host
  1505.  
  1506.         27.3  Command Intercept Script
  1507.  
  1508.         After the remote caller in Host Operation keyboards each command,
  1509.         before that command line is executed, ZCOMM executes the rmtcheck
  1510.         string parameter. * This is also performed on commands received by
  1511.         ZMODEM protocol Command Download.
  1512.  
  1513.         The rmtcheck parameter may be set to invoke a READ ONLY script to
  1514.         examine the command line stored in the rmtcmd string parameter.  Such
  1515.         a script may modify the command by changing the contents of rmtcmd
  1516.         disconnect the user with a bye command, or perform other checks for
  1517.         the particular application.  The script can trap references to illegal
  1518.         disks, directories, or files, or redefine or add commands.
  1519.  
  1520.         SEE ALSO: pwd, rmtcheck, rmtcmd string parameters
  1521.  
  1522.         An example remote command inspection script is provided in checkrmt.t
  1523.         shown below.
  1524.  
  1525.              ss rmtcmd "(^arc[^  ]*)(.*)"
  1526.              if %z2 obey "!~pkxarc /v %z2>COM1"; goto done
  1527.  
  1528.         String Split the user's command (in rmtcmd) into a command name
  1529.         starting with "arc" and an argument separated by a space or tab.  If
  1530.         the split is successful, execute the DOS pkxarc program with a "/v"
  1531.  
  1532.  
  1533.         (C) 1990 Omen Tech Inc                       Chapter 27 Host Operation
  1534.  
  1535.  
  1536.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1537.         ZCOMM User Manual                                                  237
  1538.  
  1539.         (verbose archive listing) flag and the name of the archive atored in
  1540.         the z2 string parameter.  Program output is redirected to the modem.
  1541.  
  1542.              if %z1 echo "Must specify archive"; goto done
  1543.  
  1544.         If the "arc" command was found but no archive name was given,
  1545.         complain.
  1546.  
  1547.              ss rmtcmd "^whereis |^sd$|^sd |^ls |ls$"
  1548.              if !%z0 return
  1549.              obey "!~%rmtcmd>COM1"
  1550.  
  1551.         If the command is "whereis" with an argument, "sd" with ot without an
  1552.         argument, or "ls" with ot without an argument, execute the DOS command
  1553.         with output redirected to the modem.
  1554.  
  1555.         done:     set rmtcmd ""; return
  1556.  
  1557.         After command execution, clean up by clearing rmtcmd and return to
  1558.         ZCOMM.
  1559.  
  1560.         This script must be stored with the READ ONLY file attribute for
  1561.         normal operation.  For convenience in testing, use the unrestrict
  1562.         command to allow operation without the READ ONLY file attribute.  The
  1563.         ALT-1 and ALT-2 keys allow local keyboard access to commands without
  1564.         executing the rmtcmd string parameter.
  1565.  
  1566.         27.4  Callout Queue
  1567.  
  1568.         When entering host operation, and periodically thereafter, ZCOMM scans
  1569.         for script files specified by the callpath string parameter.** (If
  1570.         callpath is empty, this function is disabled.) The period in seconds
  1571.         between scans is set by the c numeric parameter.  Between these scans,
  1572.         ZCOMM waits for incoming calls.
  1573.  
  1574.         The pathspec callpath is expanded alphabetically, and a queue entry is
  1575.         made for each file found, up to a maximum of 40 entries.
  1576.  
  1577.         If one or more queue entries are found, the transmission speed is set
  1578.         to the speed in effect when the host command was given, and call1 is
  1579.         executed.  Typically, call1 disables the modem's autoanswer mode.
  1580.  
  1581.         Then each queue entry is executed as a source file.  Unless enclosed
  1582.         by double quotes, string parameters appearing in the commands (as
  1583.         %spar) are replaced by their values as the commands are read from
  1584.         disk.  These script files typically contain commands to check the
  1585.         time, set transmission speed, dial a telephone number, and transfer
  1586.         data.  The last line of each script usually contains a command to
  1587.         delete itself (or to rename itself so it will no longer be executed)
  1588.         after successful transfer of data.  If the data transfer fails, the
  1589.         script will not execute its last line, and will be retried on the next
  1590.  
  1591.  
  1592.         (C) 1990 Omen Tech Inc                        Chapter 27 Callout Queue
  1593.  
  1594.  
  1595.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1596.         ZCOMM User Manual                                                  238
  1597.  
  1598.         callout.
  1599.  
  1600.         After the queue entries have been exhausted, the transmission speed is
  1601.         set to the speed in effect when the host command was given, and call2
  1602.         is executed.  Usually, call2 sends a command to the modem to to make
  1603.         it answer incoming calls.
  1604.  
  1605.         ZCOMM then waits for incoming calls until it is again time to scan for
  1606.         outgoing scripts.
  1607.  
  1608.         27.5  Callback Security
  1609.  
  1610.         In security conscious applications, it may be desireable to limit
  1611.         access to specified users calling from authorized locations.  A
  1612.         callback scheme is demonstrated in the supplied script callback.t with
  1613.         a sample callback directory callback which references entries in the
  1614.         phone directory.
  1615.  
  1616.         Be sure to remove the echo commands before using this script.
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.         (C) 1990 Omen Tech Inc                   Chapter 27 Terminal Emulation
  1652.  
  1653.  
  1654.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1655.         ZCOMM User Manual                                                  239
  1656.  
  1657.         28.  TERMINAL (CRT) EMULATION
  1658.  
  1659.         ZCOMM emulates the H19, Z19, VT52, VT100, VT102, VT220, Wyse, and
  1660.         LSI-ADM3a terminals.
  1661.  
  1662.         28.1  Wyse 60 Emulation
  1663.  
  1664.         DOS flavors can emulate the Wyse 60 terminal given the command display
  1665.         wyse.  Wyse (wy60) terminal emulation supports operation with
  1666.         applications on Unix/Xenix systems.  The command display wyse enables
  1667.         Wyse screen emulation.
  1668.  
  1669.         Wyse emulation can place YAM in "PC Terminal" mode with 25 display
  1670.         lines (status line invisible) and "scan code" operation.  Since the
  1671.         SysRq key does not return a code to Zcomm, the sequence LeftShift Alt
  1672.         = sends the scancodes generated by the SysRq key.  To exit from VP/ix,
  1673.         hold down on the LeftShift and Alt keys, tap =, tap m (for menu), and
  1674.         then tap q before releasing the Alt and Shift keys.
  1675.  
  1676.  
  1677.         28.2  VT220 8 bit Controls
  1678.  
  1679.         The command display 8bit casuses ZCOMM to emulate the VT220 in "level
  1680.         2" operation.  The DEC "GR" display characters are not currently
  1681.         supported.
  1682.  
  1683.         Similarly, 8 bit Dasher terminal emulation is enabled by the display
  1684.         8bit command.
  1685.  
  1686.  
  1687.         28.3  Keyboard Mapping
  1688.  
  1689.         When enabled by a display mapkb command, DOS flavors of ZCOMM reassign
  1690.         keys to simulate the function keys of the emulated terminal.  Keyboard
  1691.         Mapping operartes only in the term function, where the mappings
  1692.         override the other meanings of the affected keys.
  1693.  
  1694.         The following key assignments for a PC-AT style 84 key keyboard are
  1695.         made by the distribution setup entry.
  1696.          VT100 Keyboard Mappings for PC-AT Keyboard
  1697.  
  1698.          PC Key.................VT100 keyCharacter
  1699.          F7.....................UP.......A    Cursor Keys
  1700.          F8.....................DOWN.....B
  1701.          F9.....................LEFT.....D
  1702.          F10....................RIGHT....C
  1703.          F1.....................PF1......P    PF Keys
  1704.          F2.....................PF2......Q
  1705.          F3.....................PF3......R
  1706.          F4.....................PF4......S
  1707.          Pad 0..................Pad 0....p    Number-Pad Keys
  1708.  
  1709.  
  1710.         (C) 1990 Omen Tech Inc                   Chapter 28 Terminal Emulation
  1711.  
  1712.  
  1713.         Version 17.61 TurboDial 2.33            Universal Line Printer Edition
  1714.         ZCOMM User Manual                                                  240
  1715.  
  1716.          ...
  1717.          Pad 9..................Pad 9....y
  1718.          Pad -..................Pad -....m
  1719.          Pad *(PrtSC)..........., comma..l (lowercase L)
  1720.          Del (.)................(.) (period)n
  1721.          Pad +..................ENTER....M
  1722.  
  1723.  
  1724.         Many users prefer a different keyboard layout for terminal emulation.
  1725.         Laptop computers that do not use a standard keyboard layout may not
  1726.         map well in Alternate Keypad Mode, suggesting different mappings.
  1727.  
  1728.         The mk command, K and N numeric parameters provide a flexible, if
  1729.         complex, keyboard mapping ability for various terminal emulations.
  1730.  
  1731.         ZCOMM's term function maps the keyboard by scanning a table of
  1732.         mappings for a match to the key's modified scan code, shift state, and
  1733.         the state of the emulation machine.  Iff the match is successful,
  1734.         special characters required by the emulation are sent to the
  1735.         application according to the class field, followed by the character(s)
  1736.         defined in the mapping.
  1737.  
  1738.         If you have a 101 key keyboard and ROM BIOS support for it, set the K
  1739.         numeric parameter to 1 to activate the extra keys,[1] and set the N
  1740.         numeric parameter to 1 to keep the keyboard in its preferred NumLock
  1741.         state at all times.
  1742.  
  1743.         With a regular keyboard, you must make more compromises in selecting
  1744.         your keyboard mapping, depending on which keys are important to your
  1745.         particular application.  In particular, the "5" key on the numeric pad
  1746.         doesn't work unless NumLock is on.  The four possible values of the N
  1747.         numeric parameter allow the keyboard to be placed in NumLock none of
  1748.         the time, all the time, when the emulation's Numeric Keypad mode is
  1749.         on, or when Alternate Keypad mode is on.
  1750.  
  1751.         To devise your own mapping, you will need to know the modified scan
  1752.         code, shift state, and ZCOMM internal value for each key you wish to
  1753.         use.  The modified scan code and internal value information are
  1754.         provided by the _ (underscore) command.
  1755.  
  1756.         To clear the keyboard mappings, give the mk command without arguments.
  1757.  
  1758.         For each term function keyboard mapping, the mk command takes four
  1759.         arguments.
  1760.  
  1761.  
  1762.  
  1763.         __________
  1764.  
  1765.          1. This may cause problems with certain versions of IBM BIOS.
  1766.  
  1767.  
  1768.  
  1769.         (C) 1990 Omen Tech Inc                   Chapter 28 Terminal Emulation
  1770.  
  1771.