home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / tt2man.zip / ttautoi.doc < prev    next >
Text File  |  1993-12-10  |  29KB  |  705 lines

  1.  
  2.                              TABLE OF CONTENTS                              
  3.  
  4.  
  5.           10. AUTOPILOT Language Overview
  6.             10.1 Introduction
  7.             10.2 Support For The Presentation Manager
  8.             10.3 Running an AUTOPILOT Program
  9.             10.4 The AUTOPILOT Script Search Order
  10.             10.5 Compiling An AUTOPILOT Program
  11.             10.6 Language Conventions And Definitions
  12.               10.6.1 Tokens
  13.                 10.6.1.1 Identifiers
  14.                 10.6.1.2 Labels
  15.                 10.6.1.3 Keywords
  16.                 10.6.1.4 Numeric Constants
  17.                 10.6.1.5 String Constants
  18.                 10.6.1.6 Operators
  19.               10.6.2 Comments
  20.               10.6.3 Conversions
  21.               10.6.4 Numeric And String Expressions And Operators
  22.               10.6.5 Conditional Expressions And Relational And Logical Operators
  23.               10.6.6 Order Of Precedence
  24.               10.6.7 Scope Of Identifiers
  25.               10.6.8 Syntax Notation
  26.               10.6.9 Customization Variable Access
  27.               10.6.10 Passing Variable Information
  28.             10.7 Definition Of Terms
  29.  
  30.  
  31.  
  32.                       10. AUTOPILOT Language Overview                       
  33.  
  34.  
  35.                              10.1 Introduction                              
  36.  
  37.  
  38. AUTOPILOT is a fully functional language which, because of its  interpretive
  39. nature, makes it very useful in general  OS/2  tool  building  applications.
  40. The next three chapters are devoted  to  presenting  the  entire  wealth  of
  41. programming, communications,  and  OS/2  features  and  functions  available
  42. within AUTOPILOT.
  43.  
  44. The AUTOPILOT language is interpretive. Sequences of automated commands  and
  45. responses (often called scripts) between the PC and Host are stored as  text
  46. files on the PC.
  47.  
  48. The remainder of this  chapter  provides  a  description  of  the  AUTOPILOT
  49. language conventions. The next chapter provides a brief description  of  the
  50. AUTOPILOT  Statements  ordered  by  Category  Of  Function  (i.e.  String
  51. Manipulation, Arithmetic,  etc.),  and  the  last  two  Chapter  provides  a
  52. detailed listing, in alphabetical order, of every statement available.
  53.  
  54.  
  55.  
  56.  
  57.                  10.2 Support For The Presentation Manager                  
  58.  
  59.  
  60. Since AUTOPILOT was originally architected for the  PC/DOS  environment,  it
  61. contains a large number of  statements  which  deal  with  the  Presentation
  62. Space as if it were a Fixed Font, 80 Column, 25 Row  environment  (the  size
  63. of the PC/DOS Screen).    To  allow  the  immediate  support  for  AUTOPILOT
  64. applications developed under PC/DOS to run under OS/2,  AUTOPILOT,  when  it
  65. encounters the first Statement addressing  the  PC/DOS  Screen,  provides  a
  66. Fixed Font, 80 Column by 25 Row Presentation Manager Window.
  67.  
  68. This allows ALL AUTOPILOT Statements  which  address  the  PC  Screen  (i.e.
  69. DISPLAY, CLS, COLOR) and which interact with the user  (i.e.  PROMPT,  MOUSE
  70. Movement) to deal with the OS/2 environment exactly as they had  in  PC/DOS.
  71. Also, since this window is owned by the Presentation Manager window, you  do
  72. not sacrifice the aesthetics, multi-tasking, and consistency provided by it.
  73.  
  74. In order to expand upon the capabilities of  TalkThru  in  the  Presentation
  75. Manager environment, new  Statements  have  been  added  to  allow  for  the
  76. Creation, Sizing and Movement of PM Windows over and above what  would  have
  77. been  meaningful  in  PC/DOS.    For  more  information  on  the  Statements
  78. implemented to support the  Presentation  Manager  directly,  refer  to  the
  79. Section, Managing Presentation Manager Windows, in  the  Chapter,  AUTOPILOT
  80. Statements By Category.
  81.  
  82.  
  83.  
  84.  
  85.                      10.3 Running an AUTOPILOT Program                      
  86.  
  87.  
  88. In TalkThru, AUTOPILOT programs can be requested in three ways:
  89.  
  90. 1. From a Phone Book by indicating its name in the Initialization Script  or
  91.    Process dialog during Phone Book Entry Add  or  Change.    Refer  to  the
  92.    Chapter, The Phone Book for more information on how this is done.
  93.  
  94. 2. From any Presentation Manager Menu or OS/2 Full Screen session  by  using
  95.    the following syntax:
  96.  
  97.   ┌──────────────────────────────────────────────────────────────────────┐
  98.   │ TT2PILOT <program-name> [Arguments ... ]                             │
  99.   └──────────────────────────────────────────────────────────────────────┘
  100.  
  101. 3. From a Terminal Emulator Assigned Key or Terminal Window  Button.  Choose
  102.    Keyboard or Buttons from the Settings pull down menu on  any  Phone  Book
  103.    or Terminal Emulator window.
  104.  
  105.  
  106.  
  107.  
  108.                    10.4 The AUTOPILOT Script Search Order                   
  109.  
  110.  
  111. When AUTOPILOT runs a script, it uses  the  following  search  algorithm  to
  112. find the script file:
  113.  
  114. 1. If the script file specification includes a directory,  the  script  file
  115.    must reside in that directory. No other directories will be searched.
  116.  
  117. 2. If  the  script  file  specification  does  not  include  a  directory,
  118.    directories are searched in the following order:
  119.  
  120.   o The directory of the parent script (this only applies  to  scripts  that
  121.     were called from another script).
  122.  
  123.   o The directory specified by the SCRIPT_DIRECTORY Customization Variable.
  124.  
  125.   o The  directories specified by the SCRIPT_ALTPATH Customization Variable.
  126.  
  127. If no extension is specified on the script name, files with an extension  of
  128. .CMP (compiled scripts) are searched first and files with  an  extension  of
  129. .SCR (source scripts) are searched next.
  130.  
  131.  
  132.  
  133.  
  134.                     10.5 Compiling An AUTOPILOT Program                     
  135.  
  136.  
  137. AUTOPILOT Programs may be compiled into a small execution-only format.   The
  138. advantages of compiling AUTOPILOT Programs are:
  139.  
  140. 1. Compiled programs are "execution-only".  They cannot be read or modified.
  141.  
  142. 2. Compiled programs load faster.  Large programs will usually load 3  to  4
  143.    times faster.
  144.  
  145. 3. Compiled programs take up less disk space.  Large programs  will  usually
  146.    take at least 33% less disk space.
  147.  
  148. 4. There are improvements in run-time speed and memory requirements.
  149.  
  150. Compiled  programs  may  be  used  interchangeably  with  normal  AUTOPILOT
  151. Programs. They may call, be called from, INCLUDE or be  INCLUDEd  in,  other
  152. AUTOPILOT Programs.  GLOBAL identifiers may be used with no constraints.
  153.  
  154. NOTE:
  155.    It is highly recommended  that  you  do  your  AUTOPILOT  development  in
  156.    source form. If a  run-time  error  occurs  during  the  execution  of  a
  157.    compiled  AUTOPILOT  program,  the  usual  error  display  is  presented.
  158.    However, since the original source file is not  available,  the  line  in
  159.    error is always reported as line 1.
  160.  
  161. AUTOPILOT Programs may be compiled by invoking the following program:
  162.  
  163.   ┌──────────────────────────────────────────────────────────────────────┐
  164.   │ TT2SCOMP <input-file> <output-file>                                  │
  165.   └──────────────────────────────────────────────────────────────────────┘
  166.  
  167. <input-file>
  168.       is a standard AUTOPILOT program file.  The default  directory  is  the
  169.       directory specified in the TalkThru  Customization  File  variable  as
  170.       SCRIPT_DIRECTORY.
  171.  
  172. <output-file>
  173.       is the name of the compiled program you wish to create.   The  default
  174.       directory is the same as <input-file>. There are no name  restrictions
  175.       though it is highly recommended  that  you  use  the  extension  .CMP.
  176.       This is because the AUTOPILOT search algorithm  (if  no  extension  is
  177.       supplied on a file name) is to search for a file  with  the  extension
  178.       of .CMP first and .SCR second.
  179.  
  180.  
  181. Examples:
  182.  
  183. Example1:
  184.  
  185.     TT2SCOMP test.scr test.cmp
  186.  
  187. In this example, test.scr MUST EXIST  in  the  directory  indicated  by  the
  188. SCRIPT_DIRECTORY Customization Variable.  test.cmp would be  placed  in  the
  189. same directory.
  190.  
  191. Example2:
  192.  
  193.     TT2SCOMP c:\source\test.scr c:\compiled\test.cmp
  194.  
  195. In this example, the source and compiled  programs  of  an  application  are
  196. being isolated so  that  development  and  production  environments  can  be
  197. separated.
  198.  
  199.  
  200.  
  201.  
  202.                  10.6 Language Conventions And Definitions                  
  203.  
  204.  
  205.  
  206. ┌───────────────┐
  207. │ 10.6.1 Tokens │
  208. └───────────────┘
  209.  
  210.   There are six classes of tokens: Identifiers,  Labels,  Keywords,  Numeric
  211.   Constants, String Constants, and Operators.
  212.  
  213.   Blanks, tabs, newlines, and comments may be used to separate tokens.
  214.  
  215.   ┌──────────────────────┐
  216.   │ 10.6.1.1 Identifiers │
  217.   └──────────────────────┘
  218.  
  219.     An identifier is a name used to  uniquely  identify  a  variable  field.
  220.     Letters, digits, and underscores (_) may be used.  The  first  character
  221.     must be a letter.  Only the  first  eight  characters  are  significant,
  222.     although up to 250 may be used. Upper and lower case are the same.
  223.  
  224.   ┌─────────────────┐
  225.   │ 10.6.1.2 Labels │
  226.   └─────────────────┘
  227.  
  228.     A label is a logical name used to identify a  particular  point  in  the
  229.     program text. Its format is the same as that of  an  identifier  with  a
  230.     colon (:) appended. Labels, when used as an object of a  GOTO,  PERFORM,
  231.     etc., should not have a  trailing  colon.  Labels  may  be  assigned  to
  232.     variables.  They  may  not  be  used  in  arithmetic  expressions.  The
  233.     following program fragment is valid:
  234.  
  235.          IF Y = 1 GOTO L1
  236.          SET A = L1
  237.          GOTO A
  238.  
  239.        L1:
  240.          DISPLAY "HERE WE ARE"
  241.  
  242.   ┌───────────────────┐
  243.   │ 10.6.1.3 Keywords │
  244.   └───────────────────┘
  245.  
  246.     The keywords reserved in  the  AUTOPILOT  language  are  listed  in  the
  247.     Appendix, AUTOPILOT Reserved Words  in  this  manual.  Keywords  may  be
  248.     specified in upper or lower case.
  249.  
  250.   ┌────────────────────────────┐
  251.   │ 10.6.1.4 Numeric Constants │
  252.   └────────────────────────────┘
  253.  
  254.     Numeric  constants  may  be  specified  as  a  sequence  of  characters
  255.     representing a number in the form 999.99. A leading sign,  '+'  or  '-',
  256.     is allowed. The decimal point is optional. If it is specified, at  least
  257.     one digit must follow. A sequence of characters that starts  with  a  ^H
  258.     or ^h (carat H) indicates a hexadecimal number. For  example  a  decimal
  259.     511 can be written as ^h1FF and a decimal 10 as ^ha.
  260.  
  261.   ┌───────────────────────────┐
  262.   │ 10.6.1.5 String Constants │
  263.   └───────────────────────────┘
  264.  
  265.     A string constant is a  sequence  of  characters  surrounded  by  double
  266.     quotes, as in "This is a string". If a double quote is to be used  as  a
  267.     character in a string constant, it  must  be  written  as  two  adjacent
  268.     double quotes. The maximum size of a string  constant  in  AUTOPILOT  is
  269.     250 bytes.
  270.  
  271.     Any character in a string may be represented in  hexadecimal  format  by
  272.     specifying a leading ^H or ^h followed by  two  hexadecimal  characters.
  273.     For  example, an ASCII line feed could be imbedded in a string as  "This
  274.     is Line 1^H0A and this Line 2". A ^ (carat) may be specified as a ^^.  A
  275.     control character may also be imbedded in a  string  by  following  a  ^
  276.     with a letter. For example a Control B may be imbedded  as  "Here  is  a
  277.     Control-B -->>^B<--". A string constant may be up to 250  characters  in
  278.     length (not including the surrounding double quotes).
  279.  
  280.   ┌────────────────────┐
  281.   │ 10.6.1.6 Operators │
  282.   └────────────────────┘
  283.  
  284.     There are five types of operators: arithmetic,  string,  relational  and
  285.     logical.
  286.  
  287.     Arithmetic Operators:
  288.  
  289.         +    addition
  290.         -    subtraction
  291.         /    division
  292.         *    multiplication
  293.         \    integer division
  294.         MOD  modulo arithmetic
  295.  
  296.     String Operators:
  297.  
  298.         &    concatenation
  299.  
  300.     Relational Operators:
  301.  
  302.         >>     greater than
  303.         >>=    greater than or equal to
  304.         =      equal to
  305.         <=     less than or equal to
  306.         <      less than
  307.         <>     not equal to
  308.         IS     used in attribute testing
  309.         ISNOT
  310.  
  311.     Logical operators:
  312.  
  313.         AND    Logical AND
  314.         OR     Logical OR
  315.         NOT    Logical NOT
  316.         BITAND Bitwise AND operator.  Compares each bit of its first operand  
  317.                to the corresponding bit of its second operand. If both  bits  are
  318.                1, the corresponding result bit is set to  1.  Otherwise  the
  319.                corresponding result bit is set to 0.
  320.         BITOR  Bitwise inclusive-OR operator. Compares each bit of its first
  321.                operand to the corresponding  bit of its  second operand.  If
  322.                either bit is 1, the corresponding result bit is 1. Otherwise
  323.                the corresponding result bit is set to 0.
  324.         BITXOR Bitwise exclusive-OR operator. Compares each bit of its first
  325.                operand to  the corresponding bit  of its second operand.  If  
  326.                one bit is 1 and the other bit is 0, the corresponding result  
  327.                bit is set to 1. Otherwise the corresponding result bit is 0.
  328.         BITNOT Bitwise complement operator.  Changes  each bit  of a  single
  329.                operand. If the bit is 0, the corresponding result bit is set
  330.                to 1. Otherwise the corresponding result bit is set to 0.
  331.  
  332. ┌─────────────────┐
  333. │ 10.6.2 Comments │
  334. └─────────────────┘
  335.  
  336.   Comments do not affect the execution of a program, they are used only  for
  337.   documentation purposes. There are two methods of commenting:
  338.  
  339.    o A block comment may be created by using the characters /*  to  start  a
  340.      comment and the characters */ to end a comment. Block comments  may  be
  341.      nested.
  342.  
  343.    o A single line comment may be created by using the ; character to  start
  344.      the comment. All characters to the end of the line are considered  part
  345.      of the comment.
  346.  
  347. ┌────────────────────┐
  348. │ 10.6.3 Conversions │
  349. └────────────────────┘
  350.  
  351.   A number of operators and commands may, depending on their  operands,  use
  352.   a converted value of an operand.
  353.  
  354.   Arithmetic operators or commands where the operand must assume  a  numeric
  355.   value will cause a string value to be converted to  a  numeric  value.  If
  356.   the string value is not in a correct numerical format the  value  of  zero
  357.   will be used. For example, "+123.07" will be converted  to  123.07,  "dog"
  358.   will be converted to zero.
  359.  
  360.   String operators or commands where the operand must assume a string  value
  361.   will cause a numeric  value  to  be  converted  to  a  string  value.  For
  362.   example, 123.07 will be converted to "123.07".
  363.  
  364.   In relational operations, the constants on each side of the operator  must
  365.   be of the same format. If they are not,  the  one  to  the  right  of  the
  366.   operator will be converted to the same format as the one on the  left.  No
  367.   justification or  padding  will  occur.  For  example,  in  the  following
  368.   instructions:
  369.  
  370.      set A = "007"   /* Set a character constant */
  371.      set B = 7     /* Set a numeric constant */
  372.      if A = B goto label
  373.  
  374.   the comparison would fail because "007" is not equal  to  7.  But  if  the
  375.   comparison read:
  376.  
  377.      if B = A goto label
  378.  
  379.   it would succeed because  "007"  would  be  successfully  converted  to  a
  380.   numeric constant of 7.
  381.  
  382. ┌─────────────────────────────────────────────────────┐
  383. │ 10.6.4 Numeric And String Expressions And Operators │
  384. └─────────────────────────────────────────────────────┘
  385.  
  386.   An expression may simply be a  numeric  constant,  a  string  constant,  a
  387.   variable, or a function.  It  may  also  be  used  to  combine  constants,
  388.   variables and functions to produce a single value.
  389.  
  390.   Arithmetic operators perform operations  such  as  addition,  subtraction,
  391.   and multiplication. They all produce a value that is a number.
  392.   
  393.            Operator  Operation                Sample Expression    
  394.            *         Multiplication           X * Y            
  395.            /         Floating Point Division  X / Y            
  396.            \         Integer Division         X \ Y            
  397.            MOD       Modulo Arithmetic        X MOD Y          
  398.            ++        Addition                 X + Y            
  399.            -         Subtraction              X - Y            
  400.            &         Concatenation            "The Value Is " & X  
  401.  
  402.   Integer division is  denoted  by  the  backslash  (\).  The  operands  are
  403.   rounded to integers before the division is performed and the  quotient  is
  404.   truncated to an integer.
  405.  
  406.   For Example:
  407.  
  408.       13 \ 3 = 4
  409.       13.7 \ 3.9 = 3
  410.  
  411.   Modulo arithmetic is denoted by the operator MOD.  It  gives  the  integer
  412.   value that is the remainder of an integer division.
  413.  
  414.   For example:
  415.  
  416.       13 MOD 3 = 1
  417.       13.7 MOD 3.9 = 1
  418.  
  419.   There is one string operator called concatenation.  Concatenation  is  the
  420.   joining together of two strings and is  signified  by  the  ampersand  (&)
  421.   symbol.
  422.  
  423. ┌─────────────────────────────────────────────────────────────────────┐
  424. │ 10.6.5 Conditional Expressions And Relational And Logical Operators │
  425. └─────────────────────────────────────────────────────────────────────┘
  426.  
  427.   A conditional expression has a value of true or false. It  may  be  simply
  428.   an expression or it may be expressions  combined  with  relational  and/or
  429.   logical  operators.  The  result  is  usually  used  to  make  a  decision
  430.   regarding program flow. (See the IF Statement).
  431.  
  432.   Relational operators compare two values. The value may be  either  numeric
  433.   or string. If one value is numeric and the  other  value  is  string,  the
  434.   operand to the right of the relational operator is converted to  the  same
  435.   type as the operand to the  left  of  the  operator.  The  result  of  the
  436.   comparison is either true or false.
  437.  
  438.            Operator  Relation Tested           Sample Expression  
  439.            =         Equality                  X = Y          
  440.            <>        Inequality                X <> Y       
  441.            <         Less than                 X < Y         
  442.            >         Greater than              X > Y         
  443.            <=        Less than or equal to     X <= Y        
  444.            >=        Greater than or equal to  X >= Y        
  445.            IS        Test for specific         X IS Y         
  446.            ISNOT     bit values                X ISNOT Y      
  447.  
  448.  
  449.   String comparisons are essentially alphabetical. The ASCII codes  of  each
  450.   character are compared. If all the ASCII codes are the same,  the  strings
  451.   are equal. Otherwise, as soon as the ASCII codes differ, the  string  with
  452.   the lower code is considered less than the other string.
  453.  
  454.   The IS and ISNOT operators are special operators generally  used  to  test
  455.   screen  attributes  (see  the  ATTRIBUTE  function).  Essentially,  the
  456.   operators test bit masks though it  is  not  necessary  to  know  how  the
  457.   operators work to test attributes.
  458.  
  459.   The first operand is considered the value to be tested.  It  is  converted
  460.   to an 8 bit integer. The  second  operand  is  the  mask  that  the  first
  461.   operand is tested against. It is converted to a 16 bit integer  where  the
  462.   high order 8 bits signify which bits are to be tested and  the  low  order
  463.   bits are the value those tested bits must  have.  More  specifically,  the
  464.   operators do a logical AND between operand 1 and the high order 8 bits  of
  465.   operand 2 and compares the result of this value with the low order 8  bits
  466.   of operand 2. If the comparison is equal then the condition  is  TRUE  for
  467.   IS and FALSE for ISNOT. If the comparison is not equal, the  condition  is
  468.   TRUE for ISNOT and FALSE for IS.
  469.  
  470.   For example, to see if bit 1 and bit 3 are set to 1 and bit 2  and  bit  5
  471.   are set to 0, the following test could be used.
  472.  
  473.       X IS ^H1705
  474.  
  475.   If a conditional expression is a simple expression, that is,  one  without
  476.   a relational operator, then it is considered true  if  the  expression  is
  477.   not equal to zero and false if the expression is equal  to  zero.  If  the
  478.   expression returns a string value  then  it  is  considered  true  if  the
  479.   length of the string is greater than zero and false if the length  of  the
  480.   string is equal to zero.
  481.  
  482.   Logical operators are used to connect two or more relations and  return  a
  483.   true or false value to be used in a decision. The  logical  operators  are
  484.   NOT, AND, and OR.
  485.  
  486.   Some examples of logical operators in an IF statement:
  487.  
  488.      IF x > 10 AND x < 20 . . .
  489.      IF y = 1 OR Y = 2 OR Y = 3 . .  .
  490.      IF NOT FOUND . . .
  491.      IF ATTRIBUTE IS _PROTECTED
  492.       AND ( HOST_CURSOR_ROW < 5
  493.           OR HOST_CURSOR_ROW >> 20 ) . . .
  494.  
  495. ┌────────────────────────────┐
  496. │ 10.6.6 Order Of Precedence │
  497. └────────────────────────────┘
  498.  
  499.   Expressions are evaluated from left to right with the following  order  of
  500.   precedence assigned to the operators:
  501.  
  502.                    Level     Operator       Name
  503.                    1         ()             Function,Array
  504.                    2         -              Arithmetic Negation
  505.                    3         NOT            Logical  NOT
  506.                              BITNOT         Bit testing
  507.                    4         *              Multiplication
  508.                              /              Division
  509.                              \              Integer  
  510.                              MOD            Remainder
  511.                              BITAND         Bit testing
  512.                    5         +              Addition
  513.                              -              Subtraction
  514.                    6         &              String Concatenation
  515.                    7*        <              Less than
  516.                              >              Greater Than
  517.                              <=             Less than or equal  to
  518.                              >=             Greater  than  orequal  to
  519.                              =              Equality
  520.                              <>             Inequality
  521.                              IS             Attribute testing
  522.                              ISNOT          Attribute testing
  523.                    8         AND            Logical AND
  524.                              OR             Logical OR
  525.                    9         =              Simple Assignment
  526.  
  527.           * <_>"NOT" may appear in front of any of the level 7 operators.    
  528.  
  529. ┌─────────────────────────────┐
  530. │ 10.6.7 Scope Of Identifiers │
  531. └─────────────────────────────┘
  532.  
  533.   Identifiers used within one program are not associated  in  any  way  with
  534.   identifiers used in another program unless specified as  GLOBAL.  See  the
  535.   GLOBAL statement for more information.
  536.  
  537.   Labels from one program are never  associated  with  labels  from  another
  538.   program.
  539.  
  540. ┌────────────────────────┐
  541. │ 10.6.8 Syntax Notation │
  542. └────────────────────────┘
  543.  
  544.   CAPITALIZED WORDS indicate language keywords which should be  regarded  as
  545.   being reserved for their specified  use  except  when  used  in  a  quoted
  546.   character string.
  547.  
  548.   Words between < and > signs indicate a value  which  should  be  either  a
  549.   "numeric expression", "string expression" or "key". The meaning  of  these
  550.   three is explained in the Definition of Terms section of this chapter.
  551.  
  552.   The characters , = + - / * < > & \ are reserved  words  whose  meaning  is
  553.   defined in the  Language  Conventions  and  Definitions  section  of  this
  554.   chapter.
  555.  
  556.   Operands or expressions within chain  brackets,  {  and  },  are  optional
  557.   values,  one  of  which  must  be  encoded  into  the  statement  being
  558.   constructed. If one of the optional values is underlined then  that  value
  559.   is the default and may be omitted.
  560.  
  561.   An operand or expression within square brackets, [ and ], may be  regarded
  562.   as optional to the statement being constructed.
  563.  
  564.   A string of periods, ..., following an  item  indicates  that  it  may  be
  565.   repeated a number of times.
  566.  
  567. ┌──────────────────────────────────────┐
  568. │ 10.6.9 Customization Variable Access │
  569. └──────────────────────────────────────┘
  570.  
  571.   The  value  of  a  Customization  Variable  defined  in  the  TalkThru
  572.   Customization File (issued  as  TALKTHRU.DEF  and  modified  by  selecting
  573.   System Configuration from the  Utilities  pull  down  menu  on  any  Phone
  574.   Book), may be accessed in a program with the following construct:
  575.  
  576.       %<variable_name>
  577.  
  578.   where <variable_name> is defined in the TalkThru Customization File.
  579.  
  580.   For example, assuming that the statement
  581.  
  582.               DATA_DIRECTORY=C:\TALKTHRU\DATA
  583.  
  584.   is in the TalkThru Customization File, the program statement
  585.  
  586.               IF %DATA_DIRECTORY="C:\XXXXX"
  587.  
  588.   is equivalent to
  589.  
  590.               if "C:\TALKTHRU\DATA" = "C:\XXXXX"
  591.  
  592. ┌──────────────────────────────────────┐
  593. │ 10.6.10 Passing Variable Information │
  594. └──────────────────────────────────────┘
  595.  
  596.   Variable information can be passed to AUTOPILOT  Programs  from  OS/2  and
  597.   can be passed from one AUTOPILOT Program to  another.  AUTOPILOT  Programs
  598.   reference parameters passed by using a special identifier  format  of  %n,
  599.   where n is a number from 1 to the number of parameters  passed.  Also,  %0
  600.   will contain a number from 0 -  n  indicating  the  number  of  parameters
  601.   passed
  602.  
  603.   How variables are passed and the AUTOPILOT syntax  to  reference  them  is
  604.   best presented as an example. If the following OS/2 Command
  605.  
  606.               TT2PILOT sample.scr ABC
  607.  
  608.   was issued, and sample.scr was written as
  609.  
  610.               SET inparm = %1   ; %1 is the parameter passed
  611.  
  612.   the value of inparm would be "ABC".
  613.  
  614.   If sample1.scr were written as
  615.  
  616.               set parm = "XYZ"
  617.               run script "sample2.scr" using "ABC" , parm
  618.  
  619.   and sample2.scr were written as
  620.  
  621.               set inp1 = %1
  622.               set inp2 = %2
  623.  
  624.   inp1 would be "ABC" and inp2 would be "XYZ"
  625.  
  626.   WARNING:
  627.        If a %n value is not passed to a script, the default  value  for  any
  628.        %n variable is zero.
  629.  
  630.  
  631.  
  632.  
  633.                           10.7 Definition Of Terms                          
  634.  
  635.  
  636. The terms number, string, and key appear  throughout  this  guide.  For  the
  637. purposes of the AUTOPILOT language, they have the following definition:
  638.  
  639.   number
  640.      A numeric expression.
  641.      
  642.      Any expression, constant, function, or identifier. String  values  will
  643.      be converted to numeric values. String values which are not  in  proper
  644.      numeric format will be converted to zero. The  following  examples  are
  645.      all valid representations of the number 10.
  646.      
  647.      10
  648.      "10"
  649.      LEN("abcdefghij")
  650.      STR_LEFT("10xxxxx",2)
  651.  
  652.   string
  653.      A string expression. 
  654.      
  655.      Any expression, constant, function, or identifier. Numeric values  will
  656.      be converted to string values. The following  examples  are  all  valid
  657.      representations of the string "3270". 
  658.      
  659.      "3270"
  660.      3270
  661.      STR_LEFT("3270xx xx" ,4)
  662.  
  663.   key
  664.      A 3270/Asynchronous key or function key
  665.  
  666.           ATTN           BACK_TAB      BACKSPACE
  667.           BACKTAB        BREAK         CLEAR
  668.           CURSOR_SEL     DEL_LINE      DELETE
  669.           DELETE_LINE    DOWN          DUP
  670.           ENTER          ERASE_EOF     ERASE_EOL
  671.           ERASE_EOS      ERASE_INPUT   FM
  672.           HOME           INS_LINE      INSERT
  673.           INSERT_LINE    KEYPAD_01     KEYPAD_02
  674.           KEYPAD_03      KEYPAD_04     KEYPAD_05
  675.           KEYPAD_06      KEYPAD_07     KEYPAD_08
  676.           KEYPAD_COMMA   KEYPAD_ENTER  KEYPAD_MINUS
  677.           KEYPAD_PERIOD  LEFT          NEWLINE
  678.           PA1            PA2           PA3
  679.           PF1            PF10          PF11
  680.           PF12           PF13          PF14
  681.           PF15           PF16          PF17
  682.           PF18           PF19          PF2
  683.           PF20           PF21          PF22
  684.           PF23           PF24          PF3
  685.           PF4            PF5           PF6
  686.           PF7            PF8           PF9
  687.           POWER_UP       RESET         RIGHT
  688.           SEND_LINE      SET_MODE      SYSREQ
  689.           TAB            UF10          UF11
  690.           UF12           UF13          UF14
  691.           UF15           UF16          UF17
  692.           UF18           UF19          UF20
  693.           UF6            UF7           UF8
  694.           UF9            UP 
  695.  
  696.          Or, An ASCII Control Code (Asynchronous only).
  697.  
  698.                ACK  BEL   BSC  CAN  CR   DCn  
  699.                DEL  DLE   EM   ENQ  EOT  ESC  
  700.                ETB  ETX   FF   FS   GS   HT   
  701.                LF   NAK   NUL  RS   SI   SO   
  702.                SOH  STX   SUB  SYN  US   VT   
  703.                XON  XOFF            
  704.  
  705.