home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / rexl / rexlmain.doc < prev    next >
Text File  |  1992-08-16  |  218KB  |  5,662 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                      RExL  Version 2.11
  10.  
  11.  
  12.      A Rule-based Applications Development Environment
  13.  
  14.                             From
  15.  
  16.                     The Software Loft,
  17.                     Kiemar House,
  18.                     Shanakiel Road,
  19.                     Cork City,
  20.                     Ireland.
  21.  
  22.                     Tel: [+353] 21-302511
  23.                     Fax: [+353] 21-343562
  24.  
  25.           Internet:      softloft@iruccvax.ucc.ie
  26.  
  27.           Compuserve:    100042,1237
  28.  
  29.  
  30.  
  31.               -- Part I -- The Main Manual --
  32.  
  33.  
  34.  
  35.  
  36.                         _______
  37.                    ____|__     |                (R)
  38.                 --|       |    |-------------------
  39.                   |   ____|__  |  Association of
  40.                   |  |       |_|  Shareware
  41.                   |__|   o   |    Professionals
  42.                 -----|   |   |---------------------
  43.                      |___|___|    MEMBER
  44.                      
  45.  
  46.  
  47.  
  48. This program is produced by  a member of the Association  of
  49. Shareware Professionals (ASP). ASP  wants to make sure  that
  50. the shareware principle works for you. If you are unable  to
  51. resolve a
  52. shareware-related problem with an  ASP member by  contacting
  53. the member  directly,  ASP may  be  able  to help.  The  ASP
  54. Ombudsman can help you resolve a dispute or problem with  an
  55. ASP member,  but  does  not provide  technical  support  for
  56. members' products. Please write to the ASP Ombudsman at  545
  57. Grover Road, Muskegon, MI 49442-  9427 or send a  Compuserve
  58. message via CompuServe Mail to ASP Ombudsman 70007,3536.
  59.  
  60.                              o
  61.  
  62. Information in this  document is subject  to change  without
  63. notice and does  not represent a commitment  on the part  of
  64. The Software Loft.   The software  described in this  manual
  65. may be  used and  copied within  the  terms of  the  license
  66. agreement.
  67.  
  68. Turbo C, Turbo Pascal and Sidekick are registered trademarks
  69. of  Borland  International.    dBase  III+  and  dBase   are
  70. registered trademarks of Ashton-Tate.
  71.  
  72. (C)  Copyright,  The  Software  Loft,  1992.    All   rights
  73. reserved.  If you have  any difficulties, please contact  us
  74. at the address above.
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.     
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.                        Contents
  109.  
  110.  
  111.  
  112.      Chapter 1  Introduction                          3
  113.         1.1  What is RExL . . . . . . . . . . . . . . 3
  114.         1.2  System requirements  . . . . . . . . . . 4
  115.         1.3  Installation . . . . . . . . . . . . . . 4
  116.         1.4  Features . . . . . . . . . . . . . . . . 5
  117.            1.4.1  Editor  . . . . . . . . . . . . . . 5
  118.            1.4.2  Runtime-Debugger  . . . . . . . . . 6
  119.            1.4.3  Language  . . . . . . . . . . . . . 6
  120.         1.5  The Manual . . . . . . . . . . . . . . . 7
  121.  
  122.      Chapter 2  Language                              9
  123.         2.1  Variables  . . . . . . . . . . . . . . . 9
  124.         2.2  Constants  . . . . . . . . . . . . . .  10
  125.         2.3  Arrays . . . . . . . . . . . . . . . .  11
  126.         2.4  Operators  . . . . . . . . . . . . . .  12
  127.            2.4.1  Mathematical Operators  . . . . .  12
  128.            2.4.2  Comparison Operators  . . . . . .  14
  129.         2.5  Functions  . . . . . . . . . . . . . .  14
  130.         2.6  Expressions  . . . . . . . . . . . . .  16
  131.         2.7  Assignments  . . . . . . . . . . . . .  18
  132.         2.8  Statements . . . . . . . . . . . . . .  19
  133.         2.9  Inference  . . . . . . . . . . . . . .  19
  134.         2.10  Rules and Execution . . . . . . . . .  20
  135.         2.11  Subrules  . . . . . . . . . . . . . .  21
  136.         2.12  Rule Modifiers  . . . . . . . . . . .  22
  137.            2.12.1  BackTo . . . . . . . . . . . . .  23
  138.            2.12.2  Not  . . . . . . . . . . . . . .  23
  139.            2.12.3  While  . . . . . . . . . . . . .  23
  140.            2.12.4  Multi  . . . . . . . . . . . . .  24
  141.            2.12.5  Single . . . . . . . . . . . . .  24
  142.            2.12.6  Zap  . . . . . . . . . . . . . .  24
  143.         2.13  Other Modifiers . . . . . . . . . . .  24
  144.  
  145.      Chapter 3  Quick Start                          27
  146.         3.1  Introduction . . . . . . . . . . . . .  27
  147.         3.2  Creating an Application  . . . . . . .  28
  148.         3.3  Running the Application  . . . . . . .  29
  149.         3.4  Expanding the Application  . . . . . .  30
  150.  
  151.  
  152.                              i
  153.  
  154.  
  155.  
  156.         3.5  Debugging the Application  . . . . . .  32
  157.  
  158.      Chapter 4  The Editor                           35
  159.         4.1  Introduction . . . . . . . . . . . . .  35
  160.         4.2  Interface Conventions  . . . . . . . .  36
  161.         4.3  Editor Basics  . . . . . . . . . . . .  39
  162.            4.3.1  File menu . . . . . . . . . . . .  41
  163.            4.3.2  Edit menu . . . . . . . . . . . .  43
  164.            4.3.3  Run menu  . . . . . . . . . . . .  43
  165.            4.3.4  Lists menu  . . . . . . . . . . .  44
  166.            4.3.5  Options menu  . . . . . . . . . .  46
  167.            4.3.6  Import menu . . . . . . . . . . .  47
  168.         4.4  Using the Editor . . . . . . . . . . .  49
  169.            4.4.1  Entering Statements . . . . . . .  50
  170.            4.4.2  Entering Rules  . . . . . . . . .  51
  171.            4.4.3  Entering Screens  . . . . . . . .  52
  172.         4.5  Editor Lists . . . . . . . . . . . . .  52
  173.            4.5.1  Reference List  . . . . . . . . .  53
  174.            4.5.2  Rule List . . . . . . . . . . . .  53
  175.            4.5.3  Screen List . . . . . . . . . . .  53
  176.            4.5.4  Unused Rule List  . . . . . . . .  54
  177.            4.5.5  Unused Screen List  . . . . . . .  54
  178.            4.5.6  Variable List . . . . . . . . . .  54
  179.            4.5.7  Function List . . . . . . . . . .  55
  180.         4.6  Other Functions  . . . . . . . . . . .  56
  181.            4.6.1  Graphic Rule Display  . . . . . .  56
  182.            4.6.2  Miscellaneous keystrokes  . . . .  57
  183.               4.6.2.1  Cut and paste  . . . . . . .  57
  184.               4.6.2.2  Editing keys . . . . . . . .  57
  185.               4.6.2.3  Other keys . . . . . . . . .  58
  186.  
  187.      Chapter 5  Screens in RExL                      59
  188.         5.1  Introduction . . . . . . . . . . . . .  59
  189.         5.2  Fields . . . . . . . . . . . . . . . .  60
  190.            5.2.1  Introduction  . . . . . . . . . .  60
  191.               5.2.1.1  Field Properties . . . . . .  60
  192.            5.2.2  Output Fields . . . . . . . . . .  61
  193.            5.2.3  Input Fields  . . . . . . . . . .  61
  194.            5.2.4  Toggle List Fields  . . . . . . .  61
  195.            5.2.5  Check Box Fields  . . . . . . . .  62
  196.            5.2.6  Radio Button Fields . . . . . . .  62
  197.            5.2.7  Menu Fields . . . . . . . . . . .  63
  198.         5.3  Screen Types . . . . . . . . . . . . .  63
  199.            5.3.1  Dialog Screen . . . . . . . . . .  65
  200.            5.3.2  Display Screen  . . . . . . . . .  65
  201.            5.3.3  Help Screen . . . . . . . . . . .  66
  202.            5.3.4  Menu Screen . . . . . . . . . . .  66
  203.            5.3.5  Print Screen  . . . . . . . . . .  67
  204.  
  205.  
  206.                              ii
  207.  
  208.  
  209.  
  210.            5.3.6  Subscreens  . . . . . . . . . . .  67
  211.  
  212.      Chapter 6  Using the Screen Designer            69
  213.         6.1  Starting the Screen Designer . . . . .  69
  214.         6.2  Basic Design . . . . . . . . . . . . .  70
  215.         6.3  Fields in the Screen Designer  . . . .  71
  216.               6.3.0.1  Output . . . . . . . . . . .  73
  217.               6.3.0.2  Input  . . . . . . . . . . .  73
  218.               6.3.0.3  Toggle . . . . . . . . . . .  73
  219.               6.3.0.4  Check  . . . . . . . . . . .  74
  220.               6.3.0.5  Radio  . . . . . . . . . . .  74
  221.               6.3.0.6  Menu . . . . . . . . . . . .  74
  222.         6.4  Block Operations . . . . . . . . . . .  75
  223.            6.4.1  Block Painting  . . . . . . . . .  75
  224.            6.4.2  Align . . . . . . . . . . . . . .  76
  225.            6.4.3  Box . . . . . . . . . . . . . . .  76
  226.            6.4.4  Delete  . . . . . . . . . . . . .  77
  227.            6.4.5  Move  . . . . . . . . . . . . . .  77
  228.            6.4.6  Copy  . . . . . . . . . . . . . .  78
  229.            6.4.7  Fill  . . . . . . . . . . . . . .  78
  230.            6.4.8  Save  . . . . . . . . . . . . . .  79
  231.            6.4.9  Under shadow  . . . . . . . . . .  79
  232.         6.5  Sub-screens  . . . . . . . . . . . . .  79
  233.         6.6  Field control menu . . . . . . . . . .  80
  234.               6.6.0.1  Active color . . . . . . . .  81
  235.               6.6.0.2  Inactive color . . . . . . .  81
  236.               6.6.0.3  Delete . . . . . . . . . . .  82
  237.               6.6.0.4  Expression . . . . . . . . .  82
  238.               6.6.0.5  Recalc . . . . . . . . . . .  82
  239.               6.6.0.6  Justify  . . . . . . . . . .  82
  240.               6.6.0.7  Width  . . . . . . . . . . .  82
  241.               6.6.0.8  Necessary  . . . . . . . . .  83
  242.               6.6.0.9  Precision  . . . . . . . . .  83
  243.               6.6.0.10  Validation  . . . . . . . .  83
  244.         6.7  Miscellaneous Functions  . . . . . . .  83
  245.               6.7.0.1  Changing Field Types . . . .  83
  246.               6.7.0.2  Field Utility Keys . . . . .  84
  247.               6.7.0.3  Line Drawing . . . . . . . .  84
  248.               6.7.0.4  Other Editing Keys . . . . .  86
  249.               6.7.0.5  Lists in the Screen
  250.                        Designer . . . . . . . . . .  86
  251.               6.7.0.6  Miscellaneous Keys . . . . .  87
  252.  
  253.      Chapter 7  The Runtime-Debugger                 89
  254.         7.1  Introduction . . . . . . . . . . . . .  89
  255.         7.2  Debugger Basics  . . . . . . . . . . .  89
  256.            7.2.1  File menu . . . . . . . . . . . .  91
  257.            7.2.2  Debug menu  . . . . . . . . . . .  91
  258.  
  259.  
  260.                             iii
  261.  
  262.  
  263.  
  264.            7.2.3  Lists menu  . . . . . . . . . . .  92
  265.            7.2.4  Options menu  . . . . . . . . . .  94
  266.         7.3  Using the Debugger . . . . . . . . . .  95
  267.            7.3.1  Step  . . . . . . . . . . . . . .  96
  268.            7.3.2  Trace . . . . . . . . . . . . . .  97
  269.            7.3.3  Watch . . . . . . . . . . . . . .  97
  270.            7.3.4  Expression Evaluate . . . . . . .  98
  271.            7.3.5  Animation . . . . . . . . . . . .  98
  272.            7.3.6  To Here . . . . . . . . . . . . .  99
  273.         7.4  Miscellaneous keystrokes . . . . . . .  99
  274.         7.5  Command Line Parameters  . . . . . . . 100
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.                              iv
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                         Tables
  325.  
  326.  
  327.      Table 2.1: Valid and Invalid Variable Names  . .10
  328.      Table 2.2: Numeric and String Constants  . . . .11
  329.      Table 2.3: Array Subscription  . . . . . . . . .12
  330.      Table 2.4: RExL Math Operators . . . . . . . . .13
  331.      Table 2.5: Logical Operators . . . . . . . . . .14
  332.      Table 2.6: Comparison Operators  . . . . . . . .14
  333.      Table 2.7: Function Families . . . . . . . . . .15
  334.      Table 2.8: Some Expressions  . . . . . . . . . .16
  335.      Table 2.9: Operator Precedence . . . . . . . . .17
  336.      Table 2.10: Examples of Operator Precedence  . .18
  337.      Table 2.11: Examples of Assignments  . . . . . .19
  338.      Table 2.12: Rule Modifiers . . . . . . . . . . .23
  339.      Table 2.13: Other Modifiers  . . . . . . . . . .25
  340.      Table 2.14: Expression Truth Values  . . . . . .25
  341.      Table 4.1: ASCII Color Translation Table . . . .48
  342.      Table 4.2: Function Parameter Abbreviations  . .55
  343.      Table 5.1: Screen Types  . . . . . . . . . . . .64
  344.      Table 5.2: Valid Combinations of Screen and Field
  345.                 Type  . . . . . . . . . . . . . . . .64
  346.      Table 6.1: Screen Designer Cursor Keys . . . . .71
  347.      Table 6.2: Valid Field Sizes . . . . . . . . . .72
  348.      Table 6.3: Valid Field Attributes  . . . . . . .81
  349.      Table 6.4: Keys in Line Draw Mode  . . . . . . .86
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.                              v
  369.       - Main Manual.                    Page: 3 -
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.                          Chapter 1
  379.  
  380.                         Introduction
  381.  
  382.  
  383. This chapter  provides a  brief  introduction to  RExL,  its
  384. system requirements, installation and capabilities and quick
  385. signpost to the rest of the manual.
  386.  
  387.  
  388. 1.1  What is RExL
  389.  
  390.  
  391. RExL, short  for  Rule-base  EXpert  Language  is  a  fourth
  392. generation language  product  for  PC  compatible  computers
  393. which  is  based  upon   the  `expert  system'   programming
  394. paradigm. It allows the applications developer to  prototype
  395. applications rapidly and easily, while producing code  which
  396. is easy to follow and  understand. RExL comprises an  editor
  397. for creating and modifying applications and a runtime module
  398. with incorporated  debugger  for  testing  and  running  the
  399. resulting application.
  400.  
  401. RExL was developed with the following goals in mind:
  402.  
  403.     o  Ease of  use: Menus  and pop-up  lists are  available
  404.        times through hotkeys for experienced users, and  via
  405.        pulldown menus for those  not so familiar with  RExL.
  406.        Online context-sensitive,  cross referenced  help  is
  407.        available at all times to the user.
  408.  
  409.     o  Integrity: RExL was conceived as a single unit,  with
  410.        all features   intimately connected together,  unlike
  411.        traditional languages  where   editors and  debuggers
  412.        are general  purpose  tools  and not  tailored    for
  413.        specific languages.
  414.  
  415.     o  Power: RExL not only has a powerful internal language
  416.        with 178  functions available  but also  has a  fully
  417.        integrated  screen  designer  and  dBase   compatible
  418.        database module.
  419.  
  420.  
  421.  
  422.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  423.       - Main Manual.                    Page: 4 -
  424.  
  425.  
  426. 1.2  System requirements
  427.  
  428.  
  429. RExL will run on the IBM PS/2, PC/AT, PC/XT, PC, PC/Jr,  and
  430. on IBM PC clones. The minimum requirements are:
  431.  
  432.     o  256 KB  of  memory, although  RExL  can use  as  much
  433.        conventional DOS memory as is available.
  434.  
  435.     o  PC-DOS 3.0 or greater or MS-DOS 3.0 or greater.
  436.  
  437.     o  One high  density 5.25"  or  one 720k  3.5"  diskette
  438.        drive, although a hard drive with at least 600k  free
  439.        is recommended.
  440.  
  441.     o  An 80-column video card and monitor.
  442.  
  443.     o  REXL.EXE, the  editor  and REXLRD.EXE,  the  runtime-
  444.        debugger module.
  445.  
  446.  
  447. 1.3  Installation
  448.  
  449.  
  450. If you are installing the Shareware version, installation of
  451. RExL  is  accomplished  easily.    Copy  the  archive  files
  452. REXLA211.ZIP and REXLB211.ZIP into a directory on your  hard
  453. disk (we suggest "\REXL") and  unzip the archive, using  the
  454. commands:
  455.  
  456.                       pkunzip -d rexla211
  457.                       pkunzip -d rexlb211
  458.  
  459. The installation will proceed automatically and will require
  460. about 1.5Mb of disk space.
  461.  
  462. If you are  installing the full  registered version,  insert
  463. the first distribution disk in your disk drive, log onto it,
  464. issue the DOS command
  465.  
  466.                           install
  467.  
  468. and follow the prompts.
  469.  
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  477.       - Main Manual.                    Page: 5 -
  478.  
  479.  
  480. 1.4  Features
  481.  
  482.  
  483. The RExL package comes in three main parts:
  484.  
  485.     o  The editor which is  used for creating and  modifying
  486.        applications written in RExL,
  487.  
  488.     o  The runtime-debugger module which is used to run  and
  489.        debug applications.
  490.  
  491.     o  The supplementary  utilities,  stored in  the  second
  492.        archive in the shareware version, which complete  the
  493.        suite of development tools.
  494.  
  495. The next two sections provide a brief overview of both these
  496. modules. The final  section in  this chapter  gives a  quick
  497. introduction to RExL's internal language.
  498.  
  499. 1.4.1  Editor
  500.  
  501. RExL's editor uses the concept of `folding text' to make the
  502. programmer's  job   easier.   In  any   computer   language,
  503. applications are  built  up  in a  pyramidal  manner,  using
  504. procedures within procedures: this  gives the program a  two
  505. dimensional structure which has been ignored by  traditional
  506. flat file editors. RExL on  the other hand understands  this
  507. structure and  allows the  programmer to  access  procedures
  508. immediately, without having to  do searches or large  cursor
  509. movements.    Lists   of  all  entities   defined  in   your
  510. application are available  at all times  within the  editor,
  511. and most entity lists have cross reference facilities.
  512.  
  513. The screen designer  is an integral part  of the editor  and
  514. features the following:
  515.  
  516.     o  Block mark,  copy,  move,  delete,  color,  fill  and
  517.        alignment,
  518.  
  519.     o  Box and line drawing,
  520.  
  521.     o  Subscreen manipulation,
  522.  
  523.     o  IO fields : numeric input and output, character input
  524.        and output, radio buttons, check boxes, toggle  lists
  525.        and menus,
  526.  
  527.     o  Screen compression within single screen files.
  528.  
  529.  
  530.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  531.       - Main Manual.                    Page: 6 -
  532.  
  533.  
  534. The cross referenced help system  is available at all  times
  535. while within  the editor  and contains  almost six  thousand
  536. lines of  context sensitive  help.  All RExL  functions  are
  537. fully explained in the help and come complete with  examples
  538. of their use.
  539.  
  540. 1.4.2  Runtime-Debugger
  541.  
  542. RExL's debugger and runtime module feature line step,  trace
  543. and   instruction   animation   using   industry    standard
  544. keystrokes.  A   full  watch   facility  and   comprehensive
  545. expression evaluator  can be  used  to check  variables  and
  546. expressions during execution of an application. As with  the
  547. editor, all features are available via debugger hotkeys  and
  548. pull down menus.
  549.  
  550. As in  the editor,  on-the-fly macro  definition, store  and
  551. retrieval is also featured.
  552.  
  553. 1.4.3  Language
  554.  
  555. RExL's internal  language  has  been  designed  to  resemble
  556. BASIC. It supplies all the normal mathematical operators  of
  557. division, multiplication,  addition, subtraction,  negation,
  558. exponentiation and logical OR, AND and NOT. The language has
  559. one hundred and  seventy-eight functions  which are  grouped
  560. under the following headings:
  561.  
  562.     o  Database:  The   integral  database   is  dBase   III
  563.        compatible and  supports the  use of  standard  index
  564.        files. There  are  forty  functions  controlling  the
  565.        database module. The number  of data files and  index
  566.        files open concurrently is limited only by DOS.
  567.  
  568.     o  Date-Time: There  is  a full  set  of date  and  time
  569.        handling functions.  These  can  use the  three  most
  570.        common date and time formats  of the USA, Europe  and
  571.        Japan. There are nineteen functions in this category.
  572.  
  573.     o  DOS: The fourteen DOS interface functions perform the
  574.        most commonly required procedures, such as file copy,
  575.        rename,  delete,  directory  maintenance  and  system
  576.        identification.
  577.  
  578.     o  Math: There  are  forty  mathematical  and  financial
  579.        functions (not  including  the math  functions  which
  580.        operate on arrays and databases). The math  functions
  581.        cover all  the standard  trigonometric functions,  as
  582.  
  583.  
  584.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  585.       - Main Manual.                    Page: 7 -
  586.  
  587.  
  588.        well as random number generation, boolean algebra and
  589.        ASCII character manipulation. The financial functions
  590.        cover the areas of loans and annuities.
  591.  
  592.     o  Array  handling:  There  are  nine  functions   which
  593.        operate on RExL  arrays.   Arrays may  be numeric  or
  594.        string in type and can have up to three dimensions.
  595.  
  596.     o  Miscellaneous:  There  are  sixty-two   miscellaneous
  597.        functions    which    control    character     string
  598.        manipulation,  error  handling,  simple  numeric  and
  599.        string screen IO  and keyboard  handling, binary  and
  600.        logical operations and arithmetic.
  601.  
  602. The language  itself is  based upon  the concept  of  rules,
  603. which are  equivalent  to  procedures in  more  conventional
  604. programming languages. Rules are  made up of logical  blocks
  605. of lines, known  as AND-blocks,  which execute  in much  the
  606. same manner  as  Prolog  predicates.  The  lines  themselves
  607. within the rule can be built up of executable statements, in
  608. RExL's internal language, or be made up of other rules.
  609.  
  610. Screens generated using the screen designer are accessed  in
  611. much the same  manner as rules.  The screen designer  allows
  612. numeric and character IO,  dialog screen generation,  online
  613. help and printer access.
  614.  
  615.  
  616. 1.5  The Manual
  617.  
  618.  
  619. Where keystrokes  are  specified,  the shift,  alt  or  ctrl
  620. segment is written  first with the  combination key  second.
  621. For example, to call up  language help, the keystroke is  as
  622. follows: Press down  the <Ctrl> key  and while  it is  down,
  623. press the <F1> key.  This keystroke is written as <Ctrl-F1>.
  624.  
  625. The plan of the manual is :
  626.  
  627.     o  General introduction to RExL
  628.  
  629.     o  General guide to RExL's language
  630.  
  631.     o  Quick start guide
  632.  
  633.     o  In-depth guide to the editor
  634.  
  635.     o  In-depth guide to the screen designer (two chapters)
  636.  
  637.  
  638.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  639.       - Main Manual.                    Page: 8 -
  640.  
  641.  
  642.     o  In-depth guide to the debugger
  643.  
  644.     o  Appendices
  645.  
  646.            -  Guide to Function Families
  647.  
  648.            -  Database Programming
  649.  
  650.            -  Function reference
  651.  
  652.            -  Keystroke reference
  653.  
  654.            -  Afterword
  655.  
  656. It is recommended  that at the very  least, you should  read
  657. the language guide and the quick start guide.
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  693.       - Main Manual.                    Page: 9 -
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.                          Chapter 2
  703.  
  704.                           Language
  705.  
  706.  
  707. RExL's language  was designed  to  resemble BASIC,  so  that
  708. users who had experience in this language would have  little
  709. difficulty  in  switching  to  RExL.    This  chapter   will
  710. introduce all of  the basic  concepts which  you'll need  to
  711. understand before you can begin to program in RExL.
  712.  
  713. If you have  programmed before,  then a  quick read  through
  714. this  chapter  should  be   adequate,  since  the   concepts
  715. presented are common across most programming languages.
  716.  
  717.  
  718. 2.1  Variables
  719.  
  720.  
  721. A variable is a name which is used to refer to a location in
  722. memory which stores a retrievable value.  In RExL, there are
  723. two types of variable:
  724.  
  725.     o  Numeric variables which contain numeric  information.
  726.        These variables  can  range  in absolute  value  from
  727.        2.225074x10^-308  to  9.7693x10^308   and  can   hold
  728.        numbers accurate to about  fifteen decimal digits  of
  729.        precision.
  730.  
  731.     o  String variables which contain character information.
  732.        These have a maximum length of eighty characters.
  733.  
  734. RExL variable  names  follow  the standard  conventions  for
  735. variable names in most languages.  These are that they  must
  736. consist of  a letter  followed by  an unbroken  sequence  of
  737. letters, digits or the underscore  character, _.  Note  that
  738. for compatibility with future  RExL products, an  underscore
  739. is not allowed as the initial letter of a variable name.  To
  740. distinguish between string and numeric variables, all string
  741. variable names have a dollar sign, $, as the last letter  in
  742. their name.
  743.  
  744.  
  745.  
  746.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  747.       - Main Manual.                    Page: 10 -
  748.  
  749.  
  750. The following list gives some typical variable names:
  751.  
  752.         Table 2.1: Valid and Invalid Variable Names
  753.  
  754. name$     String  variable
  755. my_age    Numeric variable
  756. 1st       Invalid : initial character is not a letter
  757. my age    Invalid : space included in the middle of the name
  758. co$t      Invalid : characters after the dollar sign
  759. addr$$    Invalid : double dollar at end
  760.  
  761.  
  762. 2.2  Constants
  763.  
  764.  
  765. A constant is an invariable numeric or string value. Numeric
  766. constants are simply numbers such  as 0, 10, 123.456 and  so
  767. on. They  have  the  same  range of  value  as  the  numeric
  768. variables above.    For  large  numbers  above  one  million
  769. trillion, RExL uses the standard computer format  scientific
  770. notation.   This  format  is almost  identical  to  that  of
  771. scientific notation and consists of a mantissa which can  be
  772. up to  fifteen  digits  long and  contains  the  significant
  773. digits of the number, expressed as a number between one  and
  774. ten.   The mantissa  is  followed by  the  letter E  (or  e,
  775. standing for exponent)  followed by a  plus or minus  symbol
  776. followed by a  number between 15  and 308, representing  the
  777. power of ten  with which the mantissa  is to be  multiplied.
  778. There are no spaces in between the different sections of the
  779. number and  a plus  sign is  assumed  if the  plus or  minus
  780. symbol is omitted.  Thus  the average distance from the  sun
  781. to the earth can be expressed in this format as 5.8925E+12 =
  782. 5.8925x10^12 inches.
  783.  
  784. String  (or  character)  constants   are  simply  lists   of
  785. characters.  They are delimited at either end by the  double
  786. quotation mark ", and may contain any ASCII character except
  787. that of zero, used internally.
  788.  
  789. The following table lists a  few typical string and  numeric
  790. constants.
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  801.       - Main Manual.                    Page: 11 -
  802.  
  803.  
  804.           Table 2.2: Numeric and String Constants
  805.  
  806. 1e+6      Numeric value of one million
  807. 5e-3      Numeric value of five thousandths
  808. 1e+-376   Illegal: confusion over plus/minus and the exponent
  809.           is greater than 308
  810. "Hello"   The string `Hello'
  811. "Whoops   Illegal: no closing double quotation mark
  812.  
  813.  
  814. 2.3  Arrays
  815.  
  816.  
  817. Some  applications  require  lists  of  string  or   numeric
  818. information.  For example, the list of monthly sales figures
  819. for a single  year would require  a list  of twelve  numeric
  820. variables, one  for each  month. RExL  supports the  use  of
  821. arrays of string and numeric variables to store this type of
  822. information.   An individual  number or  string item  in  an
  823. array is known as an element of that array.
  824.  
  825. Arrays more complex than simple lists are also possible,  in
  826. fact arrays may have up to three dimensions specified.   For
  827. example, if the sales figures for a single year for a number
  828. of different departments were stored, although they could be
  829. stored as  above  in a  one  dimensional  list, it  is  more
  830. convenient to store them as a two dimensional list or array:
  831. one dimension  to  locate the  month  and one  dimension  to
  832. locate the department number.   Similarly three  dimensional
  833. arrays could be used to store the monthly sales figures  for
  834. different   departments   across   different   years.    Two
  835. dimensional arrays can be thought of as a (numeric or string
  836. type) grid  with the  dimensions specified  relating to  the
  837. rows and columns of the  grid. Three dimensional arrays  can
  838. be thought of  as a  stack of these  grids.   It is  clearly
  839. immaterial to  RExL  whether  the any  particular  dimension
  840. refers to  the  row number,  column  number  or depth  of  a
  841. particular element, however,  to keep things  clear in  your
  842. mind, you should adopt a  standard method of reference.   We
  843. suggest the convention  that the first  dimension is  column
  844. number, the second is the row number and the third dimension
  845. is the depth. This convention is used elsewhere in RExL  and
  846. conforms to the standard (x,y,z) notation used in  Cartesian
  847. geometry.
  848.  
  849. To reference a particular element in an array, RExL needs to
  850. know its position  within the array.   This is specified  by
  851. placing the  `co-ordinates' of  the element  of interest  in
  852.  
  853.  
  854.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  855.       - Main Manual.                    Page: 12 -
  856.  
  857.  
  858. square brackets  immediately after  the array's  name.   The
  859. co-ordinates of a particular element are known as the  array
  860. element subscripts and are based  at zero, meaning that  the
  861. first element of an array is indexed by a subscript of zero,
  862. the second by a  value of one and  so on.(This behaviour  is
  863. compatible with the C language and is adhered to  throughout
  864. RExL where all  co-ordinates, string indexes  and so on  are
  865. zero based.)  In  two  and  three  dimensional  arrays,  the
  866. separate subscripts are  separated by commas.  Note that  an
  867. array  must  by  subscripted   by  the  correct  number   of
  868. subscripts.
  869.  
  870. The following  table  give  a  few  examples  of  addressing
  871. individual elements of arrays.
  872.  
  873.                Table 2.3: Array Subscription
  874.  
  875. name$[0]       Returns first element in name$[]
  876. age[6]         Returns seventh element in age[]
  877. sales[3,0]     Returns the number in the first row of the fourth
  878.                column of the two dimensional array sales[]
  879.  
  880. By default,  all arrays  are  dimensioned to  ten  elements.
  881. This  can  be  changed  through  the  variable   dictionary,
  882. described in the chapter on the editor.  When you are  using
  883. three dimensional  arrays, be  aware that  large amounts  of
  884. memory are consumed.   As a guide  to determining the  exact
  885. amount  used,  each  element  of  a  numeric  array  of  any
  886. dimension uses eight bytes of  storage.  For string  arrays,
  887. each element uses four  bytes (when the application  starts)
  888. and a  further eighty-one  bytes when  an element  is  first
  889. accessed.    This  behaviour  for  string  arrays  helps  to
  890. conserve memory if not all elements in an array are used, as
  891. is usually the case.
  892.  
  893.  
  894. 2.4  Operators
  895.  
  896.  
  897. 2.4.1  Mathematical Operators
  898.  
  899. An operator is a symbol  which performs some action upon  an
  900. operand (or operands)  and returns  a value.   The  standard
  901. mathematical symbols + - x and / with which most people  are
  902. familiar are supported in RExL,  along with number of  extra
  903. ones.
  904.  
  905. They are listed in the following table:
  906.  
  907.  
  908.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  909.       - Main Manual.                    Page: 13 -
  910.  
  911.  
  912.                Table 2.4: RExL Math Operators
  913.  
  914.      *    Multiplication      ^    Exponentiation
  915.      /    Division            &    Logical AND
  916.      +    Addition            |    Logical OR
  917.      -    Subtraction         !    Logical NOT
  918.  
  919. Note that the minus sign can also be used to denote a  unary
  920. minus, that is one which  changes the sign of its  immediate
  921. operand.
  922.  
  923. The four  operators in  the right  hand  column may  not  be
  924. familiar to  you.  The  first operator,  the  exponentiation
  925. operator a caret, ^, is  used to raise the first operand  to
  926. the power of the second. Thus, 2^2=4 and 3^2=9.
  927.  
  928. The logical AND  operator, the ampersand  symbol &,  returns
  929. the result of a  logical AND of the  both operands. This  is
  930. equal to one  if both operands are  non zero, otherwise  the
  931. result is zero. So, 1&1 gives 1 but 1&0 returns 0.
  932.  
  933. The logical OR  operator, the piping  symbol |, returns  the
  934. result of a logical  OR of both operands.  This is equal  to
  935. one if either of the two operands are non zero, otherwise it
  936. is zero. So, 0|1 gives 1 but 0|0 gives 0.
  937.  
  938. The final logical operator  symbol, the exclamation mark  !,
  939. performs a  logical inversion  of its  single operand.  This
  940. means that it will reverse the logical meaning of the  value
  941. to which it is applied. Thus !1 returns 0 and !0 returns 1.
  942.  
  943. When dealing with the logical  operators &, | and !, it  may
  944. help you to  think of a  value of zero  meaning False and  a
  945. non-zero value  meaning True.   Thus,  !1 is  equivalent  to
  946. !True, giving False  and 1&0 is equivalent  to True &  False
  947. giving False.
  948.  
  949. The  following  table  lists  the  results  of  the  logical
  950. operations of Not, Or and And applied to a pair of True  and
  951. False operands.
  952.  
  953. These logical operators are sometimes referred to as boolean
  954. operators, after the Irish mathematician, George Boole,  who
  955. developed the algebra  of logic.  A  number of more  complex
  956. logical  operations   are  available   as  function   calls,
  957. including exclusive-or, implication and equivalence.
  958.  
  959.  
  960.  
  961.  
  962.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  963.       - Main Manual.                    Page: 14 -
  964.  
  965.  
  966.                 Table 2.5: Logical Operators
  967.  
  968.      A         B         !A             A&B       A|B
  969.      0         0         1              0         0
  970.      0         1         1              0         1
  971.      1         0         0              0         1
  972.      1         1         0              1         1
  973.  
  974. 2.4.2  Comparison Operators
  975.  
  976. The final set of RExL symbols are the comparison  operators,
  977. which are used  to compare one string  or number value  with
  978. another value of  the same  type. There  are six  comparison
  979. operators which are listed below:
  980.  
  981.               Table 2.6: Comparison Operators
  982.  
  983.      =    Test for equality
  984.      >    Test for greater than
  985.      <>   Test for inequality
  986.      <=   Test for less than or equal to
  987.      <    Test for less than
  988.      >=   Test for greater than or equal to
  989.  
  990. These operators  are defined  for  both string  and  numeric
  991. types.  When applied to string type operands, RExL uses  the
  992. ASCII character  set to  determine if  one string  is  `less
  993. than' or `greater than' another.  Refer to appendix F for an
  994. table of ASCII characters.
  995.  
  996.  
  997. 2.5  Functions
  998.  
  999.  
  1000. A function is an in-built  part of RExL's internal  language
  1001. which performs some action,  or calculation on some  values,
  1002. and then  returns  a value  of  some  specific type.    Like
  1003. variables, the type of the value they return is indicated by
  1004. the presence or absence of  a dollar sign.  In general,  the
  1005. return type of a function is not related to its  parameters,
  1006. the value or  values which the  function operates upon.  The
  1007. process of  using a  function is  generally referred  to  as
  1008. calling that  function.  The  values  which  are  given  (or
  1009. passed) to the function are known as parameters.
  1010.  
  1011. You are probably familiar  with some functions already:  the
  1012. mathematical functions  log,  tan,  cos and  so  forth,  are
  1013. functions (and  available in  RExL), since  they are  passed
  1014.  
  1015.  
  1016.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1017.       - Main Manual.                    Page: 15 -
  1018.  
  1019.  
  1020. some value  and return  the value  of the  function at  that
  1021. particular point.  Thus, the value of the tan function at pi
  1022. radians evaluates as zero.   This could be coded in RExL  as
  1023. tan(3.1416).
  1024.  
  1025. Every RExL  function  uses  a fixed  number  of  parameters,
  1026. generally of fixed  type.  For  example, the math  functions
  1027. above require the use of numeric parameters since trying  to
  1028. find the logarithm of a string is meaningless. The DISPLAY()
  1029. function will write  a string on the  screen to the  current
  1030. cursor location. This function  takes only one parameter,  a
  1031. string.  To write the  string "Hello, world" on the  screen,
  1032. we could write a RExL line such as DISPLAY("Hello, world").
  1033.  
  1034. Passing arrays to functions is rather more complex:  Because
  1035. some functions taking  arrays require arrays  of a  specific
  1036. dimension, dummy  subscripts  must  be passed  in  place  of
  1037. numeric ones (the dummy subscript  used is the hash  symbol,
  1038. #).  The dummy subscripts are mainly for the benefit of  the
  1039. internal syntax checker which checks  to make sure that  you
  1040. are not passing a one dimensional array to a function  which
  1041. requires a two dimensional array.  For example, to call  the
  1042. function  ARavg(),  which  averages  the  values  of  a  one
  1043. dimensional array and requires the name of an array and  two
  1044. numbers,   the   function   call   could   be   written   as
  1045. ARavg(numarr[#],0,9).
  1046.  
  1047. RExL's function  list  is  divided into  six  `families'  of
  1048. functions, each of which is used for some different  aspect.
  1049. To make the functions easier  to locate and remember,  every
  1050. function  in   a   particular   family   (except   for   the
  1051. miscellaneous functions  family!) start  with the  same  two
  1052. letters, both of which are capitalised.
  1053.  
  1054. The following table lists the function families:
  1055.  
  1056.                 Table 2.7: Function Families
  1057.  
  1058. Letter Abbreviation      Uses of Family
  1059.      AR                  Array handling
  1060.      BT                  Binary bit operations
  1061.      DB                  Database handling
  1062.      DT                  Date operations
  1063.      ER                  Error handling
  1064.      KB                  Keyboard handling
  1065.      OS                  Operating system functions
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1071.       - Main Manual.                    Page: 16 -
  1072.  
  1073.  
  1074. In the current  release of RExL, there  are one hundred  and
  1075. seventy-eight  functions  available.     The   miscellaneous
  1076. functions have no special initial letters.
  1077.  
  1078.  
  1079. 2.6  Expressions
  1080.  
  1081.  
  1082. An expression  combines  constants, variables  and  function
  1083. call return values  using RExL's  mathematical operators  to
  1084. produce a  single result.  For example,  the expression  2+2
  1085. produces the result 4.
  1086.  
  1087. As a  general rule,  the type  (string  or numeric)  of  the
  1088. result of an expression is the same as that of the  elements
  1089. of the expression, although there  is one exception to  this
  1090. rule.  This  is as follows:  when strings  are compared,  or
  1091. more properly, operated  upon by  the comparison  operators,
  1092. the return result  is a numeric  value.   This at first  may
  1093. seem strange, but it makes sense when you apply the  earlier
  1094. suggestion that non-zero values can  be thought of as  being
  1095. `true' and zero  values being False .  Thus, if two  strings
  1096. are compared for  equality, we would expect  a `true' to  be
  1097. returned if they  were equal and a  `False ' otherwise.  The
  1098. same convention holds true for comparison of numeric values.
  1099. In RExL, a true expression is assigned the value of one  and
  1100. a False  expression is assigned a value of zero.
  1101.  
  1102. When using numeric expressions, all the operators previously
  1103. defined are valid.   When  using strings  however, the  only
  1104. valid mathematical operator is the  + sign, used for  string
  1105. concatenation or  addition.    It  should  be  obvious  that
  1106. attempting to  subtract, multiply,  divide, take  powers  or
  1107. perform logical  operations  upon  strings has  no  meaning.
  1108. Examine the following expressions and satisfy yourself  that
  1109. they do what they say they do:
  1110.  
  1111.                 Table 2.8: Some Expressions
  1112.  
  1113. a*10                Returns the result of the multiplication of
  1114.                     the numeric variable a and the number 10
  1115. time[0]*speed[0]    Returns the result of the multiplication of
  1116.                     the first element of the array time[] and
  1117.                     the first element of the array speed[]
  1118. a$+"end"            Returns the value of a$ with the string
  1119.                     constant "end" appended to it.
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1125.       - Main Manual.                    Page: 17 -
  1126.  
  1127.  
  1128. There is, however, a problem in evaluating expressions  when
  1129. there is more  than one operator: This  is to determine  the
  1130. order in which the sub-expressions (within the expression as
  1131. a whole) are to be evaluated.  For example is the expression
  1132. 1+2*3 to be  evaluated as 1+(2*3) or  (1+2)*3?  To  overcome
  1133. this problem, every operator has a precedence, so that  sub-
  1134. expressions  having  operators  of  higher  precedence   are
  1135. evaluated  before  those  of  low  precedence.    When   two
  1136. operators have the same  precedence, the expression will  be
  1137. evaluated from  left  to right,  as  you would  expect.  The
  1138. complete list of operator precedence is given at the end  of
  1139. this section.
  1140.  
  1141. There is one final  operator, the assignment operator  which
  1142. is denoted by the symbol of colon followed by an equals sign
  1143. :=.  It  is used  for assigning  a variable  to some  value.
  1144. This will be covered in  the next section and is  introduced
  1145. here so that  it can be  included in  the table of  operator
  1146. precedence.
  1147.  
  1148.                Table 2.9: Operator Precedence
  1149.  
  1150. Precedence     Operator  Meaning
  1151. 8              ()        Bracketing of sub-expressions
  1152. 7              ! ^       Logical NOT and exponentiation
  1153. 6              * /       Multiply and divide
  1154. 5              + -       Add and subtract
  1155. 4              < > <>
  1156.                = <= >=   String and numeric comparison
  1157. 3              &         Logical AND
  1158. 2              |         Logical OR
  1159. 1              :=        Assignment
  1160.  
  1161. From the table above it can be deduced that for the  example
  1162. given earlier, the expression would be evaluated as  1+(2*3)
  1163. rather than the simple left-to-right parsing of (1+2)*3.
  1164.  
  1165. The following  table  gives  some  examples  of  expressions
  1166. without brackets and the equivalent bracketed expressions to
  1167. demonstrate how  the operator  precedence table  is used  to
  1168. determine the exact order of evaluation.
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1179.       - Main Manual.                    Page: 18 -
  1180.  
  1181.  
  1182.         Table 2.10: Examples of Operator Precedence
  1183.  
  1184.      Expression          Evaluated as   Result
  1185.      1+2*3               1+(2*3)        7
  1186.      1*2+3               (1*2)+3        5
  1187.      1+2*3^4             1+(2*(3^4))    163
  1188.      2*TAN(3.1416/4)     2*TAN(0.786)   2
  1189.      2*(10=20)           2*(0)          0
  1190.      2*10=20             (2*10)=20      1
  1191.      "a"="b"                            0
  1192.      "a"<"b"                            1
  1193.  
  1194. Don't proceed until you understand all of the results above,
  1195. since the basic ideas presented there are present throughout
  1196. RExL.  Note  particularly, the final  two expressions  which
  1197. are  not  intuitively  obvious  since  they  depend  on  the
  1198. comparison operators, and thus return numeric results.   The
  1199. second  of  the  two  examples  involving  string  constants
  1200. requires knowledge of  the ASCII  character set.   For  more
  1201. information on  this,  consult  the  ASCII  table  given  in
  1202. appendix F.
  1203.  
  1204.  
  1205. 2.7  Assignments
  1206.  
  1207.  
  1208. An assignment  is  a special  case  of  an expression.    It
  1209. assigns the value  of some expression  to a variable,  which
  1210. can be either be simple or array type, using the  assignment
  1211. operator :=. The  return type of an  expression must be  the
  1212. same type as  the variable  whose value  is being  assigned.
  1213. Thus it is  not possible  to assign  a string  to a  numeric
  1214. variable or vice versa. The general format of an  assignment
  1215. is as follows:
  1216.  
  1217.                  <variable> := <expression>
  1218.  
  1219. The <variable> above is sometimes referred to as an  LValue,
  1220. short for Left hand Value.  When using non-array  variables,
  1221. the LValue is  simply the name  of the  variable.   However,
  1222. when using array  type variables,  you must  tell RExL  what
  1223. element you are trying to assign a value to.  Thus, you must
  1224. include the relevant  array element  subscripts in  brackets
  1225. after the array variable's name.
  1226.  
  1227. The  following  table  gives   some  examples  of   variable
  1228. assignment statements:
  1229.  
  1230.  
  1231.  
  1232.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1233.       - Main Manual.                    Page: 19 -
  1234.  
  1235.  
  1236.             Table 2.11: Examples of Assignments
  1237.  
  1238. Expression          Result of operation
  1239. a:=5                a is assigned the value of 5
  1240. t$:="test"          t$ is assigned the string "test"
  1241. a:=a+1              a is assigned the value of a plus 1, ie: 6
  1242. t$:=t$+" string"    " string" is appended to the old value of t$
  1243.                     to give a new t$ value of "test string"
  1244. ar[0]:=10           The first element of the numeric array ar[]
  1245.                     is assigned a value of 10
  1246. ar[a]:=a+4          The seventh element of ar[] is assigned 10
  1247. str$[1]:=t$         The second element of str$[] is assigned
  1248.                     the string "test string"
  1249.  
  1250. Note particularly,  the third  and fourth  statements  which
  1251. seem rather  counter-intuitive.   Recall from  the table  of
  1252. operator precedence  that the  assignment operator  has  the
  1253. lowest  precedence,  and  thus   will  be  evaluated   after
  1254. everything else.  Thus, the meaning of the statement becomes
  1255. `add one to  the variable a  and assign  the result of  this
  1256. addition to  the variable  a.'   An assignment  will  always
  1257. returns a `true' value of one.
  1258.  
  1259.  
  1260. 2.8  Statements
  1261.  
  1262.  
  1263. `Statement' is a generic term  for a complete expression  or
  1264. assignment in RExL.   In other  words, it  forms a  complete
  1265. RExL `sentence' which can be interpreted and executed.
  1266.  
  1267. When an application  is created, it  consists of  a list  of
  1268. executable statements,  each  of  which returns  some  value
  1269. (since they are  expressions). RExL uses  this return  value
  1270. from a statement to determine  its next action:  Whether  to
  1271. execute the next statement in the current list or to jump to
  1272. some other location in the  application.  This will be  more
  1273. fully explained in the section on rules.
  1274.  
  1275.  
  1276. 2.9  Inference
  1277.  
  1278.  
  1279. Inference is the process of drawing a conclusion from a  set
  1280. of propositions, each of which can be either true or False .
  1281. RExL operates using  an inference engine:   This is used  to
  1282. execute the  application and  to draw  conclusions from  its
  1283.  
  1284.  
  1285.  
  1286.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1287.       - Main Manual.                    Page: 20 -
  1288.  
  1289.  
  1290. individual lines, each of which will evaluate as either true
  1291. or False  and are therefore equivalent to propositions.
  1292.  
  1293.  
  1294. 2.10  Rules and Execution
  1295.  
  1296.  
  1297. A rule  is  the  fundamental  building  block  of  all  RExL
  1298. applications and  is roughly  equivalent to  a procedure  in
  1299. conventional programming  languages. Rules  are made  up  of
  1300. blocks of  lines  which  may be  executable  statements,  or
  1301. further rules.
  1302.  
  1303. Every non-blank line  in a  RExL application  has a  leading
  1304. connector. This is a  logical `preposition' which tells  the
  1305. inference engine how to link up this line with the  previous
  1306. and following lines  in its rule.   In the current  release,
  1307. there are three connectors:  AND, If and OR.  The use is  an
  1308. application of  these connectors  is best  illustrated by  a
  1309. simple example.
  1310.  
  1311. If   The temperature is ok
  1312. And  It is not raining
  1313. And  Tell user to go for a walk
  1314.  
  1315. Or   Tell user to stay inside and play a game of chess
  1316.  
  1317. The meaning of  this should be fairly  clear:  The  computer
  1318. will tell the user to go for a walk if the temperature is ok
  1319. and it is not raining,  or else, the computer will tell  the
  1320. user to play chess.  What actually happens during  execution
  1321. is this:  the inference engine starts on the first line  and
  1322. asks the user  `Is the temperature  ok ?'  (for the  moment,
  1323. don't worry about how the computer asks this question or how
  1324. it gets the reply). If  the answer to this question is  yes,
  1325. that is True, then the  inference engine will let  execution
  1326. pass to the next line and ask the question `Is it  raining?'
  1327. If the answer  is again true, then  the computer will  `draw
  1328. the conclusion' (or  more properly, execute  the line)  that
  1329. the user should go for  a walk.  If  on the other hand,  the
  1330. user had replied  no, or False, to  either of the  questions
  1331. then the  inference engine  would have  determined that  the
  1332. conditions for a walk were not present, passed execution  to
  1333. the or clause  and therefore  suggested that  the user  play
  1334. chess instead.
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1341.       - Main Manual.                    Page: 21 -
  1342.  
  1343.  
  1344. Whether the user is advised to stay inside or to go out, the
  1345. result of the  rule as  a whole  is the  same: It  succeeds,
  1346. since it has successfully drawn a conclusion.
  1347.  
  1348. RExL inserts the connectors itself. The rules for connectors
  1349. can be generalised as follows: The first line in an unbroken
  1350. sequence of lines will have  the connector OR, unless it  is
  1351. the first non-blank line in  a rule, which will always  have
  1352. the connector If (the meaning  of If and OR is  functionally
  1353. identical). All  other  lines  in the  rule  will  have  the
  1354. connector AND.   It is for  this reason  that the blocks  of
  1355. lines are sometimes referred to as And-Blocks.
  1356.  
  1357. The rules which the  inference engine follows for  execution
  1358. are as follows:  In any rule,  execution will  begin at  the
  1359. first non-blank line of the first AND-block within the rule,
  1360. that is the line with the If as its connector. It  continues
  1361. sequentially through the block  until one of two  conditions
  1362. occur:  Either a line returns the value zero (for False), in
  1363. which case execution will jump and continue at the start  of
  1364. the  next  AND  block  in  the  rule.    Or  else  execution
  1365. successfully reaches the end of an AND block, in which  case
  1366. the  rule  returns  the  value  True  without  any   further
  1367. statement execution  within that  rule.   If, on  the  other
  1368. hand, a line returns False, and execution tries to  continue
  1369. at the beginning of  the next AND block  when there is  none
  1370. present, then the rule will return False.
  1371.  
  1372.  
  1373. 2.11  Subrules
  1374.  
  1375.  
  1376. If we decided to make the application objective in assessing
  1377. the temperature, rather than relying  on the user to do  so,
  1378. we could as  the user whether  the temperature  is within  a
  1379. certain range to find out whether it is really `ok' or  not.
  1380. We  would  therefore  expand  the  definition  of  the   The
  1381. temperature  is  ok  rule.    Instead  of  being  a   simple
  1382. unexpanded line,  this rule  would then  `contain'  subrules
  1383. such as the following:
  1384.  
  1385. If   The temperature is more than 10 degrees
  1386. And  The temperature is less than 40 degrees
  1387.  
  1388. Therefore, when the application is started, instead of  RExL
  1389. simply asking  the question  `Is  the temperature  ok?',  it
  1390. would  instead  ask  the  two  more  specific  questions  to
  1391.  
  1392.  
  1393.  
  1394.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1395.       - Main Manual.                    Page: 22 -
  1396.  
  1397.  
  1398. determine if  the  temperature  is  between  ten  and  forty
  1399. degrees (Celsius!).
  1400.  
  1401. During execution what actually  happens is that RExL  checks
  1402. to see if the rule being  executed can be expanded.  If  so,
  1403. then execution passes to the expanded portion, but remembers
  1404. where the  rule was  `called' from.   It  then executes  the
  1405. lines within the expanded rule and eventually returns a True
  1406. or False value to the original caller of the rule.
  1407.  
  1408. So, going back  to the example,  when execution reaches  the
  1409. rule `Is the temperature ok?', it expands the definition and
  1410. asks `Is the  temperature more than  10 degrees  ?'  If  the
  1411. answer is `yes'  or True, then the  next question is  asked,
  1412. `Is the temperature less than 40 degrees?'  If the answer is
  1413. again True, then  both conditions in  the expanded rule  are
  1414. True and so the the rule would succeed, return True and RExL
  1415. will then ask whether it is raining or not, continuing  from
  1416. where it left  off in  the parent rule.   If,  on the  other
  1417. hand, the  user replies  `no' or  False,  to either  of  the
  1418. questions about temperature,  then the  expanded rule  fails
  1419. and returns  False  to  the parent  rule,  thus  making  the
  1420. conditions for a walk unavailable, and therefore  suggesting
  1421. that the user play chess.
  1422.  
  1423. Every application has  a master rule  (sometimes known as  a
  1424. `main rule') which  is called by  RExL when the  application
  1425. starts. In the current release of RExL, this rule is  called
  1426. Main Program and  cannot be changed.   All  other rules  can
  1427. therefore be considered as subrules of the main rule.
  1428.  
  1429. It is  very important  that  you understand  thoroughly  the
  1430. action of the inference engine in RExL, and how it  executes
  1431. rules and returns  values. All RExL  applications are  based
  1432. upon the ideas presented in  this and the previous  section.
  1433. You should reread them if you are not happy with them.
  1434.  
  1435.  
  1436. 2.12  Rule Modifiers
  1437.  
  1438.  
  1439. The rules in  the previous  two sections  were basic  rules.
  1440. That is, that  they acted as  rule calls  and were  executed
  1441. every time the application called them.  There are, however,
  1442. a number of  different variations  upon this  theme.   These
  1443. rule modifiers perform some action other than a simple  rule
  1444. call.  The six rule modifiers are as follows:
  1445.  
  1446.  
  1447.  
  1448.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1449.       - Main Manual.                    Page: 23 -
  1450.  
  1451.  
  1452.                  Table 2.12: Rule Modifiers
  1453.  
  1454. Abbreviation   Used for
  1455. BackTo         Rule recall
  1456. Not            Return inversion of rule call
  1457. While          Continuously execute rule while true
  1458. Multi          Make rule multi-pass
  1459. Single         Make rule single-pass
  1460. Zap            Reset status of single-pass rule
  1461.  
  1462. In the editor, the modifiers  are placed between the  line's
  1463. connector and the name of the rule.  The function of the six
  1464. modifiers are explained in the next six subsections.
  1465.  
  1466. 2.12.1  BackTo
  1467.  
  1468. Whenever a rule is called by an application, RExL stores the
  1469. place in the  listing where the  rule was  called from in  a
  1470. special area known as the call stack (so called because rule
  1471. calls are `stacked' there).  The BackTo modifier is used  to
  1472. clear the  call stack  back to  the  last instance  of  some
  1473. previous rule.  This can be used when for example, when  the
  1474. user selects a  menu option to  restart an application,  the
  1475. application could contain a line such as:
  1476.  
  1477. And BackTo Main Program
  1478.  
  1479. BackTo may also come in useful when an error occurs and  the
  1480. program needs  to restart  the  execution from  some  point.
  1481. Note that if  the rule specified doesn't  exist in the  call
  1482. stack, then the application will end, since it can't  locate
  1483. any place to restart from.
  1484.  
  1485. 2.12.2  Not
  1486.  
  1487. When Not  is applied  to a  rule,  it reverses  the  logical
  1488. return value of the rule.  Thus, if rule call returns  True,
  1489. but the rule  is modified  by the  Not, then  the rule  will
  1490. evaluate as  False.  The Not  modifier  is mostly  used  for
  1491. logical tests  which are  easier to  evaluate as  True  than
  1492. False (and vice versa).
  1493.  
  1494. 2.12.3  While
  1495.  
  1496. The function  of the  While modifier  is to  execute a  rule
  1497. continuously while its return value is True.  This could  be
  1498. useful for doing some work in a database, where the rule  is
  1499. designed to fail when the end of the database is reached.  A
  1500.  
  1501.  
  1502.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1503.       - Main Manual.                    Page: 24 -
  1504.  
  1505.  
  1506. rule call  which  is  prefixed by  While  will  always  fail
  1507. because of the nature of the modifier.
  1508.  
  1509. 2.12.4  Multi
  1510.  
  1511. By default, all RExL rules are multi-pass rules.  This means
  1512. that a rule is expanded and evaluated each and every time it
  1513. is called (although this is not standard for expert systems,
  1514. where all rules are  single-pass). However, it is  sometimes
  1515. useful to have  rules which are  not reevaluated every  time
  1516. they are called, but save their status from one call to  the
  1517. next. These rules are known as single-pass rules.  The Multi
  1518. modifier is used  to make  a single-pass  rule a  multi-pass
  1519. rule.
  1520.  
  1521. 2.12.5  Single
  1522.  
  1523. The Single modifier performs the  reverse of what the  Multi
  1524. modifier does:    It  makes  a  multi-pass  rule  (the  RExL
  1525. default) into a single-pass rule.
  1526.  
  1527. 2.12.6  Zap
  1528.  
  1529. When a one-pass rule is  set up and has been evaluated,  but
  1530. for some reason, needs to be to be reevaluated (because, for
  1531. example, of some  changed condition) then  the Zap  modifier
  1532. can be used  to reset  the status  of the  one-pass rule  to
  1533. unknown, and thus  the rule will  be reexecuted  when it  is
  1534. next called.
  1535.  
  1536.  
  1537. 2.13  Other Modifiers
  1538.  
  1539.  
  1540. Every line,  other than  a simple  rule  call, must  have  a
  1541. modifier attached to  it. We  have already  some across  the
  1542. list of the six modifiers for rules in the previous section.
  1543. That list is  now completed with the  list of modifiers  for
  1544. the other line types:
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1557.       - Main Manual.                    Page: 25 -
  1558.  
  1559.  
  1560.                 Table 2.13: Other Modifiers
  1561.  
  1562. Modifier       Applicable to
  1563. [Expr ]        Statements
  1564. [Dialg]        Input and output
  1565. [Dsply]        Screens
  1566. [Help ]        Screens
  1567. [Menu ]        Screens
  1568. [Print]        Screens
  1569.  
  1570. Note that all  non-rule modifiers are  surrounded in  square
  1571. brackets.  This is to  help the programmer distinguish at  a
  1572. glance whether the line is a rule or screen/statement.   The
  1573. final five modifiers  in the  table are  applicable only  to
  1574. screens and  are dealt  with in  the chapter  on the  screen
  1575. designer.
  1576.  
  1577. The [Expr] modifier  at the  beginning of  a line  indicates
  1578. that the  line  is  a statement  (either  an  assignment  or
  1579. expression).   Expressions,  as  noted  before,  can  return
  1580. either a zero value for False or a non-zero value for  True,
  1581. while assignments  will always  return  True.   Examine  the
  1582. following list of statements and satisfy yourself that  they
  1583. return the values indicated.
  1584.  
  1585.             Table 2.14: Expression Truth Values
  1586.  
  1587. Statement                Returns
  1588.      1                   True
  1589.      0                   False
  1590.      123*23              True
  1591.      10-10               False
  1592.      a:=10               True
  1593.      a=10*("h"="h")      True
  1594.  
  1595.  
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1611.       - Main Manual.                    Page: 26 -
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  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.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1665.       - Main Manual.                    Page: 27 -
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.                          Chapter 3
  1675.  
  1676.                         Quick Start
  1677.  
  1678.  
  1679. 3.1  Introduction
  1680.  
  1681.  
  1682. In this chapter, we'll go through the process of creating  a
  1683. small application in RExL.   First, we'll use the editor  to
  1684. create it, and then  the runtime module to  run it.  In  the
  1685. final section, we'll  use the integrated  debugger to  debug
  1686. the application.  If you haven't read the chapter on  RExL's
  1687. language, you  should  do  so  now,  since  the  application
  1688. developed there will be created  here, and the editor  won't
  1689. make much sense unless you understand the language.
  1690.  
  1691. Every RExL application is stored  on disk in two parts,  the
  1692. first part is  the application image.   This is the  listing
  1693. which you can edit using the editor. The second part is  the
  1694. screen  file   which  stores   the  screens   used  in   the
  1695. application.    The  application  image  file  has  a   file
  1696. extension of ".RXL" while the screen file has one of ".SCR".
  1697. Changes to the screen  file are included immediately,  while
  1698. those to the application listing are saved only when RExL is
  1699. instructed to do so.  It is for this reason that you  should
  1700. not modify any  screens in an  application without  updating
  1701. the application image  on disk, since the  two files may  go
  1702. out of synchronisation.
  1703.  
  1704. The RExL system also  comes in two parts.   The first  part,
  1705. the  editor,  is  used  for  creating  and  maintaining  the
  1706. application and  for  designing the  application's  screens.
  1707. The second part  is the  runtime-debugger which  is used  to
  1708. execute and debug the application.   This two part  approach
  1709. is used because it maximises the amount of memory  available
  1710. to each module.  The two modules are linked, so that you can
  1711. run and debug  you application without  having to exit  from
  1712. the editor and explicitly run the debugger.
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1719.       - Main Manual.                    Page: 28 -
  1720.  
  1721.  
  1722. 3.2  Creating an Application
  1723.  
  1724.  
  1725. Start the editor by typing rexl at the DOS prompt and  press
  1726. <Enter>.  After a second or two, the editor screen  appears.
  1727. If any error  messages appear, just press  a key and  ignore
  1728. them.
  1729.  
  1730. The menu bar across the top of the screen uses the  standard
  1731. menu keys  of <Left  Arrow> and  <Right Arrow>  to move  the
  1732. hilite bar and  <Enter> to select  an option.   The  hilited
  1733. letters in the menu titles (ie  `F' in File) can be used  to
  1734. select an option as can a combination of the Alt key and the
  1735. letter (ie <Alt-O> to select the options menu).  We want  to
  1736. edit the application,  so select  the Edit  option from  the
  1737. main menu and press <Enter>.
  1738.  
  1739. The first line in the central edit window will be hilited in
  1740. gray, the connector `If' will appear at the left end of  the
  1741. hilite bar and the cursor will be placed a few characters in
  1742. from this.   The  first line  of  our application  was  `The
  1743. temperature is ok', so just  type this in to the editor  and
  1744. press <Enter>.  The cursor and hilite bar will then jump  to
  1745. the next  line and  an `And'  connector will  appear at  the
  1746. start, in  the same  position as  the `If'  of the  previous
  1747. line.  The rules for  the automatic insertion of  connectors
  1748. will be explained shortly.
  1749.  
  1750. Enter in the  next line  of text,  `It is  not raining'  and
  1751. again press <Enter> to  go to the next  line (You can  press
  1752. <Down-Arrow> to proceed if you want to, just be careful  not
  1753. to insert blank lines, since  these will change the  meaning
  1754. of the rule as we  will soon see).   The final line of  this
  1755. And-Block is `Tell  the user  to go  for a  walk', so  enter
  1756. this.
  1757.  
  1758. The first  And-Block of  our mini-application  has now  been
  1759. finished.  We now need to enter the final line, telling  the
  1760. user what to do.   Place the hilite  bar over the `Tell  the
  1761. user to go for  a walk' rule and  press the <Tab> key.  This
  1762. will expand  the rule.    Note that  the  rule name  is  now
  1763. displayed on  the line  underneath the  main menu  bar.   To
  1764. display  the  RExL's  advice,  we'll  use  the   `DISPLAY()'
  1765. function which we met earlier.  We'll need to tell RExL that
  1766. what we are entering is a statement, so press the <F4>  key.
  1767. This will generate the `[Expr]'  line modifier and place  it
  1768. immediately after the `If' line connector.  If the  modifier
  1769. were omitted, RExL would assume that the line was a rule and
  1770.  
  1771.  
  1772.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1773.       - Main Manual.                    Page: 29 -
  1774.  
  1775.  
  1776. not an expression.   With the modifier  in place, enter  the
  1777. expression `DISPLAY("You should  go out and  have a  walk")'
  1778. This completes the first section of our application.   Press
  1779. <Shift-Tab> to return from the  sub rule to the parent  rule
  1780. (note that the rule name display area now displays the  name
  1781. `Main Program').
  1782.  
  1783. Press <Down-Arrow> (or <Enter>) twice, so that a blank  line
  1784. now exists between the first  AND-block and the hilite  bar.
  1785. You'll notice that  the connector  at the  beginning of  the
  1786. line has now become `Or'.   The rule which RExL follows  for
  1787. generating connectors  is simple.   Every  line begins  with
  1788. `And', unless one of two conditions is true: The first  line
  1789. of an AND-block  will have  the connector  `Or', unless  the
  1790. line is  the first  line  in the  rule,  in which  case  the
  1791. connector will be `If'.  All other non-blank lines will have
  1792. the connector `And', while blank lines have no connector.
  1793.  
  1794. Type in the text for  the `Or' condition: `Tell the user  to
  1795. stay inside  and play  a game  of  chess'.   Press <Tab>  to
  1796. expand the rule and then enter the expression `DISPLAY("Stay
  1797. inside and play a game of chess")', not forgetting to  press
  1798. <F4> to specify the `[Expr]' modifier.
  1799.  
  1800.  
  1801. 3.3  Running the Application
  1802.  
  1803.  
  1804. The application is now ready to run.  Press <F2> to save  it
  1805. and select the `Run' option from the main menu (by  pressing
  1806. <Alt-R>, or <Esc> to return  to the main menu and using  the
  1807. cursor keys to  select).  Select  the first  option in  that
  1808. menu, `Run', and press <Enter>.   Within a few seconds,  the
  1809. application should begin running.
  1810.  
  1811. The screen will change to  a light gray background with  two
  1812. cyan boxes in the  center of the screen.   The upper of  the
  1813. two boxes will  contain the name  of the  first rule in  the
  1814. application, `The  temperature  is  ok'.   Underneath  this,
  1815. there is  a small  menu with  two options,  true and  false.
  1816. When one of these options is selected, its value returned to
  1817. RExL  directly.    Recall   from  the  explanation  of   the
  1818. application in the previous chapter, that the user would  be
  1819. advised to go for a walk if `the temperature was ok' and `it
  1820. is not raining'. Therefore, for this conclusion to be drawn,
  1821. the first reply must be true (select the `True' option  from
  1822. the menu) as well as the second option (`True' again).  When
  1823. both conditions have been  satisfied, RExL will display  the
  1824.  
  1825.  
  1826.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1827.       - Main Manual.                    Page: 30 -
  1828.  
  1829.  
  1830. string `You should go for a walk' on the monitor.  Selecting
  1831. a value of  false for either  of the  conditions will  cause
  1832. RExL to draw the other conclusion, that the user should play
  1833. a game of  chess.   When RExL  has printed  its advice,  the
  1834. application will terminate and you  will be returned to  the
  1835. editor.   If this  happens too  quickly to  see the  result,
  1836. press <Alt-F5> from within the edit window in the editor  to
  1837. display the user screen, the screen as it existed before the
  1838. editor was loaded.
  1839.  
  1840. You should  run this  application a  few times  and  satisfy
  1841. yourself that you understand what it is doing.
  1842.  
  1843.  
  1844. 3.4  Expanding the Application
  1845.  
  1846.  
  1847. We will  now expand  the  application using  custom  screens
  1848. designed using the screen designer.
  1849.  
  1850. Recall from the  language chapter that we  wished to make  a
  1851. more objective assessment of whether the temperature was  ok
  1852. by adding two  sub rules  to that  rule.   Instead of  doing
  1853. this, we shall instead add an input screen to get the actual
  1854. temperature from the user and to perform numeric comparisons
  1855. upon it directly.
  1856.  
  1857. Expand the definition  of the `The  temperature is ok'  rule
  1858. and type in  the following `Input  a value for  temperature'
  1859. and press <F10>.  A small menu will appear with six  options
  1860. on it (these are the different screen types available).   We
  1861. want the  program  to  perform some  input  and  output,  or
  1862. dialog, with the  user, so  select the  `Dialog' option  and
  1863. press <Enter>.   The editor screen  disappears and you  will
  1864. see the start up screen  of screen designer which is  filled
  1865. with  the  quarter  tone  character  `░'.    Move  somewhere
  1866. slightly to the left  of the center of  the screen and  type
  1867. `Enter the temperature :'
  1868.  
  1869. We now want to define an  input field, so that the user  can
  1870. input a value to  RExL.  Press <Ctrl-I>  to start the  field
  1871. definition,  press  <Tab>  once   to  make  the  field   ten
  1872. characters wide, and press <Enter>  to accept that size.   A
  1873. box will appear asking for  an `input expression'.  As  with
  1874. assignments, this  must  be  an  proper  LValue.    Type  in
  1875. `Temperature'.  This  will the  name of  the variable  which
  1876. we'll use to  store the value  of the  temperature in  (note
  1877. that the  variable  doesn't end  in  a  dollar sign  and  is
  1878.  
  1879.  
  1880.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1881.       - Main Manual.                    Page: 31 -
  1882.  
  1883.  
  1884. therefore  a   numeric   variable,  suitable   for   storing
  1885. temperature values).   Press  <Enter> to  accept this  input
  1886. expression.  The field will  now be replaced by a series  of
  1887. ten question  marks  which are  used  to indicate  an  input
  1888. field.  Press <F2> to save the screen and <Esc> to exit from
  1889. the screen designer and return to the editor.  Note that the
  1890. line's modifier  has  now  become `[Dialg]'  to  indicate  a
  1891. dialog screen.
  1892.  
  1893. Move  to   the   next   line  and   enter   the   expression
  1894. `Temperature>10' and on the  following line, the  expression
  1895. `Temperature<40',  remembering  to  press  <F4>  each  time.
  1896. Press <Shift-Tab>  to return  to the  main rule,  enter  the
  1897. `Tell user to go for a walk' rule, place the hilite bar over
  1898. the `DISPLAY()' statement and press <Ctrl-Y> (or <Alt-D>) to
  1899. delete the  line.   Type the  string `Go  for walk  screen',
  1900. press <F10> and select the `Display' option from the  screen
  1901. menu.  The `Display' screen type is used to display a screen
  1902. and then  wait for  a key  to  be pressed,  it's useful  for
  1903. displaying some information and then pausing until the  user
  1904. has read it.  When in the screen designer, press <Alt-M>  to
  1905. begin marking a block.  Move to the bottom right hand corner
  1906. of the screen  using the arrow  keys (<End>  and <PgDn>  can
  1907. also be used to do  it in two keystrokes) and press  <Enter>
  1908. to select the block.  The block menu will now appear: Select
  1909. the `Paint'  option to  color the  marked block.   Use  <Up-
  1910. Arrow> and  <Down-Arrow>  to  change the  foreground  (text)
  1911. color and <PgUp> and <PgDn> to change the background (paper)
  1912. color.   Change it  to something  that  looks nice  on  your
  1913. monitor.  When you have  finished painting the block,  press
  1914. <Enter> to  accept.   Press  <Alt-R>  to remark  the  block,
  1915. select the `Box' option from the menu and select one of  the
  1916. box types from  the new menu which  appears. Make sure  that
  1917. the  first  option  on  this  menu  is  `overlay'  and   not
  1918. overwrite, otherwise the text you  typed in earlier will  be
  1919. deleted.  You might like to try this a few times to see  the
  1920. different types of box available.
  1921.  
  1922. Move to  the center  of the  screen,  type the  string  `You
  1923. should go for  a walk'  and save  the screen  using <F2>  as
  1924. before.  Using  the same procedure  again, delete the  other
  1925. occurrence of  `DISPLAY()' and  replace  it with  a  display
  1926. screen.
  1927.  
  1928. When you have  done this, run the  application again.   This
  1929. time, instead of RExL asking  you `Is the temperature  ok?',
  1930. it will ask for a  temperature value. Enter some value.   If
  1931. the value was between 10 and 40 then both of the  comparison
  1932.  
  1933.  
  1934.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1935.       - Main Manual.                    Page: 32 -
  1936.  
  1937.  
  1938. expressions entered after the screen in the temperature rule
  1939. will be evaluated as true  and hence the rule will  succeed.
  1940. RExL will then enquire, using the true/false menu, about the
  1941. next condition for a walk, whether it is raining or not.  As
  1942. before, if true is selected, RExL will display the `Go for a
  1943. walk' screen, otherwise it will display the other result.
  1944.  
  1945. Run this  application a  few times  to  make sure  that  you
  1946. understand how it works.
  1947.  
  1948.  
  1949. 3.5  Debugging the Application
  1950.  
  1951.  
  1952. When you are developing an  application in RExL, it is  very
  1953. useful to be able to follow the thread of execution to  make
  1954. sure that the application is doing what is you expect it to.
  1955. The debugger, which is incorporated into the portion of RExL
  1956. which runs the applications  (known as the runtime  module),
  1957. can be used to do just that.
  1958.  
  1959. Run your  application  again,  but  this  time,  instead  of
  1960. selecting the `Run'  option from  the run  menu, select  the
  1961. `Debug System' option.   After a  few seconds, the  debugger
  1962. will appear.  The interface is much the same as that of  the
  1963. editor  and  where   the  comparison   is  meaningful,   the
  1964. keystrokes  are  the  same,   so  you  shouldn't  have   any
  1965. difficulty using it.
  1966.  
  1967. The screen  layout is  slightly different  from the  editor.
  1968. The main differences are as follows:
  1969.  
  1970.     o  To the immediate left of the connector of every  non-
  1971.        blank line, there  is a status  character.  This  can
  1972.        assume  one  of  three  values,  `?',  `√'  and  `X',
  1973.        depending upon what  the logical status  of the  line
  1974.        is.  `?' for unknown or unevaluated, `√' for  logical
  1975.        true and `X' for logical false.
  1976.  
  1977.     o  The line about to be executed by RExL is indicated by
  1978.        an arrow  between the  line modifier  and the  line's
  1979.        text.
  1980.  
  1981. Press <F7>.  This will trace the application.  Depending  on
  1982. the current line type, tracing has different results: If  it
  1983. is over a rule, then the debugger will enter the rule, as if
  1984. you had pressed <Tab>, and it will place the debugger on the
  1985. first non-blank line of that rule.  If the line is a screen,
  1986.  
  1987.  
  1988.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  1989.       - Main Manual.                    Page: 33 -
  1990.  
  1991.  
  1992. then the  screen  will  be activated  and  control  will  be
  1993. returned to the debugger when the screen terminates.  If the
  1994. line is an expression, then  the line will be evaluated  and
  1995. control again returned to the debugger afterwards. There are
  1996. a few more  conditions which trace  controls, these will  be
  1997. covered in the chapter on the debugger.
  1998.  
  1999. When you pressed <F7>, the  hilite bar entered the rule  and
  2000. was placed over the first line in it (which is the  screen).
  2001. Press <F7> again  to execute the screen.   Enter some  value
  2002. for the temperature  in the  prompt box  which appears  (try
  2003. 30).  When you press <Enter>, the screen terminates and  the
  2004. debugger regains control of execution.  We will now place  a
  2005. watch  on  the  variable  `temperature'.    A  watch  is  an
  2006. expression which is evaluated  (or watched) every time  that
  2007. RExL executes a line of code.   The watch can be entered  in
  2008. one of  two  ways:  The  easiest  is  to  place  the  cursor
  2009. somewhere in the word `temperature' on the debugger's screen
  2010. and then press <Ctrl-W> (<Ctrl-F7> also works).  When  there
  2011. is  one  present,  the  debugger  will  pull  a  word   from
  2012. underneath the cursor  and place  it into  whatever box  you
  2013. call up, in this case the watch expression box.  If the word
  2014. appears, just press <Enter> to accept it, otherwise, type in
  2015. the word `temperature'  and press <Enter>.   The  expression
  2016. will be placed in the  `watch window', the box on the  lower
  2017. portion  of  the  screen.    Following  the  expression  you
  2018. entered, there will be a colon followed by the current value
  2019. of that expression, in this case, the value you typed in  in
  2020. the screen.   You can  set a watch  on any  valid string  or
  2021. numeric expression.
  2022.  
  2023. Press <F7> again  to execute  the line.   If  you entered  a
  2024. value of 30 for the  temperature above, then this line  will
  2025. be true, and the line  status indicator at the left edge  of
  2026. the line will display a `√', if you entered some other value
  2027. causing the line to fail,  then the status will be false  as
  2028. indicated by a `X'.   Assuming you entered 30, the  debugger
  2029. places the hilite  bar on the  final non-blank  line in  the
  2030. rule which you can now trace.  The hilite bar should now  be
  2031. beyond the last  line, to indicate  that the  rule has  been
  2032. evaluated and that execution is about to return to where the
  2033. rule was called from.  Trace again and see this happen.  The
  2034. status indicator  of  the first  rule  in the  main  program
  2035. should now be `√' to indicate that it was evaluated as true.
  2036.  
  2037. We will step the next two lines.  Stepping is much the  same
  2038. as tracing, the only difference being that if the line being
  2039. stepped is a rule, then the debugger will not enter the rule
  2040.  
  2041.  
  2042.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2043.       - Main Manual.                    Page: 34 -
  2044.  
  2045.  
  2046. definition, it as it does in trace.  Press <F8> to step  the
  2047. application.   You'll now  be  presented with  the  familiar
  2048. true/false menu  screen.   Select false  and note  that  the
  2049. debugger has filled in an  `X' as the logical status of  the
  2050. failed rule and  left the  status of  the last  rule in  the
  2051. first AND-block as unspecified, using  `?'.  The hilite  bar
  2052. will now be placed upon  the first line of the  alternative,
  2053. the second  `AND'-block, so  press <F8>  to  step it.    The
  2054. debugger  will  not  immediately   regain  control  of   the
  2055. application since  the  screen  type being  displayed  is  a
  2056. `display' screen and so requires a key press to end it.
  2057.  
  2058. The hilite bar will now be on the final (empty) line of  the
  2059. application. Press one  of the execute  keys (<F7>, <F8>  or
  2060. space) to  terminate  the  application  and  return  to  the
  2061. editor.
  2062.  
  2063. Debug the application a few more times to make sure that you
  2064. understand how stepping, tracing and watching work.  If  you
  2065. want to delete a watch  expression, press <F6> to switch  to
  2066. the watch window  and then <Del>  or <Alt-D>  to delete  the
  2067. watch.  Press <F6> again to return to the code window.
  2068.  
  2069. There are three other useful features in the debugger  which
  2070. were not covered  above.  These  are the  `Execute To'  key,
  2071. <F4>, the `Evaluate Expression' key, <Ctrl-E>, or  <Ctrl-F4>
  2072. and the `Breakpoint' key, <Ctrl-F8>.  When you press <F4> on
  2073. a non-blank line, the application will run until it  reaches
  2074. that line. This is useful  when you are somewhere within  an
  2075. application in  the  code  window  and you  wish  to  set  a
  2076. temporary breakpoint.  For a full discussion of the features
  2077. in the debugger, consult the chapter on the debugger.
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2097.       - Main Manual.                    Page: 35 -
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.                          Chapter 4
  2107.  
  2108.                          The Editor
  2109.  
  2110.  
  2111. This chapter covers  the functions and  capabilities of  the
  2112. editor in depth. Because of its size, the screen designer is
  2113. documented in  a chapter  of its  own, rather  than in  this
  2114. chapter.   You  should  have  read  the  chapter  on  RExL's
  2115. language before you use the editor, since the two are linked
  2116. very closely.
  2117.  
  2118.  
  2119. 4.1  Introduction
  2120.  
  2121.  
  2122. RExL's editor uses the concept of `folding text' to make the
  2123. programmer's job easier.  As  was explained in the  previous
  2124. chapter on the structure of RExL programs, applications  are
  2125. built up  in  a pyramidal  manner,  using rules  which  call
  2126. further rules and so on.   This gives the application a  two
  2127. dimensional structure which  has been  generally ignored  by
  2128. traditional `flat file' editors.   RExL, on the other  hand,
  2129. understands  this  hierarchical  structure  and  allows  the
  2130. programmer to access procedures immediately, without  having
  2131. to  do  searches  or  large  cursor  movements.    You  must
  2132. understand this folding-text approach before you progress to
  2133. the more complex aspects of the editor.
  2134.  
  2135. The editor `understands' RExL's  language:  Whenever a  line
  2136. of RExL code is entered,  RExL will check the line's  syntax
  2137. to determine if the line is syntactically valid.  If it  is,
  2138. then the text will be  scanned for variables which are  then
  2139. be placed into the variable list. The syntax analyser checks
  2140. not only for  errors such as  incorrect parameter lists  and
  2141. invalid mathematical operations, but  also for less  obvious
  2142. mistakes such as arrays with incorrect number of dimensions.
  2143. When a new rule is defined, it is placed into the rule list,
  2144. which can  then be  used to  locate  it rapidly.  A  similar
  2145. procedure applies to screens which also have their own list.
  2146.  
  2147.  
  2148.  
  2149.  
  2150.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2151.       - Main Manual.                    Page: 36 -
  2152.  
  2153.  
  2154. RExL's editor user interface  is based loosely on  Borland's
  2155. integrated editor, as present  in Turbo Pascal versions  4.0
  2156. to 5.5 and Turbo  C, versions 1.0 to  2.01.  Anyone who  has
  2157. used these editors should have no difficulty using RExL.
  2158.  
  2159.  
  2160. 4.2  Interface Conventions
  2161.  
  2162.  
  2163. There are a number of keystrokes and conventions which  RExL
  2164. adheres to throughout the system. These are documented here.
  2165.  
  2166.     o  Cursor: The  cursor can  assume  one of  two  shapes,
  2167.        depending on  whether it  is in  insert or  overwrite
  2168.        modes.  When in insert  mode, the cursor will be  the
  2169.        same size  as the  character block  and text  entered
  2170.        will be inserted  into the  current cursor  location,
  2171.        pushing the text  to the right of  the cursor off  to
  2172.        the right, possibly  losing some  at the  end of  the
  2173.        input area.  When in overwrite mode, the cursor  will
  2174.        be two pixels  high and placed at  the bottom of  the
  2175.        character box.   Text  entered  will erase  any  text
  2176.        which was previously present at the cursor  position.
  2177.        The <Ins> key  is used to  toggle between insert  and
  2178.        overwrite modes.
  2179.  
  2180.     o  Cursor Movement: The  <Left> and  <Right> arrow  keys
  2181.        move  one  character  left  and  right  respectively.
  2182.        <Ctrl-Left> and <Ctrl-Right> move  one word left  and
  2183.        right.  <Home>  and <End> move  to the beginning  and
  2184.        end of the input area, unless in the screen designer,
  2185.        where they move to the  left hand edge and the  right
  2186.        hand edge of  the screen. <PgUp>  and <PgDn> move  up
  2187.        and down by the size of the current window, unless in
  2188.        the screen designer, where they  are used to move  to
  2189.        the top and  bottom of the  screen. <Backspace>  will
  2190.        delete the  character  to  the left  of  the  cursor,
  2191.        moving the text  to the  right (and  the cursor)  one
  2192.        character  to  the  left.    <Del>  will  delete  the
  2193.        character underneath the cursor,  moving the text  to
  2194.        the right one character to the left.
  2195.  
  2196.     o  Input: When  RExL  requests  string input,  there  is
  2197.        generally a default value which is hilited in  yellow
  2198.        text on  magenta background  within the  dialog  box.
  2199.        RExL interprets the  first keystroke  pressed in  the
  2200.        dialog box as  follows:  Pressing  one of the  cursor
  2201.        movement keys will deselect  this default so that  it
  2202.  
  2203.  
  2204.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2205.       - Main Manual.                    Page: 37 -
  2206.  
  2207.  
  2208.        may be edited.   A non-extended keystroke (these  are
  2209.        the letters A  to Z, the digits  0 to 9,  punctuation
  2210.        marks  and  all  characters  whose  ASCII  codes  are
  2211.        greater than 128) will  cause the selected string  to
  2212.        disappear and the keystroke entered to appear as  the
  2213.        first character of  the string.  Any other  keystroke
  2214.        (<Up>, <Down>,  <PgUp>,  <PgDn>, the  function  keys,
  2215.        <Alt-> and  <Ctrl->  keystroke  combinations  and  so
  2216.        forth) will terminate  the dialog and  return you  to
  2217.        the place from where it originated.  Once the  dialog
  2218.        has been  deselected, input  can continue  using  the
  2219.        standard editing  keys.   In the  current release  of
  2220.        RExL, the  string entered  cannot be  wider than  its
  2221.        input area.
  2222.  
  2223.     o  Scrap Buffer: The  scrap buffer is  a small one  line
  2224.        buffer which  can be  used to  copy and  paste  small
  2225.        chunks of text from one  input area to another.   The
  2226.        contents of the  scrap buffer  are displayed  between
  2227.        the curly  brackets  {} on  the  status line  at  the
  2228.        bottom of  the editor  screen.   If the  buffer  area
  2229.        would overflow on account of the length of the string
  2230.        placed  in  it,  RExL  will  display  the  first  six
  2231.        characters of  the  string  followed by  an  ellipsis
  2232.        (three dots) followed by  the last six characters  of
  2233.        the text.
  2234.  
  2235.        Text is entered  into the  scrap using  <Shift-Enter>
  2236.        and pasted  from the  scrap using  <Shift-Ins>.   The
  2237.        scrap may be used, even  when it not displayed,  such
  2238.        as when in the screen  designer.  Note that when  you
  2239.        terminate  RExL  lists   by  pressing  <Enter>,   the
  2240.        previously hilited  item  will  be  pasted  into  the
  2241.        scrap.  Terminating  by pressing any  other key  will
  2242.        not perform the paste.  Note that inserting text from
  2243.        the scrap will overwrite any text to the right of the
  2244.        cursor.
  2245.  
  2246.     o  Undo: In  all  string  input  areas,  you  can  press
  2247.        <Ctrl-U> to undo any changes to the original string.
  2248.  
  2249.     o  Help: On line help is available at all times in RExL.
  2250.        There are two forms of  help.  The first is  context-
  2251.        sensitive, meaning  that the  help which  appears  is
  2252.        relevant to whatever you are currently trying to  do.
  2253.        This help  is activated  by  pressing the  <F1>  key.
  2254.        Language help will bring up a help screen related  to
  2255.        the language keyword which the cursor is placed over.
  2256.  
  2257.  
  2258.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2259.       - Main Manual.                    Page: 38 -
  2260.  
  2261.  
  2262.        This is  activated by  pressing  <Ctrl-F1>.   At  any
  2263.        time, the last  help screen  to be  displayed can  be
  2264.        re-displayed by pressing <Alt-F1>.
  2265.  
  2266.     o  Window Move: Most windows  in RExL are movable  using
  2267.        the standard arrow keys when <Scroll-Lock> is active.
  2268.        This key is normally located at the top right of your
  2269.        keyboard.  Note that no windows may be moved over the
  2270.        status line at the bottom of the screen nor the  menu
  2271.        bar at the top of the screen.
  2272.  
  2273.     o  Macro Recording: You  can record macros  `on-the-fly'
  2274.        from anywhere within  RExL.  A macro  is a series  of
  2275.        keystrokes which can be `recorded' and `played back'.
  2276.        To switch  on  the  macro recording  facility,  press
  2277.        <Alt-Equals>.  A  dialog box will  pop up  requesting
  2278.        the name of  the macro which you  are about to  start
  2279.        recording.  If  you don't want to  assign it a  name,
  2280.        just press  <Enter>.    RExL  will  then  ask  for  a
  2281.        keystroke to  attach the  macro  to (press  <Esc>  to
  2282.        abort the record).  While you are  recording, an  `R'
  2283.        will appear  in  the  top left  hand  corner  of  the
  2284.        display, press <Alt-Equals> again  to turn the  macro
  2285.        record off.   You can save the  macros to disk  using
  2286.        the Options/Save  macros  menu  option.   Macros  can
  2287.        record and replay up 512 keystrokes.
  2288.  
  2289.        The list  of  macros  defined  can  be  displayed  by
  2290.        pressing <Alt-Minus>.  To  play back a macro,  hilite
  2291.        the name  with  the  hilite bar  and  press  <Enter>.
  2292.        While a macro  is playing, a `P'  will appear in  the
  2293.        top left corner of the display.
  2294.  
  2295.     o  Helix Searching: When using menus in RExL, there  are
  2296.        two methods  which  can  be used  to  select  options
  2297.        quicker than using the cursor keys.
  2298.  
  2299.            -  Initial letter:  Most fixed size menus in RExL
  2300.               have initial letter searching.  In this  mode,
  2301.               all you need do is type the initial letter  of
  2302.               the menu option and  it will be  automatically
  2303.               selected.    The  initial  letter  is  usually
  2304.               hilited in light blue.
  2305.  
  2306.            -  Helix searching When the number of items in  a
  2307.               list or menu  is variable, for  example as  in
  2308.               the rule list, the  hilite bar can be  brought
  2309.               to an option incrementally by typing the  name
  2310.  
  2311.  
  2312.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2313.       - Main Manual.                    Page: 39 -
  2314.  
  2315.  
  2316.               of the  item  you  are  searching  for.    The
  2317.               portion of the  item entered is  hilited in  a
  2318.               slightly  differrent  color  from  the  normal
  2319.               hilite bar. The  hilite bar will  move to  the
  2320.               next item  which matches  the letters  entered
  2321.               already,  with  those  letters  being  colored
  2322.               black  on  a  light  gray  background.   Press
  2323.               <Backspace> to delete  letters from the  helix
  2324.               search list.
  2325.  
  2326.               For example,  if you  had  a menu  with  three
  2327.               items in  it, One,  Two  and Three,  when  the
  2328.               letter T is pressed,  the hilite bar moves  to
  2329.               the second option, and the first character  in
  2330.               the menu bar becomes black on gray.  When h is
  2331.               then pressed, the menu  bar moves to the  next
  2332.               option and hilites the letters Th.
  2333.  
  2334.     o  File Name Input: Whenever RExL requests a file  name,
  2335.        such as  when  selecting  a file  to  load  into  the
  2336.        editor, you  may either  enter  a proper  file  name,
  2337.        otherwise  you   can  enter   a  file   specification
  2338.        including any of  the wild-card characters,  ? or  *.
  2339.        When using the wild-cards, RExL will give you a  menu
  2340.        listing   those   files   which   match   the    file
  2341.        specification  entered.    Any  directories  in   the
  2342.        current search directory  are also  displayed in  the
  2343.        list and you  can change to any  one by selecting  it
  2344.        from the list.  The  list of files matching the  file
  2345.        specification  will  be  regenerated  from  the   new
  2346.        current directory. For all directories other than the
  2347.        root (when performing wild card file selections)  the
  2348.        first option  on the  menu will  be "..\".  Selecting
  2349.        this  directory  will  being  you  to  the  directory
  2350.        directly above the current one.
  2351.  
  2352.        You can  terminate  the  menu  file  name  select  by
  2353.        pressing <Enter> to select a  file name, or <Esc>  to
  2354.        abort the selection.
  2355.  
  2356.  
  2357. 4.3  Editor Basics
  2358.  
  2359.  
  2360. The editor is  started by typing `rexl'  at the DOS  prompt.
  2361. You can  optionally  supply  a filename  for  RExL  to  load
  2362. immediately into  the  editor.   Ther  is one  command  line
  2363. option  which may be passed to the editor, the `-l'  option.
  2364.  
  2365.  
  2366.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2367.       - Main Manual.                    Page: 40 -
  2368.  
  2369.  
  2370. This is used to tell the editor that it is running on an LCD
  2371. display.  Once the `-l'  option has been specified, it  will
  2372. be saved  to  the configuration  file,  so  it need  not  be
  2373. specified again.
  2374.  
  2375. The editor  does  two things  before  it becomes  ready  for
  2376. input.  Firstly, it attempts to load the RExL  configuration
  2377. file, REXL.CFG.  If there is no configuration file  present,
  2378. RExL  proceeds   without   comment.     Secondly,   if   the
  2379. configuration is so set up,  the editor will load the  index
  2380. for the help file, if it  is unable to do so, an error  will
  2381. be displayed.    The configuration  file stores  information
  2382. about the position and colors  of the windows in \rexl,  the
  2383. beeping, help,  function  case,  window  explosion,  bracket
  2384. matching, list  size,  LCD  and DOS  screen  storage  status
  2385. flags. When searching  for the  help file,  RExL will  first
  2386. search  the  current  directory   and  then  the   directory
  2387. specified by the REXL environment variable.
  2388.  
  2389. The editor uses only one  command line parameter, -l.   This
  2390. is used  to  tell RExL  that  an  LCD monochrome  screen  is
  2391. attached to the computer which  it is running on and to  set
  2392. the screen colors  accordingly.   Note that  the editor  can
  2393. autodetect a  standard monochrome  screen,  but not  an  LCD
  2394. monochrome since the hardware does not permit it.  Once  the
  2395. -l option has been specified once, RExL will store it in its
  2396. configuration file along  with the  rest of  the colors  and
  2397. various other configuration data.
  2398.  
  2399. Once the above  procedure has  been completed,  you will  be
  2400. presented with the main editor  screen (note that you  can't
  2401. have all the menus pulled down at once, as they are in  this
  2402. figure!   The  dots  indicate where  the  menu  is  normally
  2403. displayed):
  2404.  
  2405.               [Figure omitted in disk manual]
  2406.  
  2407. The bar at the top of  the screen has five pull down  menus.
  2408. These can be activated by pressing the left and right  arrow
  2409. keys to move from  one to the next,  and pressing the  enter
  2410. key to select the hilited menu. Once selected, the menu will
  2411. drop down  and a  standard selection  menu appears.  To  the
  2412. right of the six menu titles,  is the name of the RExL  file
  2413. which is  currently being  edited. If  the editor  has  been
  2414. started with no application name given on the command  line,
  2415. then this file name will be NONAME.RXL.  Note that if a file
  2416. of this name exists in the current directory exists already,
  2417. then it will be loaded.
  2418.  
  2419.  
  2420.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2421.       - Main Manual.                    Page: 41 -
  2422.  
  2423.  
  2424. The bottom line of the screen is the status line, and it  is
  2425. here that RExL posts the status of the editor as well as any
  2426. error messages which are generated.  On the left hand end of
  2427. the status line, between the  braces {} is the scrap  buffer
  2428. display, as explained earlier in this chapter.
  2429.  
  2430. The `Memory :' display on  the status line shows the  amount
  2431. of available memory  in the  editor. If  this becomes  lower
  2432. than about  20000 bytes,  you  may run  into  lack-of-memory
  2433. problems.
  2434.  
  2435. The `Level :' field displays the current rule `depth'  which
  2436. the editor has reached.  We will cover rule depth in  detail
  2437. further ahead in  this chapter. This  has a  maximum of  100
  2438. levels which is more than enough for most applications.
  2439.  
  2440. The six menus on the main horizontal menu bar have  contents
  2441. as follows:
  2442.  
  2443. 4.3.1  File menu
  2444.  
  2445.                          ┌───────────────┐
  2446.                          │ Load          │
  2447.                          │ New file      │
  2448.                          │ Save          │
  2449.                          │ Write to      │
  2450.                          │ Remove        │
  2451.                          │ Change dir    │
  2452.                          │ Default drive │
  2453.                          │ OS shell      │
  2454.                          │ Quit          │
  2455.                          └───────────────┘
  2456.  
  2457. The file menu has the following nine options:
  2458.  
  2459.    1.  Load:   This   option   controls   the   loading   of
  2460.        applications into RExL. When this is selected, a file
  2461.        name dialog box  (as explained  above) appears.  This
  2462.        will have as an initial value, the string "*.RXL".
  2463.  
  2464.    2.  New file: This option is  used to clear the  contents
  2465.        of the editor,  as if the  editor had been  restarted
  2466.        from the DOS prompt.  `NONAME.RXL' will be loaded  if
  2467.        is present in the current directory.
  2468.  
  2469.    3.  Save: When this option  is selected, the  application
  2470.        currently in  memory will  be  saved under  the  name
  2471.        displayed on the top line of the screen.  As a  short
  2472.  
  2473.  
  2474.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2475.       - Main Manual.                    Page: 42 -
  2476.  
  2477.  
  2478.        cut keystroke,  you can  press <F2>  from within  the
  2479.        main editor window.
  2480.  
  2481.    4.  Write to: This option allows the name of the  current
  2482.        application to  be changed.   When  it is  chosen,  a
  2483.        dialog box  will appear  requesting  a name  for  the
  2484.        current application to be written to. If a valid name
  2485.        is entered, the application  in memory will be  saved
  2486.        to disk under the new  name and the screen file  will
  2487.        be copied.
  2488.  
  2489.        If there is not enough disk space on the current disk
  2490.        drive for  the new  files,  then the  operation  will
  2491.        fail.  The  next menu option  may be  used to  remove
  2492.        unwanted files from disk.
  2493.  
  2494.    5.  Remove: This choice allows you to delete a file  from
  2495.        disk. You may need to do  this is you want to save  a
  2496.        file on disk, but are unable to do so through a  lack
  2497.        of disk space.
  2498.  
  2499.    6.  Change Dir: This option will allow you to change  the
  2500.        active directory.  The format  used here is much  the
  2501.        same as that used in the file name input routine, the
  2502.        only  differences  being  that  no  file  names   are
  2503.        displayed in  the list  and that  the current  active
  2504.        path  (drive  name  with  full  directory)  will   be
  2505.        displayed on the  status line  at the  bottom of  the
  2506.        screen.
  2507.  
  2508.    7.  Default Drive:  When this  option is  chosen, a  menu
  2509.        will pop up displaying the list of available DOS disk
  2510.        drives. As with  the directory  selection above,  the
  2511.        current  active  path  is  displayed  on  the  status
  2512.        display line at the bottom of the screen.
  2513.  
  2514.    8.  OS Shell: If you  want to run a  DOS command, but  do
  2515.        not wish to exit from the editor permanently,  choose
  2516.        this option to go into a DOS shell.  While you are in
  2517.        the shell, you should  not, under any  circumstances,
  2518.        run any T&SR programs (such as Sidekick, ScrGrab  and
  2519.        so forth), since these programs change critical  area
  2520.        of the computer's memory which may cause it to  crash
  2521.        unpredictably when you return to RExL.
  2522.  
  2523.        When you are  finished in the  shell, type `exit'  at
  2524.        the DOS prompt to return to RExL.
  2525.  
  2526.  
  2527.  
  2528.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2529.       - Main Manual.                    Page: 43 -
  2530.  
  2531.  
  2532.    9.  Quit:  This option terminates RExL and returns you to
  2533.        DOS. If the application currently in memory has  been
  2534.        altered, then  RExL  will prompt  you  to see  if  it
  2535.        should be saved. Selecting either of the options will
  2536.        perform the  action  and  then  return  you  to  DOS,
  2537.        pressing any other key will return you to the menu.
  2538.  
  2539. 4.3.2  Edit menu
  2540.  
  2541.                     ┌────────────────────────────────┐
  2542.                     │ Edit                           │
  2543.                     │ Default screen: <None>         │
  2544.                     └────────────────────────────────┘
  2545.  
  2546. The edit menu  contains two  options.   Selecting the  first
  2547. option, `Edit' will bring you directly into the edit  window
  2548. to begin creation or editing  of your application. The  edit
  2549. window will  be  covered in  detail  further ahead  in  this
  2550. chapter.
  2551.  
  2552. The second option, `Default screen:' is used for setting the
  2553. name of the screen which is to be preloaded into the  screen
  2554. designer.  When  this option  is selected,  the screen  list
  2555. will be generated and a screen may be chosen to be made  the
  2556. default. If a valid choice is made, then the screen designer
  2557. will be started  so that the  default screen  itself may  be
  2558. edited.  Default screens are most useful when all screens in
  2559. an application must have the same set of colors, have a  few
  2560. fixed fields or whatever.
  2561.  
  2562. To clear name  of the default screen  from the listing,  the
  2563. first option  in the  screen list,  `Clear default  screen',
  2564. should be selected.
  2565.  
  2566. 4.3.3  Run menu
  2567.  
  2568.                          ┌───────────────────┐
  2569.                          │ Run               │
  2570.                          │ Debug application │
  2571.                          └───────────────────┘
  2572.  
  2573. The run menu has the following two options:
  2574.  
  2575.    1.  Run: When  this  option  is  selected,  you  will  be
  2576.        requested to save the application which is  currently
  2577.        in memory (if necessary) and the runtime module  will
  2578.        be called to run it. Unlike the function of the  next
  2579.        option in this menu, the debugger will not be enabled
  2580.  
  2581.  
  2582.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2583.       - Main Manual.                    Page: 44 -
  2584.  
  2585.  
  2586.        when the application starts. Note that you can  enter
  2587.        the full  screen  debugger  at any  time  during  the
  2588.        running of  an application  by pressing  the  <Alt-D>
  2589.        keystroke (stands for Debug).
  2590.  
  2591.        When attempting  to locate  the runtime  module,  the
  2592.        editor first searches the current directory, then the
  2593.        directory specified by the RExL environment variable,
  2594.        and finally, the entire DOS  path, if one exists.  If
  2595.        the editor is unable to locate the runtime module, an
  2596.        error to this effect will be generated and the editor
  2597.        will continue running.
  2598.  
  2599.    2.  Debug application: As with the previous menu  option,
  2600.        the application  in  memory  will be  saved  and  the
  2601.        runtime  module   called   if  possible.   The   only
  2602.        difference  from  the  previous  menu  is  that   the
  2603.        debugger will be started  in full screen debug  mode,
  2604.        as if <Alt-D> had been pressed upon initiation of the
  2605.        application within the runtime.
  2606.  
  2607. 4.3.4  Lists menu
  2608.  
  2609.                          ┌────────────────────┐
  2610.                          │ Rule list          │
  2611.                          │ Screen list        │
  2612.                          │ Unused rule list   │
  2613.                          │ Unused screen list │
  2614.                          │ Variable list      │
  2615.                          │ Function list      │
  2616.                          └────────────────────┘
  2617.  
  2618. This menu  gives you  access to  all the  lists of  entities
  2619. which are defined the current application. Most of the lists
  2620. have special  `hot-links' to  other, more  specific,  lists.
  2621. These are mentioned  briefly at the  end of this  subsection
  2622. and covered in  more detail further on.  All of these  lists
  2623. are also available via hot-keys from within the main  editor
  2624. window.  Consult  the  section  on  editor  keys  for   more
  2625. information on this.
  2626.  
  2627. The lists run menu has the following six options:
  2628.  
  2629.    1.  Rule list: This list contains the names of all of the
  2630.        rules   which   are   currently   defined   in   your
  2631.        application.
  2632.  
  2633.  
  2634.  
  2635.  
  2636.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2637.       - Main Manual.                    Page: 45 -
  2638.  
  2639.  
  2640.    2.  Screen list:  This list  contains  the names  of  all
  2641.        screens defined in the currently active screen file.
  2642.  
  2643.    3.  Unused rule list:  This list shows  all rules  which,
  2644.        although defined in the normal way, are not  actually
  2645.        referenced  by  the  application.  Pressing   <Alt-D>
  2646.        within this list will delete the unused rule from the
  2647.        application.1
  2648.  
  2649.    4.  Unused screen list: This list gives all screens which
  2650.        are not  referenced in  the current  application.  As
  2651.        with the  unused rule  list above,  press <Alt-D>  to
  2652.        delete the unused  screen from the  list and free  up
  2653.        the space it occupies within the screen file.
  2654.  
  2655.    5.  Variable list: This list contains all variables.  The
  2656.        status line at the bottom of the screen displays  the
  2657.        type of the variable, whether numeric or string,  and
  2658.        whether it's an array or a simple variable.
  2659.  
  2660.    6.  Function list: This list  contains all the  functions
  2661.        available in RExL.  Press <Ctrl-F1> for  help on  the
  2662.        hilited function.
  2663.  
  2664.    7.  Graphic rule  display: This  displays the  rule  call
  2665.        tree for the current rule.   This is covered in  more
  2666.        detail in its own section.
  2667.  
  2668. All the list windows are movable by pressing  <Scroll-Lock>,
  2669. using the  arrow  keys  to position  and  pressing  <Enter>,
  2670. <Scroll-Lock> or <Esc>  to terminate the  window move.  Note
  2671. that all lists in RExL feature helix searching. You can also
  2672. output the contents of any  list to a file (or the  printer)
  2673. by pressing <Ctrl-P>, as in DOS.
  2674.  
  2675. If you terminate any of the lists by pressing <Enter>,  then
  2676. the choice which you selected from that menu will be  placed
  2677. into the scrap buffer, ready  for pasting using the  <Shift-
  2678. Insert> keystroke.
  2679.  
  2680.  
  2681.  
  2682.  
  2683. ____________________________________________________________
  2684. 1. Note that deeply recursive rules (those which do not have
  2685.    a  reference  to   themselves  in   the  immediate   rule
  2686.    definition) which are  not used  by other  rules are  not
  2687.    currently detected as being unused.
  2688.  
  2689.  
  2690.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2691.       - Main Manual.                    Page: 46 -
  2692.  
  2693.  
  2694. 4.3.5  Options menu
  2695.  
  2696.                     ┌───────────────────────┐
  2697.                     │ Load macros           │
  2698.                     │ Save macros           │
  2699.                     │ Beep off              │
  2700.                     │ Function lower case   │
  2701.                     │ Exploding windows off │
  2702.                     │ Dictionary size:  500 │
  2703.                     │ Help fast             │
  2704.                     │ Bracket match on      │
  2705.                     └───────────────────────┘
  2706.  
  2707. The options  menu  controls  various system  parameters  and
  2708. features not directly connected to the editor per se.
  2709.  
  2710.    1.  Load macros: Any macro definitions you define in  the
  2711.        editor may be saved to disk for later retrieval using
  2712.        this menu option. The  macro file format is  constant
  2713.        across the RExL product range, so that macros defined
  2714.        in the editor may be  used in the debugger or in  the
  2715.        database manager and so on.  Macros are explained  in
  2716.        more detail at the beginning of this chapter.
  2717.  
  2718.    2.  Save macros:  This option  allows you to save  macros
  2719.        which can then be reloaded at some future time  using
  2720.        the load option above.
  2721.  
  2722.    3.  Beep  off:    By  default,  RExL  beeps  whenever  it
  2723.        encounters an error. This  beeping can be toggled  on
  2724.        and off by selecting this option.
  2725.  
  2726.    4.  Function lower  case: By  default, all  functions  in
  2727.        RExL are displayed  in their natural  case.  This  is
  2728.        that functions  which  are  members of  families  are
  2729.        displayed  with  the  first  two  or  three   letters
  2730.        capitalised, while  the miscellaneous  functions  are
  2731.        entirely capitalised.  This option is used to  toggle
  2732.        between upper (or partially upper) case function name
  2733.        display and lower case.
  2734.  
  2735.    5.  Exploding windows  off:  In  its default  state,  all
  2736.        windows in RExL open instantaneously upon activation.
  2737.        This option can  be used  to make  windows `grow'  to
  2738.        full size  on the  screen.   This  is only  a  visual
  2739.        effect  and  has  no  effect  upon  the  application.
  2740.        Selecting the  option a  second  time will  turn  the
  2741.        option off again.
  2742.  
  2743.  
  2744.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2745.       - Main Manual.                    Page: 47 -
  2746.  
  2747.  
  2748.    6.  Dictionary size: The dictionary  size is the size  of
  2749.        all lists in RExL.   This defaults to a list size  of
  2750.        500 items, but can be  changed by using this  option.
  2751.        Each list entry  consumes four bytes  of memory.   If
  2752.        you   are   dealing   with   a   particularly   large
  2753.        application, you  may want  to  make this  list  size
  2754.        smaller to conserve memory.
  2755.  
  2756.    7.  Help fast: As explained earlier in this chapter,  the
  2757.        editor loads in the help  file index when it  starts.
  2758.        This is done so that  the help can respond  instantly
  2759.        to requests.  However,  the help file index  requires
  2760.        about 9000 bytes of  memory, so again, if  developing
  2761.        large applications,  you  may  wish  to  disable  the
  2762.        automatic loading. The help will then load the  index
  2763.        for every request which will slow it down somewhat.
  2764.  
  2765.    8.  Bracket match on:   When  entering expressions,  RExL
  2766.        will automatically hilite matching brackets.  This is
  2767.        to help you  locate incorrect  bracketing in  complex
  2768.        expressions.    You  can   toggle  this  feature   by
  2769.        selecting this option.
  2770.  
  2771. 4.3.6  Import menu
  2772.  
  2773.                          ┌─────────────────┐
  2774.                          │ Save to ASCII   │
  2775.                          │ Load from ASCII │
  2776.                          │ ASCII Options   │
  2777.                          └─────────────────┘
  2778.  
  2779. RExL will import and  export properly formatted RExL  source
  2780. files in ASCII format.  This is mainly done for purposes  of
  2781. documentation and hard copy archival.  All attributes of  an
  2782. application are  saved, including  screen colors,  text  and
  2783. screen fields.  The ASCII  file can become large because  of
  2784. the amount of  information contained in  it, typically,  the
  2785. size of the listing file is  seven to ten times the size  of
  2786. the combined listing and screen files.
  2787.  
  2788. The foreground  and  background  colors of  screens  in  the
  2789. application are saved in the  ASCII listing file as  letters
  2790. which map  directly  to colors.  The  colors are  mapped  as
  2791. follows:
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2799.       - Main Manual.                    Page: 48 -
  2800.  
  2801.  
  2802.           Table 4.1: ASCII Color Translation Table
  2803.  
  2804. Letter    Color          Letter    Color
  2805. 0         Black          1         Dark gray
  2806. B         Blue           b         Light blue
  2807. G         Green          g         Light green
  2808. C         Cyan           c         Light cyan
  2809. R         Red            r         Light red
  2810. M         Magenta        m         Light magenta
  2811. Y         Brown          y         Yellow
  2812. W         Light gray     w         White
  2813.  
  2814. The  listing  file  will   save  the  contents  of   screens
  2815. correctly, but certain  characters, such as  the ASCII  end-
  2816. of-file marker, character 26, may confuse other DOS programs
  2817. which read and write ASCII files, notably Sidekick, WordStar
  2818. and so  on,  although RExL  will  load the  file  correctly.
  2819. Furthermore,  the   ASCII   newline  and   carriage   return
  2820. characters,  characters   10   and  13   respectively,   may
  2821. unsynchronize the  listing file  so that  it will  not  load
  2822. properly.
  2823.  
  2824. There are two  active options  and one  sub-menu within  the
  2825. Import Menu.  These are as follows:
  2826.  
  2827.     o  Save to ASCII:  The application  currently in  memory
  2828.        will be saved to disk as an ASCII listing file.   The
  2829.        file name  will be  the same  as that  of the  parent
  2830.        application, but with  an extension of  .LST.   While
  2831.        the listing  is being  saved,  its progress  will  be
  2832.        posted on the screen.
  2833.  
  2834.     o  Load from ASCII: A standard file name input box  will
  2835.        pop up  when you  select this  option.   The  default
  2836.        input string is  "*.LST" which  you can  edit in  the
  2837.        usual manner.  When you have selected a file to load,
  2838.        RExL will being to process  the file.  Note that  the
  2839.        format of the file is  very strict and you  shouldn't
  2840.        edit the ASCII  listing, in case  the editor  doesn't
  2841.        accept it.   The listing file  will be  saved in  the
  2842.        current directory (irrespective of where the  listing
  2843.        file is)  under  the  same file  name,  but  with  an
  2844.        extension for the application  image of .RXL and  one
  2845.        for the  screen file  of .SCR.   If  either of  these
  2846.        files already  exist, then  they will  be backed  up:
  2847.        The application  image being  given an  extension  of
  2848.        .BAK and the screen file one of .BKS.
  2849.  
  2850.  
  2851.  
  2852.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2853.       - Main Manual.                    Page: 49 -
  2854.  
  2855.  
  2856.     o  During the  loading  process,  all  executable  lines
  2857.        (that is screen fields  and lines in the  application
  2858.        image) will  be displayed  in  a box  underneath  the
  2859.        progress box which  also displays  the percentage  of
  2860.        the lising file loaded,  for your convenience.   This
  2861.        is done  so that  when an  error  occurs, it  can  be
  2862.        displayed on screen and edited.
  2863.  
  2864.     o  ASCII Options: This is a sub-menu which contains  the
  2865.        following two options  related to  ASCII loading  and
  2866.        saving.
  2867.  
  2868.            -  Strip unused  vars: This  is a  yes/no  toggle
  2869.               option. When set  to yes  all variables  which
  2870.               are listed  in  the  ASCII listing  file,  but
  2871.               which are not used in  the actual code of  the
  2872.               application, are discarded  and not placed  in
  2873.               the newly generated variable list. When set to
  2874.               no, these unused variables are not removed.
  2875.  
  2876.            -  Emit screen  codes:  This  is  another  yes/no
  2877.               toggle option.  When it  is  set to  yes,  the
  2878.               color codes for the screens in the listing are
  2879.               emitted along  with the  text of  the  screen.
  2880.               For purposes  of  system  documentation,  this
  2881.               information is generally not needed, and  this
  2882.               option can therefore be set to no.
  2883.  
  2884.  
  2885. 4.4  Using the Editor
  2886.  
  2887.  
  2888. Once you have selected the  Edit option from the main  menu,
  2889. RExL is ready  for you to  start creating your  application.
  2890. All lines entered are  either statements, rules or  screens.
  2891. The rules for entering  each line type are  laid out in  the
  2892. next three sections.
  2893.  
  2894. The editor will  automatically assign  the line  connectors,
  2895. If, AND and OR according to the rules for block  connection.
  2896. That is, the  first non-blank line  in a  rule uses If,  the
  2897. first lines in the remainder of the and-blocks use OR, while
  2898. all remaining non-blank lines use AND.  Blank lines have  no
  2899. connector.
  2900.  
  2901. A rule  may be  declared as  one pass  by pressing  <Ctrl-O>
  2902. within the edit window.  Since the one-pass modifier applies
  2903. to the rule as a whole, the modifier [OnePass] is  displayed
  2904.  
  2905.  
  2906.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2907.       - Main Manual.                    Page: 50 -
  2908.  
  2909.  
  2910. in the rule name box at the top of the edit window.  As with
  2911. the rule type modifiers, <Ctrl-O> toggles its modifier.
  2912.  
  2913. 4.4.1  Entering Statements
  2914.  
  2915. Statements,  which  include  both  assignments  and  logical
  2916. expressions, are the simplest to specify, by pressing <F4>.
  2917.  
  2918. However, before RExL  will accept  a statement,  it must  be
  2919. syntactically valid.  The statement syntax checker scans the
  2920. line for invalid syntax, incorrectly dimensioned arrays  and
  2921. incorrectly used functions and variables. When it encounters
  2922. an error, it signals the location of the error on the  input
  2923. line with  an red  indicator.   A keystroke  will clear  the
  2924. error and return control to the editor, where the error  can
  2925. be corrected.
  2926.  
  2927. If the  line is  syntactically correct,  the syntax  checker
  2928. will recover all variables from the line and add them to the
  2929. variable list, available on <Alt-V>.   Any new arrays  found
  2930. in the statement will be dimensioned to ten elements in  all
  2931. their declared  dimensions,  although  this can  be  changed
  2932. through the variable list, explained shortly.
  2933.  
  2934. In certain  cases,  when  comparing strings  and  using  the
  2935. logical return values,  you may need  to bracket the  string
  2936. sub-expression to avoid incorrect  parsing. For example,  an
  2937. expression such  as  a:=10+"a"=a$  will  require  bracketing
  2938. since the  sub-expression 10+"a"  will be  evaluated  first,
  2939. since addition has a higher precedence than equality.
  2940.  
  2941. When the line has been passed as correct, the syntax checker
  2942. then converts the text into symbolic tokens which are stored
  2943. more efficiently  in memory  than text  alone.   This has  a
  2944. number of side effects:
  2945.  
  2946.     o  Variables  are   converted   to   internal   variable
  2947.        reference numbers:  It is for this reason that when a
  2948.        variable is entered a second time, the case in  which
  2949.        it finally appears will be the same as that in  which
  2950.        was first  entered.  For  example, if  you  enter  an
  2951.        expression such  as MyAge:=10  (where MyAge  has  not
  2952.        been defined  previously)  and  later  on  enter  the
  2953.        expression myaGE=12, then  the string  myaGE will  be
  2954.        converted to the earlier occurrence of MyAge.
  2955.  
  2956.     o  Numbers are stored in one of four forms, depending on
  2957.        their size.  Whole  integers  between -127  and  +127
  2958.  
  2959.  
  2960.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  2961.       - Main Manual.                    Page: 51 -
  2962.  
  2963.  
  2964.        inclusive are  stored exactly  as one  byte  numbers,
  2965.        whole integers between -32767  and +32767 are  stored
  2966.        exactly as two byte integers, whole integers  between
  2967.        -2147483647 and  +2147483647  are stored  exactly  as
  2968.        four byte numbers.  All  other numbers are stored  as
  2969.        as eight byte  double precision real  numbers, to  an
  2970.        accuracy of approximately fifteen digits.
  2971.  
  2972.        When you enter  a number, it  will be converted  into
  2973.        the appropriate internal format.  Any superfluous, or
  2974.        unstorable decimal places will be discarded.
  2975.  
  2976. 4.4.2  Entering Rules
  2977.  
  2978. Rules are the simplest entities to enter in RExL:  Any  line
  2979. without a modifier defaults to a rule.  When an unknown rule
  2980. is entered, it  is entered into  the rule list  immediately.
  2981. As with variables,  rules are stored  by reference, so  that
  2982. once a rule has been entered, its case cannot be changed.
  2983.  
  2984. The text of rules themselves  may be edited, and the  editor
  2985. will change all  references to  reflect the  new edition  of
  2986. that rule.
  2987.  
  2988. Rules can take  any of  the modifiers,  BackTo, Not,  While,
  2989. Multi, Single,  Zap  or a  blank  modifier.   Each  modifier
  2990. modifies the meaning of the rule as explained in the chapter
  2991. on the language,  a blank  modifier simply  means `call  the
  2992. rule' and do not modify its return value.
  2993.  
  2994. To set the  line's modifier, press  <Ctrl-> followed by  the
  2995. initial letter of the modifier.  Thus <Ctrl-Z> will generate
  2996. a Zap  modifier.  Pressing the  key  again will  remove  the
  2997. modifier and return  the rule  to its  unaltered state.  The
  2998. full list of modifiers and keystrokes is given at the end of
  2999. this chapter in the key reference.
  3000.  
  3001. To expand  the definition  of a  rule to  include  subrules,
  3002. statements, screens and so forth, press <Tab>.  The name  of
  3003. the expanded rule will be placed in the rule name box at the
  3004. top of the  edit window  and the  hilite bar  placed on  the
  3005. first line of the rule.  Press <Shift-Tab> to return to  the
  3006. parent rule.
  3007.  
  3008. Since all rules are stored by reference, the  capitalization
  3009. of a rule name is set when the rule is initially entered, it
  3010. cannot be changed after this. Whenever the name of a rule is
  3011. changed  (by  editing   it),  all  references   to  it   are
  3012.  
  3013.  
  3014.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3015.       - Main Manual.                    Page: 52 -
  3016.  
  3017.  
  3018. automatically updated.  The editor  will not allow the  name
  3019. of a rule to be  changed to one which exists already,  since
  3020. it can't determine which rule is referred to.
  3021.  
  3022. 4.4.3  Entering Screens
  3023.  
  3024. A screen can be one of five types, [Dialg], [Dsply], [Help],
  3025. [Menu] or [Print].  The meanings each of these modifiers  is
  3026. explained in the chapter on the screen designer.
  3027.  
  3028. As with rules, the name of a screen can be changed and  will
  3029. be updated  automatically in  the screen  file as  will  all
  3030. references to  it  in  the application  being  edited.    As
  3031. before, the new name cannot be one which already exists.
  3032.  
  3033. To enter a  screen, press <Tab> or  <F10> when hiliting  the
  3034. name of the screen in the edit window.  If the named  screen
  3035. does not exist in the screen file already, then you will  be
  3036. prompted to select a screen type from a pop up menu.
  3037.  
  3038. Because the screen designer is a major and large feature  in
  3039. RExL, it is documented in a chapter of its own.
  3040.  
  3041.  
  3042. 4.5  Editor Lists
  3043.  
  3044.  
  3045. At all times,  the editor  maintains lists  of all  entities
  3046. defined within RExL.  These are the lists of used and unused
  3047. rules, used and unused screens  and variables.  Most of  the
  3048. lists have `hot-links', or special keystrokes which  produce
  3049. lists specific to the item  hilited in the first list.   The
  3050. following three subsections tell how these lists are used.
  3051.  
  3052. When a list is activated, a window, the width of the  screen
  3053. is displayed. The window extends to the second last line  of
  3054. the  screen  if  there  are  enough  elements  to  fill  it,
  3055. otherwise it sizes itself to  produce a window large  enough
  3056. to hold all items.  If all the elements cannot be displayed,
  3057. a scroll bar will be displayed on the right hand edge of the
  3058. list. The <Scroll-lock> key can  be used to move the  window
  3059. using the arrow keys while the contents of the window may be
  3060. written  to  a  file  or  the  printer  using  the  <Ctrl-P>
  3061. keystroke. All lists containing  rules have a hot-link  tied
  3062. to the <Tab> key. When this is pressed, the editor will quit
  3063. the list and enter and expand the definition of the  hilited
  3064. rule.  This  keystroke is present in  the normal and  unused
  3065. rule lists, the screen list,  and all rule reference  lists.
  3066.  
  3067.  
  3068.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3069.       - Main Manual.                    Page: 53 -
  3070.  
  3071.  
  3072. If a  list  is  terminated by  pressing  <Enter>,  the  last
  3073. hilited item  in the  list will  be  pasted into  the  scrap
  3074. buffer. Terminating the list any other way (say by  pressing
  3075. <Esc>, <Left-Arrow>, <Right-Arrow> and so on) will not alter
  3076. the contents of the scrap.
  3077.  
  3078. 4.5.1  Reference List
  3079.  
  3080. The reference list of a rule is the list of the rules  which
  3081. reference, or call,  the rule currently  being edited.   The
  3082. only hot-link in the reference  list is the <Tab> key,  used
  3083. to enter a rule's definition.  Reference lists are available
  3084. in the screen  list, the rule  list and  the variable  list.
  3085. All reference lists are generated by pressing <Ctrl-R>.
  3086.  
  3087. The <Ctrl-R> keystroke can also be used to generate the list
  3088. of rules which  call the current rule.   This list  performs
  3089. the same  operations  as  the generic  rule  reference  list
  3090. above.
  3091.  
  3092. 4.5.2  Rule List
  3093.  
  3094. The rule list is the most  commonly used list of all and  it
  3095. is for this reason that  it is attached to the keystroke  of
  3096. <Alt-Z> or  <Shift-F2>.   The rule  list contains  two  hot-
  3097. links, the first is the  <Tab> link as explained above,  and
  3098. the second link, tied to <Ctrl-R>, which generates the  rule
  3099. reference list,  the  list  of  rules  which  reference  the
  3100. hilited rule.
  3101.  
  3102. 4.5.3  Screen List
  3103.  
  3104. The screen list  gives the names of  all screens defined  in
  3105. the application  and is  generated  by pressing  <Alt-S>  or
  3106. <Shift-F3>.    This  list  includes  both  used  and  unused
  3107. screens.  This  list has two  hot links,  the first tied  to
  3108. <Ctrl-R>, generates  a screen  reference list,  the list  of
  3109. rules which use the hilited screen.  This reference list has
  3110. the  normal  hot-link  key  of  <Tab>  to  enter  a   rule's
  3111. definition.  The second hot-link in the screen list is  tied
  3112. to <Tab>: When pressed, the editor will immediately jump  to
  3113. the first  occurrence  of  the  hilited  screen  within  the
  3114. application.
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3123.       - Main Manual.                    Page: 54 -
  3124.  
  3125.  
  3126. 4.5.4  Unused Rule List
  3127.  
  3128. The unused  rule list  gives the  list  of rules  which  are
  3129. unused in  the  current  application  and  is  generated  by
  3130. pressing <Alt-U> or <Shift-F4>.
  3131.  
  3132. There are a few minor quirks  which you need to be aware  of
  3133. when using this  list.  Firstly, the  list will not  contain
  3134. rules  which  are  used  by  unused  rules  but  are  unused
  3135. elsewhere within the application.  Secondly, rules which are
  3136. recursive, or use  the modified rules  from deeper than  the
  3137. first call  level of  the rule  will  not be  included.   To
  3138. clarify the last point, if  a rule called Top Rule called  a
  3139. rule Second Rule  which then called Top  Rule, all of  which
  3140. were unused by the rest of the application, the unused  rule
  3141. list would not  determine that neither  Top Rule nor  Second
  3142. Rule were unused. On the other hand, if Second Rule did  not
  3143. call Top Rule,  then Top  Rule alone  would be  found to  be
  3144. unused and placed in the list.
  3145.  
  3146. If you  wish to  remove unused  rules from  the  application
  3147. altogether, press <Alt-D> (or  <Ctrl-Y>).  The hilited  rule
  3148. will be removed  from memory and  `forgotten' by  RExL.   If
  3149. there are rules which were only used by newly deleted unused
  3150. rules, then  these can  be listed  by exiting  from and  re-
  3151. entering the list.
  3152.  
  3153. To enter the definition of an unused rule, press <Tab>  when
  3154. hiliting the  rule.    When you  are  finished  editing  the
  3155. definition of an unused rule, press <Shift-Tab> to return to
  3156. the main rule.
  3157.  
  3158. 4.5.5  Unused Screen List
  3159.  
  3160. The unused screen list  is generated by pressing  <Shift-F5>
  3161. and is  much the  same as  the  unused rule  list, with  the
  3162. exception that screens  which are used  by unused rules  are
  3163. said to be  used. Press <Alt-D>  or <Ctrl-Y>  to delete  the
  3164. screen from the screen file.
  3165.  
  3166. 4.5.6  Variable List
  3167.  
  3168. The variable  list,  on  <Alt-V> and  <Shift-F6>  lists  all
  3169. variables defined within your application.  When the list is
  3170. active, the status  line at the  bottom of  the screen  will
  3171. display the type of the variable and its dimensions, if  the
  3172. hilited variable is an array.
  3173.  
  3174.  
  3175.  
  3176.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3177.       - Main Manual.                    Page: 55 -
  3178.  
  3179.  
  3180. There is  one  hot-link  in the  variable  list:    Pressing
  3181. <Ctrl-R> will generate a list  of the rules which  reference
  3182. the hilited variable.  Note that the variable reference list
  3183. does  not  list  the  rules  which  contain  screens   which
  3184. reference the variable.   As with  all reference lists,  you
  3185. can go directly  to a hilited  rule by  pressing <Tab>  from
  3186. within the reference list.
  3187.  
  3188. You can alter the size of an array variable from within  the
  3189. variable list  by pressing  <Tab> when  hiliting the  array.
  3190. The cursor will reappear on the variable status line in  the
  3191. first of the array's dimensions,  where the value there  can
  3192. edited.  By default, all arrays are dimensioned to a size of
  3193. ten in all the array's dimensions.
  3194.  
  3195. 4.5.7  Function List
  3196.  
  3197. This list  contains  all  internal  RExL  functions  and  is
  3198. generated by pressing <Ctrl-F> or <Shift-F7>.  The arguments
  3199. which the function requires are listed on the status line at
  3200. the bottom  of the  screen. There  are twelve  abbreviations
  3201. which are  used for  the  twelve different  parameter  types
  3202. which may be passed to RExL's function.
  3203.  
  3204.         Table 4.2: Function Parameter Abbreviations
  3205.  
  3206. Abbreviation        Meaning
  3207. number              Numeric expression
  3208. string              String expression
  3209. variant             Numeric or string expression
  3210. arraynv             Variable size string or numeric array
  3211. array1v             One dimensional string or numeric array
  3212. array2v             Two dimensional string or numeric array
  3213. array3v             Three dimensional string or numeric array
  3214. arrayn$             Variable size string array
  3215. array1$             One dimensional string array
  3216. array2$             Two dimensional string array
  3217. array3$             Three dimensional string array
  3218. arrayn              Variable size numeric array
  3219. array1              One dimensional numeric array
  3220. array2              Two dimensional numeric array
  3221. array3              Three dimensional numeric array
  3222.  
  3223. Press  <Ctrl-F1>  to  get  language  help  on  the  function
  3224. currently hilited.
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3231.       - Main Manual.                    Page: 56 -
  3232.  
  3233.  
  3234. 4.6  Other Functions
  3235.  
  3236.  
  3237. The editor  has a  number of  other functions  which do  not
  3238. easily fall into any of the categories listed before.  These
  3239. are given here.
  3240.  
  3241. 4.6.1  Graphic Rule Display
  3242.  
  3243. The graphic  rule display,  generated by  pressing  <Alt-G>,
  3244. lists the dependencies of rules upon each other in an  easy-
  3245. to-understand graphic format.  When in the display, you  can
  3246. move the  hilite bar  up  and down  by  in the  normal  way.
  3247. Pressing <Tab>  will  expand  the currently  hilited  rule's
  3248. definition while pressing <Enter> will paste the name of the
  3249. hilited rule into the scrap buffer.
  3250.  
  3251. The easiest way to understand the graphic rule display is to
  3252. look at an example.
  3253.  
  3254.            [Figure not available in disk manual]
  3255.  
  3256. When the graphic rule display was called, the editor was  in
  3257. the main rule, the root of the application, so therefore the
  3258. entire dependency tree  will be displayed.    In this  case,
  3259. the Main Program consists of three rules linked as follows:
  3260.  
  3261. If    First rule
  3262. And   Second rule
  3263. And   Restart the application
  3264.  
  3265. In the graphic display, rules connected by AND's are  linked
  3266. by vertical bars, hence the  bar on the extreme left of  the
  3267. display connecting these three  rules.  First Rule  contains
  3268. the following:
  3269.  
  3270. If    First sub rule of 1st rule
  3271. And   Second sub rule of 1st rule
  3272.  
  3273. Or    Or This sub rule of the 1st rule
  3274.  
  3275. As with the  main rule,  the first  two lines  in the  first
  3276. and-block are linked  by a vertical bar.   When the  display
  3277. generator  reaches  an  OR  connector,  it  terminates   the
  3278. vertical bar and begins a new one.  In the case of the First
  3279. rule, there is only one line in the second and-block, so the
  3280. vertical bar cannot  extend beyond the  current line, so  it
  3281. will collapse to give a horizontal bar.  The same  procedure
  3282.  
  3283.  
  3284.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3285.       - Main Manual.                    Page: 57 -
  3286.  
  3287.  
  3288. applies to the Second rule which has the same format as  the
  3289. previous one.
  3290.  
  3291. Normal rules are  colored light gray,  while recursive  rule
  3292. calls or rules prefixed with the BackTo modifier are hilited
  3293. in yellow.   In  the example  above, all  rules are  colored
  3294. light gray, except  for the third  last rule  and the  final
  3295. rule in the  display, both of which  are prefixed by  BackTo
  3296. and are therefore colored yellow.
  3297.  
  3298. As with all lists, this can  be printed to a file or  device
  3299. by pressing <Ctrl-P> and entering a file name.
  3300.  
  3301. 4.6.2  Miscellaneous keystrokes
  3302.  
  3303. 4.6.2.1  Cut and paste
  3304.  
  3305. Beginning with version 2.10 of  RExL, blocks of text can  be
  3306. moved around in  the editor using  the concept  of the  line
  3307. buffer.  The line  buffer operates in a  similar way to  the
  3308. scrap buffer on the bottom line of the screen.
  3309.  
  3310. To copy  a block  of  text, it  must  be selected  and  then
  3311. inserted into the  line buffer.   The  <Alt-M> keystroke  is
  3312. used to set the `anchor' point and further movements of  the
  3313. cursor keys will  extend the block  in the direction  moved.
  3314. When the desired block has been marked it can be deleted, or
  3315. cut, to the line buffer by pressing <Shift-Del> or copied to
  3316. the line buffer by pressing <Alt-M> again.
  3317.  
  3318. When the line buffer contains text, the triple bar character
  3319. _≡_, is placed  at the left  hand end  of the editor  status
  3320. bar, just to the  left of the normal  scrap buffer. Text  is
  3321. copied to,  or  pasted from,  the  line buffer  by  pressing
  3322. <Alt-C>.
  3323.  
  3324. The editor will not  allow text to be  deleted to the  scrap
  3325. buffer if the current rule exists already in the rule stack.
  3326.  
  3327. 4.6.2.2  Editing keys
  3328.  
  3329. <Alt-B> places a blank line before the current line, pushing
  3330. those lines  after the  current line,  down one  line.   The
  3331. connector on the line pushed down will change to OR, in line
  3332. with the rules for connectors.
  3333.  
  3334. <Alt-D> will  delete the  current  line, pulling  all  lines
  3335. after the current  line up one line.   The line's  connector
  3336.  
  3337.  
  3338.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3339.       - Main Manual.                    Page: 58 -
  3340.  
  3341.  
  3342. will be changed if necessary.  The more normal keystroke  of
  3343. <Ctrl-Y> performs the same function as <Alt-D>
  3344.  
  3345. <Enter> will act in the same manner as <Down-Arrow>.
  3346.  
  3347. <Ctrl-Home> moves the hilite bar  to the top of the  screen,
  3348. while <Ctrl-End> moves it to the bottom of the screen or the
  3349. last line in  the rule,  whichever is  nearer.   <Ctrl-PgUp>
  3350. moves the hilite bar to the first line in the rule.
  3351.  
  3352. 4.6.2.3  Other keys
  3353.  
  3354. <Alt-X> will attempt to terminate the editor and return  you
  3355. to DOS.  If the file being edited has been changed since  it
  3356. was last saved, then you will be prompted to save the file.
  3357.  
  3358. <Alt-F5> displays the DOS screen, as it was when the  editor
  3359. first started up.
  3360.  
  3361. <Ctrl-F8> toggles a runtime breakpoint at the current  line.
  3362. The breakpoint will be signalled by a breakpoint  character,
  3363. ■.
  3364.  
  3365. <F2> will save the current application while <F3> will  load
  3366. a new one.
  3367.  
  3368. <F9>  runs  the  application  and  calls  up  the  debugger,
  3369. prompting the user  to save the  application if  it has  not
  3370. already been done.   <Ctrl-F9> runs the application  without
  3371. calling up the debugger.
  3372.  
  3373. <F10> will enter  the screen designer,  popping up a  screen
  3374. type selection menu if the screen specified on the line does
  3375. not already exist in the screen file.
  3376.  
  3377.  
  3378.  
  3379.  
  3380.  
  3381.  
  3382.  
  3383.  
  3384.  
  3385.  
  3386.  
  3387.  
  3388.  
  3389.  
  3390.  
  3391.  
  3392.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3393.       - Main Manual.                    Page: 59 -
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.                          Chapter 5
  3403.  
  3404.                       Screens in RExL
  3405.  
  3406.  
  3407. 5.1  Introduction
  3408.  
  3409.  
  3410. This  chapter  documents   the  screen   designer  and   the
  3411. capabilities of screens  in RExL.   Screens are an  integral
  3412. part of RExL as a whole  and are used for input, output  and
  3413. dialog in general with the outside world.  The documentation
  3414. on the screen designer is divided up into two chapters,  the
  3415. first dealing with the different types of screens  available
  3416. and their specific purpose with the system, while the second
  3417. deals with the  specifics of  using the  screen designer  to
  3418. produce the screens.
  3419.  
  3420. Any modifications to a screen in an application are  written
  3421. immediately to  disk in  the disk  based screen  file.  This
  3422. allows for  screen files  which  can be  arbitrarily  large.
  3423. However, if  changes are  made to  the screen  file, and  in
  3424. particular, if the position of  a screen changes within  the
  3425. screen file, then  the old  backup copy  of the  application
  3426. image on disk (the ".RXL"  file) will not hold a valid  copy
  3427. of your application.   The reason for  this is that  screens
  3428. are  stored  in  application  image  files  using  reference
  3429. numbers.   If  a screen's  position  is changed  within  the
  3430. screen file, then the reference  number for the screen  will
  3431. be invalidated, and because  of the algorithm for  squeezing
  3432. screens into screen files, other screens may be  invalidated
  3433. also. The upshot of this is that whenever a change has  been
  3434. made to a screen file, you should press <F2> from within the
  3435. edit window to update the  application image on disk.   This
  3436. is not strictly necessary, but  if you live in an area  with
  3437. frequent power  outages,  a  `dirty' power  supply  or  just
  3438. simply wish to keep a valid backup at all times, then you do
  3439. it.
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3447.       - Main Manual.                    Page: 60 -
  3448.  
  3449.  
  3450. 5.2  Fields
  3451.  
  3452.  
  3453. 5.2.1  Introduction
  3454.  
  3455. A screen  field is  an area  of  the screen  which has  some
  3456. special property or meaning when the screen is activated  in
  3457. the application.  There are  five different types of  field,
  3458. some of which are possible in only some types of screen.   A
  3459. table at the end of this section gives the legal and illegal
  3460. combinations of fields and screens.  All fields have certain
  3461. properties associated with them  which modify the  behaviour
  3462. of the field  in some manner.   The  various properties  are
  3463. covered in the next few paragraphs.
  3464.  
  3465. 5.2.1.1  Field Properties
  3466.  
  3467. Fields have two colors attached  to them.  The first is  the
  3468. active color, the color in which a field will appear when it
  3469. becomes the active field on  a screen.  The second color  is
  3470. the inactive color which is the color in which they will  be
  3471. displayed at all  other times, when they  are inactive.   By
  3472. default, all fields have the same active and inactive colors
  3473. (except for menu fields where one color is the `reverse'  of
  3474. the other,  and  output fields,  which  can have  no  active
  3475. state).  The combination of foreground and background  color
  3476. of a location on screen is generally known as its attribute,
  3477. to avoid confusion with the less precise term `color'  which
  3478. can be used to refer to the foreground color, the background
  3479. color or the combination of both.
  3480.  
  3481. All fields  which can  display changing  information can  be
  3482. specified as left justified (the default), in which case the
  3483. information to be displayed will be placed flush against the
  3484. left hand end  of the field,  or right  justified where  the
  3485. information is placed flush  right.  The justification  mode
  3486. can be selected from the field control menu.
  3487.  
  3488. The controlling  variable of  all fields  must be  a  proper
  3489. LValue, except for output fields  where it can be any  valid
  3490. expression.  While  the screen is being  run by the  runtime
  3491. module, the values of the various fields is rigorously  kept
  3492. up to date by global recalculation of all field values.  The
  3493. result of this is that  whenever a value is specified for  a
  3494. field,  the  value  is   stored  immediately  and  all   the
  3495. expressions in the  fields in the  screen are  recalculated.
  3496. However, if an  application contains a  screen with a  large
  3497. number of  fields,  this  recalculation may  slow  down  the
  3498.  
  3499.  
  3500.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3501.       - Main Manual.                    Page: 61 -
  3502.  
  3503.  
  3504. screen.    To   get  around   this  problem,   there  is   a
  3505. recalculation flag  attached to  fields to  specify  whether
  3506. that field should be recalculated every time.  As with field
  3507. justification, the recalculation state can be selected  from
  3508. the field control menu.
  3509.  
  3510. In the  screen  designer,  the  different  field  types  are
  3511. displayed using special characters which are removed  before
  3512. display during  execution.    The following  six  paragraphs
  3513. outline briefly the functions of each of the different field
  3514. types and how  they are displayed  on screen  in the  screen
  3515. designer.
  3516.  
  3517. Where possible, the  initial value of  a field  will be  the
  3518. value of the field's LValue upon entry to the screen.
  3519.  
  3520. 5.2.2  Output Fields
  3521.  
  3522. Output fields are the most common form of fields.  They  are
  3523. used to output either string or numeric information at fixed
  3524. positions and within fixed boundaries.  For numeric  output,
  3525. the decimal precision  of the  output can  be specified  and
  3526. defaults to  zero places  of decimals.   Output  fields  are
  3527. displayed on the screen using  hash symbols, #.  The  output
  3528. field  expression  can  be  any  valid  numeric  or   string
  3529. expression.   Note that  string results  are output  without
  3530. quotation marks unlike the debugger expression evaluator and
  3531. watch facility.
  3532.  
  3533. 5.2.3  Input Fields
  3534.  
  3535. Input fields  are  used  for input  of  string  and  numeric
  3536. information.  Like all other fields except output, the input
  3537. field expression must  be a  proper LValue.   Numeric  input
  3538. fields can have a decimal precision specified for input.  By
  3539. default, the precision is zero places of decimals but it can
  3540. be altered via the field control menu.
  3541.  
  3542. Input fields  can be  specified as  being required,  meaning
  3543. that for strings a non-blank  string must be entered,  while
  3544. for numbers,  a  non-zero number  must  be entered.    Input
  3545. fields are  displayed  on screen  as  a series  of  question
  3546. marks, ?, extending to the width of the input area.
  3547.  
  3548. 5.2.4  Toggle List Fields
  3549.  
  3550. A toggle list  field is a list  of string constants  through
  3551. which the end-user can move  by pressing <Space> or  <Right>
  3552.  
  3553.  
  3554.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3555.       - Main Manual.                    Page: 62 -
  3556.  
  3557.  
  3558. to go to the next, or  <Backspace> or <Left> to move to  the
  3559. previous choice.  There can be a maximum of 100 choices in a
  3560. single toggle list.  Toggle  lists are preferable to  string
  3561. input where there are only  a small number of valid  strings
  3562. which may be  entered.  Toggle  list fields  can use  either
  3563. numeric or string  LValues.  Toggle  lists are displayed  on
  3564. screen as a  series of piping symbols,  |, extending to  the
  3565. width of the field.
  3566.  
  3567. 5.2.5  Check Box Fields
  3568.  
  3569. A check box is a  field which only take  on a True or  False
  3570. value.  Check boxes are useful when you have to implement  a
  3571. boolean choice, for example:  whether the user wants to back
  3572. up  some  data.  String   and  numeric  LValues  are   valid
  3573. expressions for check boxes. The value returned to RExL  for
  3574. a checked check box is 1.0 for a numeric LValue and "Y"  for
  3575. a string LValue, while an unchecked check box returns 0.0 to
  3576. a numeric LValue and "N" to a string LValue.
  3577.  
  3578. If the  check box  expression is  of string  type, then  the
  3579. initial character in  the string  is used  to determine  the
  3580. initial value of  the check box  field. The characters  "Y",
  3581. "T", "y" and "t" are all  taken to mean True and all  others
  3582. are taken as False.
  3583.  
  3584. A check box is displayed on screen as an open square bracket
  3585. followed by a space and a close square bracket character:  [
  3586. ].  When  a check box  is checked, the  space in the  center
  3587. will be replaced by a tick mark √.  The value in a check box
  3588. is toggled by pressing <Space>.
  3589.  
  3590. 5.2.6  Radio Button Fields
  3591.  
  3592. A radio button field is  a vertical list of choices, one  of
  3593. which must be chosen (it  is for this reason that the  field
  3594. is known as  a radio button).  This field  type is used  for
  3595. input of information similar to that in a toggle list field.
  3596. Radio button fields are displayed as a three character  wide
  3597. column, each  line  consisting  of  an  opening  parentheses
  3598. followed by a space and a closing parentheses.  The  current
  3599. choice of the radio button is denoted by a solid dot  placed
  3600. between one of the sets of parentheses: ().
  3601.  
  3602. When activated, <Up> and <Backspace> are used to move to the
  3603. previous member of the radio button list, while <Space>  and
  3604. <Down> are used  to move to the  next member.   Alphanumeric
  3605. keystrokes (letters  and digits)  bring  the cursor  to  the
  3606.  
  3607.  
  3608.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3609.       - Main Manual.                    Page: 63 -
  3610.  
  3611.  
  3612. first  button  whose  label's  initial  letter  matches  the
  3613. keystroke. Labels are considered to  be to the right of  the
  3614. radio button list.
  3615.  
  3616. Consider the following radio button list:
  3617.  
  3618.      ( ) First Choice
  3619.      ( ) Second Choice
  3620.      ( ) Third Choice
  3621.      ( ) Fourth Choice
  3622.  
  3623. On entry  the radio  button will  indicate the  label  First
  3624. Choice.  Pressing the letter `S' will bring move the  cursor
  3625. to the second choice, since the initial letter of the  label
  3626. is `S'.   Pressing  `F' once  brings  the indicator  to  the
  3627. fourth choice, while pressing it again brings it back to the
  3628. first choice.
  3629.  
  3630. 5.2.7  Menu Fields
  3631.  
  3632. Menu fields are the simplest type of field available in RExL
  3633. and can only  occur in menu  screens.   They are defined  as
  3634. retangular areas of any size. When in use, the user switches
  3635. from one field to the next  in the same manner as in  input,
  3636. check box, toggle  list and radio  button fields.   As  with
  3637. radio buttons above, entering  letters will move the  hilite
  3638. bar to the  first field after the  currently hilited one  to
  3639. contain  the  letter  pressed  in  its  uppermost  and  left
  3640. position.
  3641.  
  3642. Unlike the other field types, menu fields may contain  other
  3643. fields.  You  can thus create menus  with variable items  by
  3644. placing menu  fields over  output fields  which display  the
  3645. item values.   If you  so wish,  you can  place menu  fields
  3646. within one another to give a moving bar type display.
  3647.  
  3648. Menu screens return a value  to the LValue attached to  that
  3649. screen. Internally, the LValue is stored as the first  field
  3650. in the menu  screen and  can only  be changed  when you  are
  3651. entering the screen designer, and not from within the screen
  3652. designer itself.
  3653.  
  3654.  
  3655. 5.3  Screen Types
  3656.  
  3657.  
  3658. There are five different types of screen, each designed  for
  3659. a specific purpose.  As  explained in the Language  chapter,
  3660.  
  3661.  
  3662.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3663.       - Main Manual.                    Page: 64 -
  3664.  
  3665.  
  3666. each screen has an associated modifier which instructs  RExL
  3667. what to do  with the  screen when  it encounters  it in  the
  3668. application.
  3669.  
  3670.                   Table 5.1: Screen Types
  3671.  
  3672. Abbreviation   Used for
  3673. [Dialg]        Basic input and output
  3674. [Dsply]        Output with pause
  3675. [Help ]        On-line user application help display
  3676. [Menu ]        Menu choice display
  3677. [Print]        Hard copy output
  3678.  
  3679. Because modifiers are  attached to  individual lines  rather
  3680. than to the screens per se, a single screen can be used with
  3681. more than  one  modifier. A  typical  example is  a  results
  3682. output screen which  can be  displayed as  a dialog  screen,
  3683. using the  [Dialg]  modifier and  then  printed as  a  print
  3684. screen using [Print].
  3685.  
  3686. As noted  above,  not  all  field types  are  valid  in  all
  3687. screens.  The following  table lists the valid  combinations
  3688. of field types and screen types.
  3689.  
  3690.    Table 5.2: Valid Combinations of Screen and Field Type
  3691.  
  3692.           Output    Input     Toggle    Check     Radio     Menu
  3693. Dialog    Yes       Yes       Yes       Yes       Yes
  3694. Menu      Yes                                               Yes
  3695. Print     Yes
  3696. Help      Yes
  3697. Display   Yes
  3698.  
  3699. If you try to use a field in a screen which does not support
  3700. that field type,  you may get  spurious results.   As  noted
  3701. above, menu screens store their LValue in the first field in
  3702. the screen, thus if you try to convert a non-menu screen  to
  3703. a menu screen, the menu's LValue will become the  expression
  3704. entered for  the first  field in  the non-menu  screen.   In
  3705. general, you should  only mix  screen types  which have  the
  3706. same field types available.
  3707.  
  3708. The next five  subsections give details on  the use of  each
  3709. screen type.
  3710.  
  3711.  
  3712.  
  3713.  
  3714.  
  3715.  
  3716.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3717.       - Main Manual.                    Page: 65 -
  3718.  
  3719.  
  3720. 5.3.1  Dialog Screen
  3721.  
  3722. The dialog screen is the most used of all the screen  types.
  3723. It is the only screen  which can contain numeric and  string
  3724. input, check boxes, radio buttons and toggle lists.
  3725.  
  3726. Input starts from the top of the screen and proceeds to  the
  3727. right and down  the screen.   When in  the screen  designer,
  3728. pressing <Ctrl-S> displays the field sequence number of  the
  3729. field underneath  the  cursor.   The  sequence  numbers  are
  3730. updated whenever a field is moved, created or copied.
  3731.  
  3732. <Tab>, <Down-Arrow> and <Enter> are used to move forward one
  3733. field and <Shift-Tab> and <Up-Arrow> to move back one field.
  3734. If there is a field directly above and touching the  current
  3735. field, then <Up-Arrow> will move to that field, instead of a
  3736. field to the right of the upper field. <Down-Arrow> works in
  3737. the same  way.    This  makes  block  areas  of  input  more
  3738. intuitive to use.
  3739.  
  3740. To terminate the dialog screen, press <Enter> when the final
  3741. field on  the screen  is active,  or <Ctrl-Enter>  from  any
  3742. field.
  3743.  
  3744. In numeric and string input fields,  <End> moves the  cursor
  3745. to the right hand  end while <Home> moves  to the left  hand
  3746. end.  <Ctrl-Left> and <Ctrl-Right> move the cursor one  word
  3747. to the left and right respectively while <Ctrl-U> undoes any
  3748. changes to numeric and string input areas.
  3749.  
  3750. If there are a  large number of fields  on the screen,  then
  3751. you may want  to turn off  automatic field recalculation  to
  3752. speed up processing of the screen.
  3753.  
  3754. If there are  any string or numeric  input fields which  are
  3755. defined as being necessary but are not filled (non-zero  for
  3756. numeric fields),  then  a message  to  this effect  will  be
  3757. displayed at the bottom of the screen and the missing  field
  3758. will be filled  with X's which  are removed  with the  error
  3759. message when a key is pressed.
  3760.  
  3761. 5.3.2  Display Screen
  3762.  
  3763. Display screens are used to display information and to pause
  3764. for a keystroke.   This  is to get  around having  to use  a
  3765. dialog screen  with no  active fields  in it  followed by  a
  3766. KBread() statement. The keyboard buffer is not emptied  when
  3767.  
  3768.  
  3769.  
  3770.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3771.       - Main Manual.                    Page: 66 -
  3772.  
  3773.  
  3774. this screen type  is used, so  you may  need to precede  the
  3775. screen with a KBclear() statement.
  3776.  
  3777. 5.3.3  Help Screen
  3778.  
  3779. Help screens are  used to implement  context sensitive  help
  3780. during screen dialog.  The number of help screens  available
  3781. to the user is not  limited, although there can only be  one
  3782. help screen available at any one time. Whenever the  runtime
  3783. module encounters a help screen, an internal variable  saves
  3784. the name of the screen, then any subsequent <F1>  keystrokes
  3785. will cause  this screen  to be  displayed.   When  the  help
  3786. screen has been  displayed, RExL waits  for a keystroke  and
  3787. then restores the contents of the screen as they were before
  3788. <F1> was pressed.
  3789.  
  3790. Once a screen  has been saved  as the  current help  screen,
  3791. that screen will remain current until the next occurrence of
  3792. a help screen.
  3793.  
  3794. 5.3.4  Menu Screen
  3795.  
  3796. Menu screens return a value  to a numeric variable  attached
  3797. to the  screen and  can be  used to  implement block  menus.
  3798. Menu fields, which can only be used in this type of  screen,
  3799. can be of  any size  and may  be nested  inside one  another
  3800. unlike other field types.  When a menu field is defined, the
  3801. field's inactive color  is set  as described  above but  the
  3802. field's active color is set to the `reverse' of the inactive
  3803. color (for the computer literate, the active color is xor'ed
  3804. with 7Fh to generate the  reverse attribute).  This is  done
  3805. so that the end-user of the system can tell which menu field
  3806. is currently active.
  3807.  
  3808. When a menu area has been defined on screen, a vertical line
  3809. of piping symbols, |, is  placed on the left hand and  right
  3810. hand sides  of the  area. When  the  menu is  active on  the
  3811. screen, the piping symbols are replaced by blanks, to give a
  3812. margin one character wide at either end of the area.
  3813.  
  3814. When in use, the keys of <Up>, <Down>, <Tab> and <Shift-Tab>
  3815. may be used to switch between menu fields in the normal way.
  3816. As with the radio button field as explained above,  pressing
  3817. letters will move the active  menu to the field whose  first
  3818. character (starting  from  the top  left  of the  field  and
  3819. moving right and down) matches the keystroke typed.
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3825.       - Main Manual.                    Page: 67 -
  3826.  
  3827.  
  3828. If there  are no  menu fields  in  a menu  screen, then  the
  3829. screen is displayed and  execution continues without  pause.
  3830. As mentioned  above, the  first field  in a  menu screen  is
  3831. reserved for the menu screen's LValue.  you should bear this
  3832. in mind when trying to turn a menu screen into another  type
  3833. of screen (or vice versa).
  3834.  
  3835. 5.3.5  Print Screen
  3836.  
  3837. Print screens are used to send output to the printing device
  3838. attached to your  computer, which by default is the DOS file
  3839. PRN file. This default can be  changed by using the OUTPUT()
  3840. command. A print screen may only contain output  fields.
  3841.  
  3842. Although RExL has no  intrinsic support for printer  effects
  3843. such as italics,   bold and so forth,  you can send  control
  3844. sequences to  the  printer by  using   output  fields  which
  3845. output the required characters.
  3846.  
  3847. When  RExL  is  printing  a  screen,  it  omits  all   lines
  3848. containing spaces from the   bottom of the screen, to  avoid
  3849. having large blank spaces in  the printout. If  you want  to
  3850. have print screens of fixed  lengths, then you should  place
  3851. some  nonblank  character at the final  line of the  screen.
  3852. For example,  if you  wish   to  print out  labels of  fixed
  3853. height of (say)  9 lines, irrespective of  the  contents  of
  3854. the screen,  then  you  should place  some  unprintable  but
  3855. nonblank  character  on the final  line. The tab  character,
  3856. CHR$(9), is ideal for this and   could be placed in its  own
  3857. output field  on the  last line  of the  label, or  in   the
  3858. inter-label space.
  3859.  
  3860. 5.3.6  Subscreens
  3861.  
  3862. Subscreens are identical  in function  to ordinary  screens,
  3863. the only difference  being that they do not occupy the  full
  3864. size of the screen. Subscreens  are  slightly cumbersome  to
  3865. define: By default,  when the screen designer  is asked   to
  3866. design a  new screen,  it assumes  that the  full screen  is
  3867. required. To get   around  this, a  temporary screen  (which
  3868. will be  dumped  later)  must  be  created    and  then  the
  3869. subscreen designed and  saved as  a block  using the  !Save!
  3870. option  in the block menu.
  3871.  
  3872. The procedure to define a  subscreen is as follows. Type  in
  3873. some temporary and  unique  screen name into the editor  and
  3874. press <F10> to select the screen  type. The screen can  then
  3875. be designed as normal. When the design has been   completed,
  3876.  
  3877.  
  3878.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3879.       - Main Manual.                    Page: 68 -
  3880.  
  3881.  
  3882. the area of  the subscreen can  be marked  out and saved  to
  3883. disk as   the appropriate screen  type. As  this point,  the
  3884. screen designer can be   terminated and control returned  to
  3885. the editor. Since the screen  was not saved,  the line  will
  3886. have reverted to  being a rule  which can  then be  deleted,
  3887. since  it  was only  temporary anyway.  The subscreen  saved
  3888. from within  the screen   designer  is  now present  in  the
  3889. screen list  and  can  be inserted  into  the    application
  3890. listing as a  normal screen. To force  the screen type,  the
  3891. screen   designer will  have to  be re-entered  by  pressing
  3892. <F10> on the screen name  and  by selecting the  appropriate
  3893. screen type.
  3894.  
  3895. If  changes  are  made  within  the  screen  designer  to  a
  3896. previously defined  subscreen, then  upon exit or saving  of
  3897. the screen, the screen designer  will  ask if the screen  is
  3898. to be saved at its previous size or at full screen size.
  3899.  
  3900.  
  3901.  
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3933.       - Main Manual.                    Page: 69 -
  3934.  
  3935.  
  3936.  
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942.                          Chapter 6
  3943.  
  3944.                  Using the Screen Designer
  3945.  
  3946.  
  3947. 6.1  Starting the Screen Designer
  3948.  
  3949.  
  3950. The screen designer is fully integrated into the editor  and
  3951. can be accessed through the <F10> key.
  3952.  
  3953. Before you  can  enter  the screen  designer  and  create  a
  3954. screen, you must supply a screen name for the screen so that
  3955. it can be entered into the screen file on disk immediately.
  3956.  
  3957. Once a new  screen name has  been entered,  the screen  type
  3958. must be defined using the  screen type menu on <F10>.   This
  3959. is a five  item pop-up menu which  lists the five  different
  3960. screen types.  The  items are listed in  the order in  which
  3961. they are most commonly used.
  3962.  
  3963.                          ┌───────────┐
  3964.                          │ Dialog    │
  3965.                          │ Menu      │
  3966.                          │ Print     │
  3967.                          │ Help      │
  3968.                          │ Display   │
  3969.                          └───────────┘
  3970.  
  3971. The screen type  is selected in the  normal manner by  using
  3972. the up and down arrow keys and pressing <Enter>.
  3973.  
  3974. When a  screen  has  been  saved  and  the  screen  designer
  3975. terminated, the normal editor  screen will reappear and  the
  3976. screen name previously entered will be prefixed with one  of
  3977. the five screen modifiers as described above.  The action of
  3978. the <F10> key is slightly  different when applied to a  line
  3979. containing the name of a  screen and the type of the  screen
  3980. as reported by the line's modifier.  In this situation,  the
  3981. screen designer is activated directly without going  through
  3982. the screen type  menu.   In order to  change the  type of  a
  3983. screen (for  example  from  a  display  screen  to  a  print
  3984.  
  3985.  
  3986.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  3987.       - Main Manual.                    Page: 70 -
  3988.  
  3989.  
  3990. screen), you  must enter  the name  of  the screen  with  no
  3991. modifier and then press <F10>.
  3992.  
  3993. Once the line modifier has been entered, the screen designer
  3994. can be reactivated  by pressing  <Tab> on  the screen  name,
  3995. since the editor knows that this line refers to a screen and
  3996. not a rule.
  3997.  
  3998. If the menu  screen type has been  selected from the  screen
  3999. type menu, a dialog box will be displayed prompting for  the
  4000. menu  variable  (which  can  be  any  proper  RExL   LValue)
  4001. associated with that screen.   As explained above, when  the
  4002. menu screen terminates, the  screen's menu variable will  be
  4003. set to the field number of the field which was current  when
  4004. <Enter> was  pressed.    When the  menu  variable  has  been
  4005. entered, the screen designer will start.
  4006.  
  4007. When the screen designer is entered for the first time,  the
  4008. screen will be  filled with the  half-tone character  (ASCII
  4009. 177) colored in light gray on a black background (unless the
  4010. `Print' screen type was selected,  in which case the  screen
  4011. will be blank).  The the cursor will be in the top left hand
  4012. corner of the  screen and screen designer  is now ready  for
  4013. input.  If  there is a default  screen defined (through  the
  4014. Edit|Default screen menu  option) then the  contents of  the
  4015. screen will be loaded automatically.
  4016.  
  4017. If the screen designer is started with a previously  defined
  4018. screen, the screen designer  will remove fields which  would
  4019. be invalid in the newly chosen screen type.  For example, if
  4020. a screen which  was previously of type  `Menu', and it  were
  4021. then opened as a `Dialog' screen, then the menu variable and
  4022. the menu fields  would be stripped  from the  screen.   This
  4023. feature should be  borne in mind  when saving  screens.   In
  4024. general, cross-type screen
  4025. translation should be avoided for this reason.
  4026.  
  4027.  
  4028. 6.2  Basic Design
  4029.  
  4030.  
  4031. The cursor  is  moved  in  the  screen  designer  using  the
  4032. standard arrow keys  <Up>, <Down>, <Left>  and <Right>.   In
  4033. addition to these keys are the following:
  4034.  
  4035.  
  4036.  
  4037.  
  4038.  
  4039.  
  4040.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4041.       - Main Manual.                    Page: 71 -
  4042.  
  4043.  
  4044.            Table 6.1: Screen Designer Cursor Keys
  4045.  
  4046. Key            Moves cursor
  4047. <Home>         to start of line
  4048. <End>          to end of line
  4049. <PgUp>         to top of screen
  4050. <PgDn>         to bottom of screen
  4051. <Ctrl-Left>    left one word
  4052. <Ctrl-Right>   right one word
  4053. <Ctrl-Home>    to top of screen
  4054. <Ctrl-End>     to bottom of screen
  4055. <Ctrl-PgUp>    to top left hand corner of screen
  4056. <Ctrl-PgDn>    to bottom right hand corner of screen
  4057. <Tab>          right ten characters
  4058. <Shift-Tab>    left ten characters
  4059. <Enter>        to beginning of line
  4060.  
  4061. The action of the <Enter> key is slightly more complex  than
  4062. simply moving to the start of the next line:  If there is  a
  4063. box character on the next line underneath and to the left of
  4064. the cursor, then the cursor will be placed on the right hand
  4065. side of the box character.   This behaviour makes it  easier
  4066. to enter text in boxes on the screen.
  4067.  
  4068.  
  4069. 6.3  Fields in the Screen Designer
  4070.  
  4071.  
  4072. The screen designer supports the use of six different  types
  4073. of fields as explained in the previous chapter.  In general,
  4074. a field definition can be  initiated by pressing <Ctrl>  and
  4075. the initial  letter of  the field  type  which you  wish  to
  4076. define (for example output fields are attached to <Ctrl-O>).
  4077. A field definition menu is attached to <Ctrl-F>, from  where
  4078. you can  select  the field  type  to  define, if  you  can't
  4079. remember the different field types.
  4080.  
  4081. When defining a field, the area marked out on the screen  is
  4082. painted  in  `reverse'  colors  to  hilite  it  against  the
  4083. background.    The  location  on  screen  where  the   field
  4084. definition was  initiated acts  as an  `anchor' point  which
  4085. remains fixed  while the  field is  defined. Initially,  the
  4086. cursor is placed on the anchor point and can be moved  about
  4087. the screen using the arrow  keys plus the four other  cursor
  4088. keys <Home>, <End>, <PgUp> and  <PgDn>.  <Enter> is used  to
  4089. terminate the field definition.
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4095.       - Main Manual.                    Page: 72 -
  4096.  
  4097.  
  4098. The menu  field is  the  only field  type  which can  be  of
  4099. arbitrary size so in all  other field type definitions,  the
  4100. movements of  the  cursor  are  limited  to  avoid  creating
  4101. improper fields.  The following table lists the valid  sizes
  4102. of fields:
  4103.  
  4104.                 Table 6.2: Valid Field Sizes
  4105.  
  4106.           Vertical Movement        Horizontal Movement
  4107. Output    Fixed height of one      Yes
  4108. Input     Fixed height of one      Yes
  4109. Toggle    Yes                      Fixed width of 3
  4110. Check     Fixed height of one      Fixed width of 3
  4111. Radio     Yes                      Fixed width of 3
  4112. Menu      Yes                      Yes
  4113.  
  4114. When the field  has been defined, a  dialog box will  appear
  4115. (not applicable to  menu fields) into  which the  expression
  4116. associated with that field is entered. While in this  dialog
  4117. box, you are free  to use the scrap  buffer as normal,  even
  4118. though it  is  not displayed.    The function  and  variable
  4119. dictionaries are also available.
  4120.  
  4121. Every field on the screen has a field number associated with
  4122. it.  This number codes for the order in which the fields are
  4123. to be  evaluated  when the  screen  is  run by  the  runtime
  4124. module.   The fields  are numbered  sequentially from  zero,
  4125. increasing moving to  the right  and then  down the  screen.
  4126. This behaviour is  compatible with the  IBM- and  MicroSoft-
  4127. defined CUA standard for user interfaces.  Whenever a  field
  4128. is created, moved or deleted, the screen sequencing  numbers
  4129. are recalculated, this  may cause delays of  the order of  a
  4130. half a second or  so on XT-class machines.   In the  current
  4131. release, there is  no way to alter  the sequencing order  of
  4132. fields in the screen.
  4133.  
  4134. In any one  screen there may  be up to  128 fields.   Beyond
  4135. this limit, the amount of  time required for processing  the
  4136. fields becomes noticeable.  It should also be noted that any
  4137. screen which uses more than 128 fields will be cluttered and
  4138. should be redesigned to use less fields.
  4139.  
  4140. The methods for entering the various fields are presented in
  4141. the next six sections.
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4149.       - Main Manual.                    Page: 73 -
  4150.  
  4151.  
  4152. 6.3.0.1  Output
  4153.  
  4154. <Ctrl-O> is used  to define an  output field. Output  fields
  4155. can be  up  to eighty  characters  wide,  the width  of  the
  4156. screen, and are  one character in  height.  Only  horizontal
  4157. movement is permitted while defining an output field.
  4158.  
  4159. When the field has been marked out, a dialog box will appear
  4160. prompting for an output expression.   This can be any  valid
  4161. RExL expression  and it  will be  syntax checked  before  it
  4162. being accepted by the designer.  When a valid expression has
  4163. been entered, the  marked area  will be  replaced with  hash
  4164. symbols, #, to denote an output field.
  4165.  
  4166. 6.3.0.2  Input
  4167.  
  4168. <Ctrl-I> is used to define an input field.  Input fields can
  4169. be up to  eighty characters wide  and are  one character  in
  4170. height.   The input  expression must  be a  properly  formed
  4171. LValue.  As with output  expressions, the designer will  not
  4172. accept an improper expression.  Input fields are denoted  by
  4173. question marks, ?.
  4174.  
  4175. 6.3.0.3  Toggle
  4176.  
  4177. <Ctrl-T> is used to define a toggle field.  These fields can
  4178. be between  seventy  seven  characters  and  six  characters
  4179. (inclusive) in width and are  one character in height.   The
  4180. toggle expression must be a proper LValue.
  4181.  
  4182. You can have up to one hundred choices occupying up to  four
  4183. thousand characters  of  storage  in  an  individual  toggle
  4184. choice field.  When the  field has been defined, two  dialog
  4185. boxes will appear, the upper one for the toggle list  LValue
  4186. and the lower for the list of choices. A field LValue, which
  4187. can be either string or numeric, must be entered before  the
  4188. individual choices can be.  As before, you are not permitted
  4189. to enter  an invalid  LValue.   When  a valid  one has  been
  4190. entered, the cursor  will move to  the second box,  labelled
  4191. Choices.
  4192.  
  4193. The second box will be of the same width as the toggle  list
  4194. field, so that strings which would not fit in the field  are
  4195. not allowed.  The strings are entered in the order in  which
  4196. they are to appear  in the field when  it is activated.   An
  4197. individual toggle  list  item  can be  deleted  by  pressing
  4198. <Alt-D> or  <Ctrl-Y>.    The list  entry  is  terminated  by
  4199. pressing <Enter> on an  empty list item and  it is for  this
  4200.  
  4201.  
  4202.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4203.       - Main Manual.                    Page: 74 -
  4204.  
  4205.  
  4206. reason that empty  toggle list items are  not allowed.   The
  4207. cursor can be toggled between the two windows by using <Tab>
  4208. and <Shift-Tab>.
  4209.  
  4210. When the field  has been defined,  the marked  area will  be
  4211. replaced by a series of piping symbols, |.
  4212.  
  4213. 6.3.0.4  Check
  4214.  
  4215. <Ctrl-C> is used to define  a check box field.  Since   this
  4216. field can have only one size of three characters wide by one
  4217. high,  the  LValue  dialog   box  will  appear   immediately
  4218. prompting for  an  LValue  which may  be  either  string  or
  4219. numeric in type.
  4220.  
  4221. When the  LValue has  been entered,  the marked  are on  the
  4222. screen will  be  displayed  as  a  set  of  square  brackets
  4223. separated by a tick, [√].
  4224.  
  4225. 6.3.0.5  Radio
  4226.  
  4227. <Ctrl-R> is used  to define an  radio button  field.   Radio
  4228. button fields have fixed widths of three characters but  may
  4229. be as  high as  twenty-five characters,  the height  of  the
  4230. screen.
  4231.  
  4232. The radio button LValue must be a numeric expression and not
  4233. a string expression.  When  the field has been defined,  the
  4234. marked area will be replaced by a vertical block of sets  of
  4235. parentheses separated by the center dot character.
  4236.  
  4237. 6.3.0.6  Menu
  4238.  
  4239. <Ctrl-M> is used to define a menu field and can only be used
  4240. in menu screens.  Menu fields can be  of arbitrary size  and
  4241. may be nested  within one  another, unlike  all other  field
  4242. types.
  4243.  
  4244. Since, in menu screens, the menu expression is entered  when
  4245. the screen itself is entered  and is therefore constant  for
  4246. all  fields,  there  is   no  menu  expression  dialog   box
  4247. associated with menu fields.   So, when the menu area  block
  4248. mark has been terminated  by pressing <Enter>, the  vertical
  4249. edges of the  block will be marked  with piping symbols,  |,
  4250. and  control  will  return  to  the  main  screen   designer
  4251. directly.
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4257.       - Main Manual.                    Page: 75 -
  4258.  
  4259.  
  4260. 6.4  Block Operations
  4261.  
  4262.  
  4263. Blocks are  rectangular areas  of the  screen which  can  be
  4264. defined and then  used for various operations.   A block  is
  4265. marked by pressing <Alt-M> and then moving the cursor in the
  4266. same manner as that used during field definition. For  those
  4267. more familiar with  Sidekick and  the Borland-type  editors,
  4268. the keys <F7> and  <F8> may be used  to start and end  block
  4269. definition.  When a block has been defined, the block  menu,
  4270. which contains nine items, will appear in the top left  hand
  4271. corner of the screen (unless it has been moved).
  4272.  
  4273. There are nine separate operations selectable from the block
  4274. menu which may  be carried out on  marked blocks, and  these
  4275. are covered  in the  next nine  sections. Note  that if  the
  4276. block contains a portion of a field, then certain operations
  4277. are not  allowed  since  they would  have  no  meaning  when
  4278. applied in  those  circumstances  (for example,  moving  and
  4279. copying portions of a field).  If these are attempted,  then
  4280. the screen designer will display an error to the effect that
  4281. the area crosses fields.
  4282.  
  4283. Once a  block  has been  defined  and some  block  operation
  4284. carried out  upon  it,  it  may  be  re-marked  for  further
  4285. operations by pressing <Alt-R>.   Typically, this is  useful
  4286. when a box has been drawn which then needs to be painted.
  4287.  
  4288. 6.4.1  Block Painting
  4289.  
  4290. This option is  used for  setting the  foreground (ink)  and
  4291. background (paper) colors of the  defined block.  When  this
  4292. option is selected, the following paint box appears:
  4293.  
  4294. [Figure missing in disk manual]
  4295.  
  4296. The color of  the foreground is altered  using the <Up>  and
  4297. <Down> keys and is tracked in the left pane of the paint box
  4298. window by a  gray square.  The  background color tracked  in
  4299. the right hand  pane with two center  dot characters and  is
  4300. changed with the <PgUp> and <PgDn> keys.
  4301.  
  4302. The row of  `x' characters at  the bottom  of the paint  box
  4303. display the combined foreground  and background colors.   On
  4304. the EGA, VGA and most  CGA systems, the screen designer  can
  4305. make use of the flash-intensity bit.  This allows the use of
  4306. sixteen background colors instead  of eight, at the  expense
  4307. of flashing. This bit can be toggled on and off by  pressing
  4308.  
  4309.  
  4310.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4311.       - Main Manual.                    Page: 76 -
  4312.  
  4313.  
  4314. <Alt-T>.   If the  system which  the  editor is  running  on
  4315. supports this feature,  then the lower  eight colors in  the
  4316. right hand  pane will  be `brightened'.  These can  then  be
  4317. selected in the same  manner as ordinary background  colors.
  4318. Note, however, that some early  CGA adapters do not  support
  4319. this, with the result that  what should have been  displayed
  4320. in intense background will in fact be displayed as flashing.
  4321. The <Alt-T> keystroke can be used anywhere within the screen
  4322. designer and is not limited to the paint box.
  4323.  
  4324. If the block area being painted covers a field or part of  a
  4325. field, then the attributes of  the field will be updated  to
  4326. the new colors. As with  all windows in RExL, the paint  box
  4327. can be  moved  by  pressing the  <Scroll-Lock>  key,  if  it
  4328. obscuring something.
  4329.  
  4330. When the desired  combination of  foreground and  background
  4331. colors has been  reached, <Enter> will  terminate the  paint
  4332. and make the colors permanent.
  4333.  
  4334. 6.4.2  Align
  4335.  
  4336. When the align option is  selected, the marked area will  be
  4337. moved from its old location and placed at the horizontal and
  4338. vertical center of  the screen from  where it  can be  moved
  4339. using the normal arrow keys. Pressing <Enter> will make  the
  4340. alteration permanent.
  4341.  
  4342. In all cases  where blocks are  moved from  one location  to
  4343. another in the screen designer, the attributes of the screen
  4344. underneath the  original block  are left  untouched and  are
  4345. copied, along  with  the  character information  inside  the
  4346. block, to the new location for the block.
  4347.  
  4348. It is not possible to align blocks which contain portions of
  4349. a field.
  4350.  
  4351. 6.4.3  Box
  4352.  
  4353. The box option is used to draw boxes around the marked  area
  4354. on screen.  On selection, the following box menu appears:
  4355.  
  4356. [Figure not included in disk manual]
  4357.  
  4358. The first option in the  menu selects whether the box is  to
  4359. overwrite the  contents of  the box  (but leave  the  fields
  4360. inside intact) or whether the box is to overlaid around  the
  4361. edge of the area leaving the interior untouched. The  option
  4362.  
  4363.  
  4364.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4365.       - Main Manual.                    Page: 77 -
  4366.  
  4367.  
  4368. can be toggled by  pressing <Enter> on it.   If the  overlay
  4369. option is selected, then, if possible, the box will link  up
  4370. with any boxes which impinge upon the marked area.
  4371.  
  4372. To draw a box of a particular type, hilite a suitable border
  4373. type and  press <Enter>.   The  box  will then  be drawn  on
  4374. screen.  If the  screen is destined for  use with a  printer
  4375. (such as a  print screen), then,  unless all printers  which
  4376. may be used with the system support them, the first five box
  4377. edge types  should  not  be  selected,  since  few  printers
  4378. support the line draw characters in their native mode.
  4379.  
  4380. When defining  a  block for  use  with  this option,  it  is
  4381. permissible to include portions of a field within the block,
  4382. although those parts of the  box which would cut the  fields
  4383. are removed.
  4384.  
  4385. Alternatively, boxes  can be  drawn  directly by  using  the
  4386. <Alt-B> keystroke.   When  this  keystroke is  pressed,  the
  4387. screen designer again enters  its block-define mode and  the
  4388. extent of the box is drawn on the screen.  When the  desired
  4389. box has been drawn, it is selected using <Enter> and the box
  4390. type selection menu appears as before.
  4391.  
  4392. 6.4.4  Delete
  4393.  
  4394. The delete option is used to delete a marked block.  As with
  4395. the align and move options, the attributes of the originally
  4396. marked area remain unaltered after the operation.
  4397.  
  4398. Any fields which are fully within the block are also deleted
  4399. and the remaining fields are re-sequenced to take account of
  4400. the new field layout.
  4401.  
  4402. While the  block is  being marked,  the <Alt-D>,  <Del>  and
  4403. <Ctrl-Y>  keystrokes  may  be  used  to  delete  the   block
  4404. immediately, without having to go through the block menu.
  4405.  
  4406. 6.4.5  Move
  4407.  
  4408. The move option is used to move a marked block.  The  marked
  4409. area cannot  cross any  fields since  attempting to  move  a
  4410. portion of a fields has no meaning. When the option has been
  4411. selected, the cursor will disappear and the screen  designer
  4412. enters its block move mode.
  4413.  
  4414. The block may  be moved using the  <Up>, <Down>, <Left>  and
  4415. <Right> keys. Pressing <Enter> will terminate the move.
  4416.  
  4417.  
  4418.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4419.       - Main Manual.                    Page: 78 -
  4420.  
  4421.  
  4422. If the area  where the block  is to  be placed contains  any
  4423. fields, then  the  fields  will be  deleted  and  the  field
  4424. sequence will  be  regenerated.   If  the area  crosses  any
  4425. fields, then the move will be terminated with an error.
  4426.  
  4427. When the block has  been placed successfully, the  character
  4428. information is removed  from the old  location of the  block
  4429. while the attributes are left as they are.
  4430.  
  4431. 6.4.6  Copy
  4432.  
  4433. The copy  option  is  substantially the  same  as  the  move
  4434. operation above, with  the single difference  that when  the
  4435. destination is selected, the contents of the original  block
  4436. are left  unchanged  and  new  fields  are  created  in  the
  4437. destination.
  4438.  
  4439. If there are a  large number of fields  on the screen,  then
  4440. care should be  taken that the  limit of  128 fields is  not
  4441. reached while copying  blocks.  If  it is  reached, then  an
  4442. error  to  this  effect  will  be  displayed  and  the  copy
  4443. terminated with the fields remaining to be copied being left
  4444. uncopied.
  4445.  
  4446. 6.4.7  Fill
  4447.  
  4448. The fill option in the block menu is used to fill a  defined
  4449. area with  a  particular  character.   When  the  option  is
  4450. selected, the character  fill selection box  appears on  the
  4451. screen, again, in  the top left  hand corner  of the  screen
  4452. unless it has been specifically moved.
  4453.  
  4454. [Figure not included in disk manual]
  4455.  
  4456. The character  to fill  the block  is  hilited in  the  fill
  4457. selection box in yellow foreground on a magenta  background.
  4458. The normal arrow  keys are used  to move  the selection  bar
  4459. around the list  while <PgUp> and  <PgDn> are  used to  move
  4460. from one group  of 64 characters  to the  previous and  next
  4461. pages respectively.
  4462.  
  4463. <Enter> is used to select the character to fill the  defined
  4464. block with.   If the block contains  any fields, then  these
  4465. will be redrawn  when the fill operation  is finished.   The
  4466. foreground and  background  colors  are  left  unchanged  by
  4467. filling the block.
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4473.       - Main Manual.                    Page: 79 -
  4474.  
  4475.  
  4476. 6.4.8  Save
  4477.  
  4478. This option is  used to  save a  block to  the screen  file.
  4479. This feature is  mainly used for  creating pop-up menu  type
  4480. displays.
  4481.  
  4482. When this  option is  selected, a  dialog box  will  appear,
  4483. prompting for a name under  which to store the block in  the
  4484. screen file.   When  a name  has  been entered,  the  screen
  4485. designer checks to  see if that name  already exists in  the
  4486. screen file.  If the name is unique, then the block is saved
  4487. immediately, otherwise, a  yes/no menu  will appear,  asking
  4488. whether  the  previous  version  of  the  screen  should  be
  4489. overwritten with the  new one.   Selecting the `yes'  option
  4490. from this menu will cause the marked block to be written  to
  4491. the screen file in place of the old one.
  4492.  
  4493. Once the screen has been saved, it can be read and  modified
  4494. like any other full sized screen.
  4495.  
  4496. Detailed information on the use  of small screen blocks  can
  4497. be found in  the section on sub-screens  further on in  this
  4498. chapter.
  4499.  
  4500. 6.4.9  Under shadow
  4501.  
  4502. The final  option in  the block  menu  is used  for  drawing
  4503. `shadows' which  appear `underneath'  marked blocks  on  the
  4504. screen.  This option is most commonly used for hiliting some
  4505. important information in a box  on the screen by making  the
  4506. box stand out against the background.
  4507.  
  4508. The undershadow effect is achieved  by painting the area  to
  4509. the right of  and below  the marked  block in  a light  gray
  4510. foreground color  on a  black background.   The  undershadow
  4511. effect works  best  when  applied on  a  bright  background.
  4512. Overuse of this effect should be avoided since it loses  its
  4513. emphasis easily.
  4514.  
  4515.  
  4516. 6.5  Sub-screens
  4517.  
  4518.  
  4519. Sub-screens are created  using the save  block procedure  as
  4520. described in the previous section.  They are mainly used for
  4521. creating pop-up menus and other types of pop-up queries.
  4522.  
  4523.  
  4524.  
  4525.  
  4526.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4527.       - Main Manual.                    Page: 80 -
  4528.  
  4529.  
  4530. The easiest  method  to create  a  pop-up sub-screen  is  as
  4531. follows: Enter the screen designer  at the screen where  the
  4532. pop-up will appear and create the pop-up, mark the area  and
  4533. then save it as a block.  Exit from the screen designer, but
  4534. do not save the parent screen permanently when requested to.
  4535. Return to the location in the listing where this pop-up will
  4536. be used and then call it as a normal screen.
  4537.  
  4538. When the runtime module runs  the saved block of screen,  it
  4539. will only load that portion, leaving the rest of the  screen
  4540. as it was  before the screen was  called, thus creating  the
  4541. effect of a pop-up screen.
  4542.  
  4543. The screen designer treats sub-screens in almost exactly the
  4544. same  manner  as   normal  full-sized   screens,  the   only
  4545. differences being as  follows.  Firstly,  upon entering  the
  4546. screen designer with  a sub-screen, the  sub-screen will  be
  4547. loaded at  the same  co-ordinates on  the screen  as it  was
  4548. saved from, while  the rest of  the screen  will be  painted
  4549. with the normal background half-tone character.
  4550.  
  4551. Secondly, when exiting from the screen designer, instead  of
  4552. the normal `Do you  want to save the  screen ?' prompt,  the
  4553. prompt `Screen  was  originally  smaller.   Save  as:'  will
  4554. appear.  This menu has  three options in it: Original  area,
  4555. Full screen, and  Return to editor.   The first option  will
  4556. save the original screen block to disk, the second saves the
  4557. entire screen to disk in  place of the original  sub-screen,
  4558. while the final  option quits the  screen designer  entirely
  4559. and return control to the editor without saving the screen.
  4560.  
  4561. A minor  point to  note is  that  attempting to  print  sub-
  4562. screens will  not produce  the expected  results, since  the
  4563. rest of the  screen currently  on display  will be  included
  4564. with the output.
  4565.  
  4566.  
  4567. 6.6  Field control menu
  4568.  
  4569.  
  4570. <Ctrl-F> has two uses in  the screen designer, which one  is
  4571. used depends on whether the  cursor is over a field or  not.
  4572. When the cursor is placed on a field, <Ctrl-F> will bring up
  4573. the field  modification  menu,  described in  this  section.
  4574. When the cursor is not over a field, then <Ctrl-F> will  pop
  4575. up the field  type definition  menu, described  in the  next
  4576. section, listing the six field  types from which one can  be
  4577. chosen.
  4578.  
  4579.  
  4580.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4581.       - Main Manual.                    Page: 81 -
  4582.  
  4583.  
  4584. The field control menu, popped up by a keystroke of <Ctrl-F>
  4585. while  the  cursor  is   hiliting  a  field,  controls   the
  4586. properties attached to that field.   The field control  menu
  4587. is slightly different for each field type on account of  the
  4588. differing requirements for each.   In total, there are  nine
  4589. properties  which  may  be  attached  to  each  of  the  six
  4590. different field types as indicated as follows:
  4591.  
  4592.              Table 6.3: Valid Field Attributes
  4593.  
  4594.                Input     Output    Toggle    Check     Radio     Menu
  4595. Active color   Yes       Yes       Yes       Yes       Yes       Yes
  4596. Inactive color Yes                 Yes       Yes       Yes       Yes
  4597. Delete         Yes       Yes       Yes       Yes       Yes       Yes
  4598. Expression     Yes       Yes       Yes       Yes       Yes
  4599. Recalc         Yes       Yes       Yes       Yes       Yes
  4600. Justify        Yes       Yes       Yes
  4601. Width          Yes       Yes       Yes                           Yes
  4602. Necessary      Yes
  4603. Precision      Yes       Yes
  4604. Validate       Yes
  4605.  
  4606. The field control menu for a particular field type  consists
  4607. of the  options ticked  in the  table above  underneath  the
  4608. fields.  The next nine subsections give the meanings of  the
  4609. items in the field control menu:
  4610.  
  4611. 6.6.0.1  Active color
  4612.  
  4613. The active color of a  field is the attribute which is  used
  4614. to color the contents of a field when that field is  active.
  4615. All fields, except output fields, have active colors.
  4616.  
  4617. When this option is chosen from the menu, the standard paint
  4618. box appears and  the field  attribute can  be selected  from
  4619. this.
  4620.  
  4621. 6.6.0.2  Inactive color
  4622.  
  4623. The inactive color of a field is the attribute which is used
  4624. to color  the  contents  of  a  field  when  that  field  is
  4625. inactive.  All fields, including output fields, have  active
  4626. colors.
  4627.  
  4628. When this option is chosen from the menu, the standard paint
  4629. box appears and  the field  attribute can  be selected  from
  4630. this.
  4631.  
  4632.  
  4633.  
  4634.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4635.       - Main Manual.                    Page: 82 -
  4636.  
  4637.  
  4638. 6.6.0.3  Delete
  4639.  
  4640. This option will  delete the hilited  field from the  screen
  4641. and perform a screen  field resequencing.  Pressing  <Alt-D>
  4642. while hiliting a field in  the screen designer has the  same
  4643. effect as choosing this option.
  4644.  
  4645. 6.6.0.4  Expression
  4646.  
  4647. The expression attached to a  field can be edited when  this
  4648. option is selected.   The  edited field  expression will  be
  4649. checked for  correct syntax  before it  can be  accepted  by
  4650. RExL.  When  the cursor is  hiliting a  field, <F10> can  be
  4651. used as a shortcut keystroke for this function, while  <Alt-
  4652. F> will simply display the field expression on the bottom of
  4653. the screen.
  4654.  
  4655. For toggle fields, the choices may also be altered.
  4656.  
  4657. 6.6.0.5  Recalc
  4658.  
  4659. Under  normal   circumstances,  the   runtime  module   will
  4660. automatically recalculate all  fields in  a screen  whenever
  4661. the contents of one field are modified.  If there are  large
  4662. number of fields in the screen, then this may slow down  the
  4663. operation of the  screen designer. Toggling  this option  on
  4664. and off will enable and disable the automatic  recalculation
  4665. of the hilited field.
  4666.  
  4667. 6.6.0.6  Justify
  4668.  
  4669. Normally, the contents  of fields are  left justified,  that
  4670. is, placed flush  against the left  hand end  of the  field.
  4671. This option can be used as a toggle to toggle the  placement
  4672. between the left and right ends of fields.
  4673.  
  4674. Note that during numeric input  in input fields, the  number
  4675. is always justified  right.  When input  is finished in  the
  4676. field, the result  will be  justified as  specified by  this
  4677. flag.
  4678.  
  4679. 6.6.0.7  Width
  4680.  
  4681. The width of a field can be altered using this option.  When
  4682. it is selected,  a block will  appear of  the same size  and
  4683. shape of the field.   This can then  be changed in the  same
  4684. manner as ordinary block definition.
  4685.  
  4686.  
  4687.  
  4688.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4689.       - Main Manual.                    Page: 83 -
  4690.  
  4691.  
  4692. When a suitable  size has been chosen  and <Enter> has  been
  4693. pressed, the screen designer will  check to ensure that  the
  4694. new field does not cross any earlier fields.
  4695.  
  4696. 6.6.0.8  Necessary
  4697.  
  4698. String and  numeric  input fields  my  be defined  as  being
  4699. `necessary' for the  proper completion  of the  screen.   If
  4700. this flag  has been  set, then  a  zero value,  for  numeric
  4701. fields, and an empty string  value, for string fields,  will
  4702. not be  allowed as  valid input.   The  runtime module  will
  4703. hilite the unfinished  field in red,  fill it  with X's  and
  4704. post an error message on the bottom of the screen and return
  4705. the end-user to the field.
  4706.  
  4707. 6.6.0.9  Precision
  4708.  
  4709. Numeric input and output fields can have an optional decimal
  4710. precision supplied.   This  will be  the number  of  decimal
  4711. places to  be displayed  or input  when the  runtime  module
  4712. processes the field.
  4713.  
  4714. 6.6.0.10  Validation
  4715.  
  4716. Numeric and string input fields may be validated as date and
  4717. time strings by toggling the validation type between `None',
  4718. `Date' and `Time'.   If the  user enters  a string, then  it
  4719. will be checked for validity  by the runtime module. If  the
  4720. string is  found  to be  invalid,  then execution  will  not
  4721. proceed until a valid string is entered.  The format checked
  4722. will be the format current  on your machine, or that set  up
  4723. by a call to the DTformat() command.
  4724.  
  4725. Note that the null  date string, "00/00/0000" is  considered
  4726. to be a valid date.   If you want  to filter out this  date,
  4727. then you should set the `necessary' flag.
  4728.  
  4729.  
  4730. 6.7  Miscellaneous Functions
  4731.  
  4732.  
  4733. 6.7.0.1  Changing Field Types
  4734.  
  4735. The <Ctrl-> key combinations noted above for defining fields
  4736. also have another use in  changing a field from one type  to
  4737. another.  For example, pressing <Ctrl-O> when the cursor  is
  4738. hiliting an input field will  change that input field to  an
  4739. output field.  The exact procedure is as follows:  When  the
  4740.  
  4741.  
  4742.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4743.       - Main Manual.                    Page: 84 -
  4744.  
  4745.  
  4746. <Ctrl-> key  combination  is  pressed, the  screen  designer
  4747. looks to see if the cursor is placed over a field, if it is,
  4748. then the  field type  is changed  to that  specified by  the
  4749. keystroke and the  field definition routine  is called.  The
  4750. width of the  field can  then be  changed. Pressing  <Enter>
  4751. will terminate the width definition  and bring up the  field
  4752. expression dialog box (or both of them if the new field is a
  4753. toggle field).
  4754.  
  4755. The field changing facility is  most useful when changing  a
  4756. screenful of input fields to output fields.
  4757.  
  4758. 6.7.0.2  Field Utility Keys
  4759.  
  4760. <F10> is used to edit a field expression, when the cursor is
  4761. on a field. This function is placed on a special key of  its
  4762. own, since it is used regularly.  If the cursor is not  over
  4763. a field, then this key has no effect. The <Alt-F>  keystroke
  4764. can be used  to display the  expression associated with  the
  4765. cursor field.  When this  keystroke is used, the  expression
  4766. is only displayed and cannot be modified.
  4767.  
  4768. <Alt-D> is used to delete  the field underneath the  cursor.
  4769. As with <F10>, this keystroke  has no effect if there is  no
  4770. field underneath the cursor.
  4771.  
  4772. The <Ctrl-S> keystroke is used to display the screen  status
  4773. on the  bottom  line of  the  screen.   The  status  display
  4774. contains four items of  information: Displayed from left  to
  4775. right, these are the current cursor position in (x,y) format
  4776. with (0,0) at the top left  hand corner.  The next two  sets
  4777. of coordinates give the size of the currently defined  block
  4778. (if no  block has  been defined,  then  the full  screen  is
  4779. used).   The `Fields'  display gives  the number  of  fields
  4780. defined in the  screen (the  second digit)  while the  first
  4781. digit gives the sequence number of the field underneath  the
  4782. cursor, or 0 if there  is no field there.   The type of  the
  4783. hilited field is displayed  beside the sequence number.  The
  4784. final display gives  the amount of free  memory left to  the
  4785. screen designer. For proper operation, this figure should be
  4786. above 10k.
  4787.  
  4788. 6.7.0.3  Line Drawing
  4789.  
  4790. The line drawing feature of  the screen designer is used  to
  4791. draw lines  on the  screen using  the IBM  ASCII  characters
  4792. between 179 and 218 inclusive.  When <Alt-L> is pressed, the
  4793. designer enters line draw mode and the cursor is backed by a
  4794.  
  4795.  
  4796.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4797.       - Main Manual.                    Page: 85 -
  4798.  
  4799.  
  4800. `reverse' attribute  block to  emphasise the  fact that  the
  4801. screen designer has changed mode.
  4802.  
  4803. When <Alt-L> is pressed, the  line draw menu appears in  the
  4804. top left hand corner of the screen:
  4805.  
  4806. [Figure not included in disk manual]
  4807.  
  4808. The first option  in the  menu toggles  between overlay  and
  4809. overwrite modes (explained  below) while  the other  options
  4810. specify the type of line to be drawn.
  4811.  
  4812. The normal arrow keys and  <Space>, to move right, are  used
  4813. to move the head of the line about the screen. When  drawing
  4814. a line, the character underneath  the cursor is not  updated
  4815. until the cursor is  moved.  This needs  to be done  because
  4816. the exact character required  depends on the next  direction
  4817. of travel of the cursor.
  4818.  
  4819. The line draw mode can operate in one of three modes:
  4820.  
  4821.     o  Overwrite mode, where the  line being drawn does  not
  4822.        link up with any previous line on the screen.
  4823.  
  4824.     o  Overlay mode, where the line does link up with  lines
  4825.        already existing on  the screen.   Note that not  all
  4826.        combinations of line draw characters can be displayed
  4827.        using the ASCII  character set, in  these cases,  the
  4828.        current line  draw  type  will take  precedence  over
  4829.        older lines.
  4830.  
  4831.     o  Delete  mode,  where  the  character  underneath  the
  4832.        cursor is  deleted. This  option is  most useful  for
  4833.        deleting old lines from the screen.
  4834.  
  4835. The  <Ins>  key  is  used  to  toggle  between  overlay  and
  4836. overwrite modes,  with  the  cursor being  an  underline  in
  4837. overlay mode and a half-box in overwrite mode. The <Del> key
  4838. is used to toggle delete mode  on and off.  In delete  mode,
  4839. the cursor is placed in the upper half of the character box.
  4840.  
  4841. While the line is being  drawn, the shape of the line  being
  4842. draw may be changed using the <Alt> key in combination  with
  4843. the digits 1 to 4.
  4844.  
  4845. The following table summarizes the keystrokes valid in  line
  4846. draw mode:
  4847.  
  4848.  
  4849.  
  4850.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4851.       - Main Manual.                    Page: 86 -
  4852.  
  4853.  
  4854.              Table 6.4: Keys in Line Draw Mode
  4855.  
  4856. <Up>                Move up
  4857. <Down>              Move down
  4858. <Left>              Move left
  4859. <Right>, <Space>    Move right
  4860. <Enter>, <Esc>      Terminate line draw mode
  4861. <Ins>               Toggle overlay and overwrite mode
  4862. <Del>               Toggle delete mode
  4863. <Alt-1>             Set horizontal line emphasis to one line
  4864. <Alt-2>             Set horizontal line emphasis to two lines
  4865. <Alt-3>             Set vertical line emphasis to one line
  4866. <Alt-4>             Set vertical line emphasis to two lines
  4867.  
  4868. 6.7.0.4  Other Editing Keys
  4869.  
  4870. <Ctrl-Y>, used to delete lines, has two functions.  When  it
  4871. is first pressed,  it deletes all  characters and fields  to
  4872. the left and right of  the cursor up to, but not  including,
  4873. the  nearest  box  characters.    If  it  is  pressed  again
  4874. immediately, then  the entire  screen line  will be  deleted
  4875. from  the  left  edge  to  the  right  edge  and  the  lines
  4876. underneath will be  pulled up by one  character.  Note  that
  4877. <Ctrl-Y>  must  be  pressed  twice  in  succession  with  no
  4878. intervening keystrokes for the entire line to be deleted.
  4879.  
  4880. <Del> is used to delete the character underneath the cursor.
  4881. All  characters  up  to  but  not  including  the  next  box
  4882. character to  the  right of  the  cursor  will be  move  one
  4883. character to  the left.   If  <Del>  is pressed  over a  box
  4884. character then the box character itself will be deleted.
  4885.  
  4886. <Backspace> deletes the character to the left of the  cursor
  4887. and moves the cursor one  character to the left, moving  all
  4888. characters to its right, up to but not including the nearest
  4889. box character, one character left.
  4890.  
  4891. 6.7.0.5  Lists in the Screen Designer
  4892.  
  4893. The  editor's  three  most  commonly  used  lists  are  also
  4894. available in the  screen designer.   These are the  variable
  4895. list on <Alt-V> and <Shift-F6>, the rule list on <Alt-Z> and
  4896. <Shift-F2> and the  screen list on  <Alt-S> and  <Shift-F3>.
  4897. The hotkey reference lists which  are available in the  main
  4898. editor are not available when  these lists are requested  in
  4899. the screen designer.
  4900.  
  4901.  
  4902.  
  4903.  
  4904.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4905.       - Main Manual.                    Page: 87 -
  4906.  
  4907.  
  4908. 6.7.0.6  Miscellaneous Keys
  4909.  
  4910. The <F2> keystroke will save the screen to the screen  file.
  4911. If the screen  was originally a  sub-screen and  not a  full
  4912. sized  screen,  then  the  prompt  `Screen  was   originally
  4913. smaller.  Save  as:' will appear with  a three option  menu,
  4914. instead of the  normal `Do you  want to  save the screen  ?'
  4915. prompt.  This  feature is explained in  the section on  sub-
  4916. screens.
  4917.  
  4918. <Alt-X> and <Esc> are used to exit from the screen  designer
  4919. and to return to the main editor.  As before, if the  screen
  4920. has been altered, then you'll be prompted to save it  before
  4921. continuing.
  4922.  
  4923. All keystrokes greater or equal  to the space character  and
  4924. less than  or equal  to  an ASCII  code  of 255  are  placed
  4925. directly onto the  screen.  If insert  mode is active,  then
  4926. all characters to the right of the cursor will be moved  one
  4927. character to the right,  with the rightmost character  being
  4928. lost. If  insert  mode is  not  active, then  the  character
  4929. underneath the cursor will be deleted.
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.  
  4943.  
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  4959.       - Main Manual.                    Page: 88 -
  4960.  
  4961.  
  4962.  
  4963.  
  4964.  
  4965.  
  4966.  
  4967.  
  4968.  
  4969.  
  4970.  
  4971.  
  4972.  
  4973.  
  4974.  
  4975.  
  4976.  
  4977.  
  4978.  
  4979.  
  4980.  
  4981.  
  4982.  
  4983.  
  4984.  
  4985.  
  4986.  
  4987.  
  4988.  
  4989.  
  4990.  
  4991.  
  4992.  
  4993.  
  4994.  
  4995.  
  4996.  
  4997.  
  4998.  
  4999.  
  5000.  
  5001.  
  5002.  
  5003.  
  5004.  
  5005.  
  5006.  
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5013.       - Main Manual.                    Page: 89 -
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.                          Chapter 7
  5023.  
  5024.                     The Runtime-Debugger
  5025.  
  5026.  
  5027. 7.1  Introduction
  5028.  
  5029.  
  5030. This chapter covers  the functions and  capabilities of  the
  5031. debugger module in depth (when  we refer to the debugger  in
  5032. this chapter,  we  mean  the runtime-debugger  module  as  a
  5033. whole).  The interface used in the debugger is much the same
  5034. as that in  the editor, so you  shouldn't have much  trouble
  5035. using it.  The debugger-specific keystrokes are largely  the
  5036. same as those used by  the Borland integrated debuggers,  so
  5037. if you  have used  those, then  a  quick read  through  this
  5038. chapter should be sufficient.
  5039.  
  5040.  
  5041. 7.2  Debugger Basics
  5042.  
  5043.  
  5044. The debugger  is  started  by typing  `rexlrd'  at  the  DOS
  5045. prompt.  Contrary  to the  requirements of  the editor,  you
  5046. must supply a file name on the command line. If you omit the
  5047. file name,  then  a few  lines  of  command line  help  will
  5048. appear. In the current release, there are three command line
  5049. parameters which can be supplied to the debugger, these will
  5050. be covered at the  end of the chapter.   Unlike the  editor,
  5051. the debugger does not read or generate a configuration file.
  5052.  
  5053. The debugger can run in either  of two modes:  The first  is
  5054. run mode,  in  which  the application  is  executed  without
  5055. stopping between rule  calls, statements and  screens.   The
  5056. second mode is debug mode, in which the full screen debugger
  5057. controls the execution of the system.  Debug mode is used if
  5058. you select the option Debug application from the Run menu in
  5059. the editor, or if you press <Alt-D> while the application is
  5060. executing in run mode.
  5061.  
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5067.       - Main Manual.                    Page: 90 -
  5068.  
  5069.  
  5070. There are a  few terms which you  need to understand  before
  5071. you continue  with the  rest of  this  chapter.   These  are
  5072. explained here:
  5073.  
  5074.     o  Step and Trace: An  application is stepped or  traced
  5075.        when the runtime portion of the module gains  control
  5076.        of the application and executes some portion of it.
  5077.  
  5078.     o  Watch: A watch is an expression, visible in the watch
  5079.        window  at  the  bottom  of  the  screen,  which   is
  5080.        evaluated every  time the  debugger module  is  given
  5081.        control of application execution.
  5082.  
  5083. When you enter  debug mode, you will  be presented with  the
  5084. main debugger screen (note that you can't have all the menus
  5085. pulled down at once, as they are here!  The dots and  arrows
  5086. indicate where the menu is normally displayed):
  5087.  
  5088. [Figure not included in disk manual]
  5089.  
  5090. The bar at the top of  the screen has four pull down  menus.
  5091. In the same manner as the editor, these can be activated  by
  5092. pressing the left and right  arrow keys to move from one  to
  5093. the next, and pressing the  enter key to select the  hilited
  5094. menu.  Press  <Esc> to return  to the  code window from  the
  5095. menus.
  5096.  
  5097. To the right  of the four  menu titles, is  the name of  the
  5098. RExL file which is currently being debugged.  The third last
  5099. line on the  screen is the debugger  status line, which  has
  5100. the same function and features as the editor status line  in
  5101. the editor.
  5102.  
  5103. Underneath the  debugger status  line  is the  watch  window
  5104. (blank above)  where watches  are kept.   On  start-up,  the
  5105. watch window is one character  high, but this will grow  and
  5106. contract as watches are added and removed.  The bottom  line
  5107. of the display lists some of the short-cut keystrokes  which
  5108. can be used in the debugger.
  5109.  
  5110. The Code Window  is above the status  line and displays  the
  5111. rule currently being executed.  Cursor movement in the  code
  5112. window uses the same keys as in the editor.
  5113.  
  5114. The four menus on the main horizontal menu bar have contents
  5115. as follows:
  5116.  
  5117.  
  5118.  
  5119.  
  5120.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5121.       - Main Manual.                    Page: 91 -
  5122.  
  5123.  
  5124. 7.2.1  File menu
  5125.  
  5126.                     ┌────────────────────────┐
  5127.                     │ Return to editor       │
  5128.                     │ OS shell               │
  5129.                     │ Quit                   │
  5130.                     └────────────────────────┘
  5131.  
  5132. The file menu has the following seven options:
  5133.  
  5134.     o  Return to editor: This option will return control  to
  5135.        the editor, loading  the application currently  being
  5136.        debugged.
  5137.  
  5138.     o  OS Shell: If you  want to run a  DOS command, but  do
  5139.        not wish  to  exit  from  the  debugger  permanently,
  5140.        choose this option to go into a DOS shell.  While you
  5141.        are  in  the  shell,   you  should  not,  under   any
  5142.        circumstances,  run  any   T&SR  programs  (such   as
  5143.        Sidekick, ScrGrab and so forth), since these programs
  5144.        change critical area of  the computer's memory  which
  5145.        may cause it to  crash unpredictably when you  return
  5146.        to RExL.   When you are finished  in the shell,  type
  5147.        `exit' at the DOS prompt to return to RExL.
  5148.  
  5149.     o  Quit: This  choice will  quit from  the debugger  and
  5150.        return you directly to  DOS, irrespective of  whether
  5151.        you started the  debugger from within  the editor  or
  5152.        not.
  5153.  
  5154. 7.2.2  Debug menu
  5155.  
  5156.                     ┌───────────────────┐
  5157.                     │ Watch             │
  5158.                     │ Evaluate          │
  5159.                     │ Run               │
  5160.                     │ Step              │
  5161.                     │ Trace             │
  5162.                     │ Halt here         │
  5163.                     │ Breakpoint        │
  5164.                     │ Animate           │
  5165.                     └───────────────────┘
  5166.  
  5167. All of the options in  this menu are also available  through
  5168. hot-key  short-cuts.  When  you  become  familiar  with  the
  5169. debugger's keystroke map,  you'll probably not  need to  use
  5170. this menu.   There are eight options in this menu:
  5171.  
  5172.  
  5173.  
  5174.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5175.       - Main Manual.                    Page: 92 -
  5176.  
  5177.  
  5178.     o  Watch: This option, which  is also available via  the
  5179.        hot-key
  5180.  
  5181.     o  <Ctrl-F7> or  <Ctrl-W>,  controls  the entry  of  new
  5182.        expression watches  into  the  watch  window  at  the
  5183.        bottom of  the screen.   The  procedure for  entering
  5184.        watches is covered in detail in the next section.
  5185.  
  5186.     o  Evaluate:  Selecting  this  option,  also   available
  5187.        through <Ctrl-F4> or  <Ctrl-E>, causes an  expression
  5188.        evaluation box to  appear.  This  is also covered  in
  5189.        the next section.
  5190.  
  5191.     o  Run: This choice will return the debugger to run mode
  5192.        and will not return  control to the debugger,  unless
  5193.        it meets a breakpoint or you press <Alt-D>.  Pressing
  5194.        <F9> is equivalent to selecting this choice.
  5195.  
  5196.     o  Step: This menu choice is identical to pressing <F8>.
  5197.  
  5198.     o  Trace: This choice is identical to pressing <F7>.
  5199.  
  5200.     o  Halt here: This  option, also  available by  pressing
  5201.        <F4>, will  set a  temporary breakpoint  at the  line
  5202.        currently hilited in the code window.  When execution
  5203.        reaches the line,  the debugger  will regain  control
  5204.        and the breakpoint will be cleared.
  5205.  
  5206.     o  Breakpoint: This  option  (also on  <Ctrl-F8>)sets  a
  5207.        breakpoint at the  line hilited in  the code  window.
  5208.        Whenever execution  reaches this  line, the  debugger
  5209.        will regain control.
  5210.  
  5211.     o  Animate: This choice  (also on  <Alt-F4>) will  cause
  5212.        the debugger to emit a trace instruction at  variable
  5213.        intervals, so that  the debugger  appears to  control
  5214.        itself.  Pressing any key while animating will return
  5215.        control to the user.
  5216.  
  5217. 7.2.3  Lists menu
  5218.  
  5219.                     ┌────────────────────┐
  5220.                     │ Rule list          │
  5221.                     │ Screen list        │
  5222.                     │ Unused rule list   │
  5223.                     │ Unused screen list │
  5224.                     │ Variable list      │
  5225.                     │ Function list      │
  5226.  
  5227.  
  5228.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5229.       - Main Manual.                    Page: 93 -
  5230.  
  5231.  
  5232.                     │ Call stack         │
  5233.                     └────────────────────┘
  5234.  
  5235. This menu  gives you  access to  all the  lists of  entities
  5236. which are defined the current application. Most of the lists
  5237. have special  `hot-links' to  other, more  specific,  lists.
  5238. These are mentioned  briefly at the  end of this  subsection
  5239. and covered in  more detail further on.  All of these  lists
  5240. are also available via hot-keys from within the main  editor
  5241. window.  Consult  the  section  on  editor  keys  for   more
  5242. information on this.
  5243.  
  5244. The lists run menu has the following six options:
  5245.  
  5246.     o  Rule list: This list contains the names of all of the
  5247.        rules   which   are   currently   defined   in   your
  5248.        application.
  5249.  
  5250.     o  Screen list:  This list  contains  the names  of  all
  5251.        screens defined in the currently active screen file.
  5252.  
  5253.     o  Unused rule list:  This list shows  all rules  which,
  5254.        although defined in the normal way, are not  actually
  5255.        referenced  by  the  application.  Pressing   <Alt-D>
  5256.        within this list will delete the unused rule from the
  5257.        application.
  5258.  
  5259.     o  Unused screen list: This list gives all screens which
  5260.        are not  referenced in  the current  application.  As
  5261.        with the  unused rule  list above,  press <Alt-D>  to
  5262.        delete the unused  screen from the  list and free  up
  5263.        the space it occupies within the screen file.
  5264.  
  5265.     o  Variable list: This list contains all variables.  The
  5266.        status line at the bottom of the screen displays  the
  5267.        type of the variable, whether numeric or string,  and
  5268.        whether it's an array or a simple variable.
  5269.  
  5270.     o  Function list: This list  contains all the  functions
  5271.        available in RExL.  Press <Ctrl-F1> for  help on  the
  5272.        hilited function.
  5273.  
  5274.     o  Call stack: The call stack is the list of rules which
  5275.        are currently executing.  The most recent call is  at
  5276.        the bottom of the list.   The `Main Program' rule  is
  5277.        always at the top of the list.
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5283.       - Main Manual.                    Page: 94 -
  5284.  
  5285.  
  5286. All the list windows are movable by pressing  <Scroll-Lock>,
  5287. using the  arrow  keys  to position  and  pressing  <Enter>,
  5288. <Scroll-Lock> or <Esc>  to terminate the  window move.  Note
  5289. that all lists  in RExL feature  helix searching.   You  can
  5290. also output  the contents  of any  list  to a  file (or  the
  5291. printer) by pressing <Ctrl-P>, as in DOS.
  5292.  
  5293. If you terminate any of the lists by pressing <Enter>,  then
  5294. the choice which you selected from that menu will be  placed
  5295. into the scrap buffer, ready  for pasting using the  <Shift-
  5296. Insert> keystroke.
  5297.  
  5298. 7.2.4  Options menu
  5299.  
  5300.                     ┌───────────────────────┐
  5301.                     │ Load macros           │
  5302.                     │ Save macros           │
  5303.                     │ Beep off              │
  5304.                     │ Function lower case   │
  5305.                     │ Exploding windows off │
  5306.                     │ Screen swap: smart    │
  5307.                     │ Repaint screen        │
  5308.                     └───────────────────────┘
  5309.  
  5310. The options  menu  controls  various system  parameters  and
  5311. features not directly connected to the editor per se.
  5312.  
  5313.     o  Load macros: Any macro definitions you define in  the
  5314.        editor may be saved to disk for later retrieval using
  5315.        this menu option. The  macro file format is  constant
  5316.        across the RExL product range, so that macros defined
  5317.        in the editor may be  used in the debugger or in  the
  5318.        database manager and so on.  Macros are explained  in
  5319.        more detail at the beginning of this chapter.
  5320.  
  5321.     o  Save macros: This  option allows you  to save  macros
  5322.        which can then be reloaded at some future time  using
  5323.        the load option above.
  5324.  
  5325.     o  Beep  off:    By  default,  RExL  beeps  whenever  it
  5326.        encounters an error. This  beeping can be toggled  on
  5327.        and off by selecting this option.
  5328.  
  5329.     o  Function lower  case: By  default, all  functions  in
  5330.        RExL are displayed  in their natural  case.  This  is
  5331.        that functions  which  are  members of  families  are
  5332.        displayed  with  the  first  two  or  three   letters
  5333.        capitalised, while  the miscellaneous  functions  are
  5334.  
  5335.  
  5336.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5337.       - Main Manual.                    Page: 95 -
  5338.  
  5339.  
  5340.        entirely capitalised.  This option is used to  toggle
  5341.        between upper (or partially upper) case function name
  5342.        display and lower case.
  5343.  
  5344.     o  Exploding windows  off:  In  its  normal  state,  all
  5345.        windows in RExL open instantaneously upon activation.
  5346.        This option can  be used  to make  windows `grow'  to
  5347.        full size  on the  screen.   This  is only  a  visual
  5348.        effect and has no effect upon the application.
  5349.  
  5350.     o  Screen swap on: Whenever  the debugger is stepped  or
  5351.        traced, the debugger  will swap its  own screen  with
  5352.        that of the  application running underneath  it.   If
  5353.        your application does not access the screen, then you
  5354.        can toggle  this  option  to `None'  to  disable  the
  5355.        screen swap.
  5356.  
  5357.     o  Alternatively, you can set the mode to `Smart',  when
  5358.        RExL  will check  the  line   about  to  execute   to
  5359.        determine if  the line  contains an expression  which
  5360.        could change  the  screen.    If  this  is  so,  then
  5361.        the screen will be swapped, but not otherwise.  Smart
  5362.        screen swapping is the default screen swap mode.
  5363.  
  5364.        If,  when  screen  swap  is  off,  your   application
  5365.        accesses the screen, the change will be lost when the
  5366.        debugger regains control of execution, possibly  with
  5367.        a garbled screen.
  5368.  
  5369.     o  Repaint screen: This  option is used  to restore  the
  5370.        debugger    screen     after    it     has     become
  5371.        corrupted. Corruption of the debugger screen  happens
  5372.        when screen swap  has been disabled  during a  screen
  5373.        access by the application.
  5374.  
  5375.  
  5376. 7.3  Using the Debugger
  5377.  
  5378.  
  5379. The familiar keystrokes of <Up>, <Down>, <Tab>,  <Shift-Tab>
  5380. and so on, are all supported in the debugger as they are  in
  5381. the editor. While designing the  debugger, we have tried  to
  5382. strike a balance between its functionality and size.  It  is
  5383. for  this  reason  that,  although  the  <Alt-Z>   keystroke
  5384. generates the  rules list  as in  the editor,  there are  no
  5385. hot-links to the other features, such as rule reference  and
  5386. so forth.
  5387.  
  5388.  
  5389.  
  5390.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5391.       - Main Manual.                    Page: 96 -
  5392.  
  5393.  
  5394. The following is a typical debugger screen:
  5395.  
  5396. [Figure not included in disk manual]
  5397.  
  5398. As with the editor, the status line (this time on the  third
  5399. last line) shows the amount of memory remaining free for the
  5400. runtime module to use.   To the right  of this is the  level
  5401. display, showing the depth which the debugger has reached.
  5402.  
  5403. There are two differences to the layout of rules in the code
  5404. window.  The  first difference is  the current line  pointer
  5405. character, ASCII 16.  This points to the line which will  be
  5406. executed as soon  as the runtime  module regains control  of
  5407. execution. The line pointer character is placed between  the
  5408. line's modifier and  the actual text  of the  line.  In  the
  5409. example above, the line pointer points to the final line  in
  5410. the code  window.    In practice,  this  character  will  be
  5411. colored yellow to make it visible above the background.
  5412.  
  5413. The second difference  is the character on  the far left  of
  5414. the line.   This  character  indicates the  current  logical
  5415. status of  the line,  X, for  False, √  for True  and ?  for
  5416. unknown.  On  start-up, all lines  are assigned  a value  of
  5417. unknown, but as the application executes, the lines' logical
  5418. values are filled in.  When a line is about to be  executed,
  5419. its status is set to unknown.
  5420.  
  5421. Other than the differences from the editor noted above,  the
  5422. only  features  to  be   understood  in  the  debugger   are
  5423. application step,  trace and  the  function of  watches  and
  5424. breakpoints. These are covered in the next four subsections.
  5425.  
  5426. 7.3.1  Step
  5427.  
  5428. When the application is stepped, the runtime module is given
  5429. control of execution and it will run the line which was last
  5430. hilited in the debugger's code  window.  RExL uses the  <F8>
  5431. keystroke to step.
  5432.  
  5433. If the line was a  statement, then it will be evaluated  and
  5434. the value returned  will be assigned  to the line's  logical
  5435. status as indicated by the character at the far left of  the
  5436. line.
  5437.  
  5438. If the line was a rule,  then the rule in its entirety  will
  5439. be executed and control returned when the rule has  returned
  5440. True or False to the caller.
  5441.  
  5442.  
  5443.  
  5444.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5445.       - Main Manual.                    Page: 97 -
  5446.  
  5447.  
  5448. If the line was a  screen, then the screen will execute  and
  5449. return True.
  5450.  
  5451. 7.3.2  Trace
  5452.  
  5453. Trace works in the same manner as step does above, with  one
  5454. important difference:  When you  trace a rule, the  debugger
  5455. will expand the definition  and place the debugger's  hilite
  5456. bar on the first non-blank line of the rule.
  5457.  
  5458. <F7> or <Space> is used to trace a line.
  5459.  
  5460. 7.3.3  Watch
  5461.  
  5462. As explained  above,  a  watch is  an  expression  which  is
  5463. `watched' by both you and the debugger.  The expression  can
  5464. be either string or numeric in type and is displayed in  the
  5465. watch window, underneath the code window.
  5466.  
  5467. Watches are  entered  by  pressing  the  <Ctrl-F7>  key  (or
  5468. <Ctrl-W>).    A  dialog   box  appears,  prompting  for   an
  5469. expression to  watch.   The syntax  will be  checked and  if
  5470. valid, will be entered into  the watch list.  The format  of
  5471. the watch is simple:  It consists of the expression entered,
  5472. followed by a colon  and a space, followed  by the value  of
  5473. the expression you entered.
  5474.  
  5475. If the cursor  is placed  over some  alphanumeric symbol  in
  5476. your source, then that symbol will be entered in the  dialog
  5477. box.
  5478.  
  5479. You can move the hilite bar to the watch window by  pressing
  5480. <F6>, although this will not  be allowed if you do not  have
  5481. any watches in the watch  window. When in the watch  window,
  5482. you can add  new ones by pressing  <Ctrl-F7> or <Ctrl-W>  as
  5483. before.  Watches can be deleted by pressing <Del> or  <Ctrl-
  5484. Y> or <Alt-D>.
  5485.  
  5486. Watches are more powerful (and  dangerous) than they may  at
  5487. first seem:  Since you  are allowed to enter any  expression
  5488. as a  watch,  this  may  clearly  include  expressions  like
  5489. DBnext(), CLS()  (and  so  on), functions  which  alter  the
  5490. status of RExL.  Entering expressions such as these can have
  5491. various unwanted side-effects  in debugging  sessions.   The
  5492. final point to note is that only those expressions which are
  5493. visible in the watch window are actually evaluated at  every
  5494. cycle.  You  can have  at most  ten watches  visible in  the
  5495. watch window at any one time.
  5496.  
  5497.  
  5498.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5499.       - Main Manual.                    Page: 98 -
  5500.  
  5501.  
  5502. 7.3.4  Expression Evaluate
  5503.  
  5504. Expression evaluation is a `shortened' version of  watching.
  5505. It allows you  to enter an expression  and RExL will  return
  5506. the value of that expression either string or numeric.
  5507.  
  5508. Evaluation, however, has one major difference from  watching
  5509. in  that  it  allows  you  to  enter  a  new  value  for  an
  5510. expression, if that expression is a valid LValue.
  5511.  
  5512. [Figure not available in disk manual]
  5513.  
  5514. When the expression  evaluation box  initially appears,  the
  5515. cursor will be  in the  Evaluate pane.   If  the cursor  was
  5516. placed on a word within  the window, then that word will  be
  5517. pasted into the box.   The expression which  you want to  be
  5518. evaluated is then entered.
  5519.  
  5520. The expression will then be  syntax checked.  If the  syntax
  5521. is not  correct,  then  the  you will  be  returned  to  the
  5522. evaluate pane, otherwise  the expression  will be  evaluated
  5523. and the result displayed  in the Result pane.   If RExL  has
  5524. determined that the expression is a modifiable LValue,  then
  5525. the result of the expression  will also be displayed in  the
  5526. New Value pane (whose  border will change color),  otherwise
  5527. that pane will remain empty and the border color of the  new
  5528. value pane will remain unchanged.
  5529.  
  5530. If the expression is an LValue, then you can press <Tab>  to
  5531. bring the cursor to the new value pane where you can enter a
  5532. new value  for the  expression. This  new value  can be  any
  5533. valid expression which returns a result of the same type  as
  5534. the initial expression.   Again, this  expression is  syntax
  5535. checked and  evaluated and  the result  is assigned  to  the
  5536. expression in the evaluate pane.
  5537.  
  5538. 7.3.5  Animation
  5539.  
  5540. You can  `animate'  the  execution of  your  application  by
  5541. pressing <Alt-F4>. During animation, the debugger  simulates
  5542. the pressing of the trace key at a definable interval.
  5543.  
  5544. When you  press  <Alt-F4>,  a numeric  dialog  box  appears,
  5545. prompting for  an animate  delay, measured  in tenths  of  a
  5546. second.  This value can range from 0, where there will be no
  5547. delay, to 600,  where there will  be a  delay of one  minute
  5548. between successive steps.
  5549.  
  5550.  
  5551.  
  5552.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5553.       - Main Manual.                    Page: 99 -
  5554.  
  5555.  
  5556. Press any key to stop  the debugger animating the  execution
  5557. of the application.
  5558.  
  5559. 7.3.6  To Here
  5560.  
  5561. The debugger  can  execute  an application  to  the  current
  5562. cursor line, `to here', when  you press <F4>.  This  feature
  5563. is sometimes known  as temporary  break-pointing, since  the
  5564. effect is to  place a  breakpoint at  the line  and run  the
  5565. application until either execution reaches a breakpoint, the
  5566. application terminates or you press  <Alt-D>:  In any  case,
  5567. the breakpoint will be cleared.
  5568.  
  5569.  
  5570. 7.4  Miscellaneous keystrokes
  5571.  
  5572.  
  5573. <Ctrl-Home> moves the hilite bar  to the top of the  screen,
  5574. while <Ctrl-End> moves it to the bottom of the screen or the
  5575. last line in  the rule,  whichever is  nearer.   <Ctrl-PgUp>
  5576. moves the hilite bar to the first line in the rule.
  5577.  
  5578. <Alt-X> will attempt  to terminate the  debugger and  return
  5579. you to the editor, if the debugger was called from there.
  5580.  
  5581. <F4> sets up a temporary breakpoint on the currently hilited
  5582. line.
  5583.  
  5584. <Ctrl-F4> and <Ctrl-E>  bring up  the expression  evaluation
  5585. box.
  5586.  
  5587. <Alt-F5> displays the start-up screen of the editor.
  5588.  
  5589. <Ctrl-F8> toggles a  breakpoint at  the current  line.   The
  5590. breakpoint will be signalled by a breakpoint character, ■.
  5591.  
  5592. <Alt-F4> animates the debugger. You will be prompted for  an
  5593. animation delay.
  5594.  
  5595. <Ctrl-F7> and <Ctrl-W> enter a new watch expression.
  5596.  
  5597. Entity lists are (as in the editor) as follows:
  5598.  
  5599.  
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5607.       - Main Manual.                    Page: 100 -
  5608.  
  5609.  
  5610. Rule list:          on <Alt-Z> and <Shift-F2>
  5611. Screen list:        on <Alt-S> and <Shift-F3>
  5612. Unused rule list:   on <Alt-U> and <Shift-F4>
  5613. Unused screen list: on <Shift-F5>
  5614. Variable list:      on <Alt-V> and <Shift-F6>
  5615. Function list:      on <Ctrl-F> and <Shift-F7>
  5616.  
  5617.  
  5618. 7.5  Command Line Parameters
  5619.  
  5620.  
  5621. The debugger accepts  the use of  a number  of command  line
  5622. parameters.  These are letters (preceded by minus signs,  -,
  5623. or forward slashes /) which  alter some internal default  of
  5624. the debugger.   The current command  line parameters are  as
  5625. follows:
  5626.  
  5627.     o  -d: The  `d' parameter  will  cause the  debugger  to
  5628.        start up in  debug mode, as if  the user had  pressed
  5629.        <Alt-D> during  loading  of  the application.    This
  5630.        switch is  passed  invisibly  by the  editor  to  the
  5631.        debugger whenever  the  debugger  is called  via  the
  5632.        Debug application  option  in  the Run  menu  in  the
  5633.        editor.
  5634.  
  5635.     o  -e: The `e' option will return control to the  editor
  5636.        when the debugger  terminates.   Whenever the  editor
  5637.        calls the debugger, this option is silently passed to
  5638.        the debugger, so that the debugger will return to the
  5639.        editor when it terminates.
  5640.  
  5641.     o  -k: This  `k'  option is  used  to tell  the  runtime
  5642.        module not to  watch out  for the  two keystrokes  of
  5643.        <Alt-D> and  <Esc>,  which  are  normally  monitored.
  5644.        (<Alt-D> will interrupt the run module and relinquish
  5645.        control to the  debugger while  pressing <Esc>  twice
  5646.        will terminate the application.)
  5647.  
  5648.  
  5649.  
  5650.  
  5651.  
  5652.  
  5653.  
  5654.  
  5655.  
  5656.  
  5657.  
  5658.  
  5659.  
  5660.  - RExL  Version 2.11  Copyright 1992, The Software Loft -
  5661.  
  5662.