#	SID	@(#)radtut_u.txt	3.2 - 95/11/10

The Developer Tutorial


Table of Contents

        Introduction
        The Developer Tutorial
          Part I - New Applications
             Creating an Application
             Starting the Application
             Looking Around the System
             Changing the System Title
             Accessing the Developer System
             The Developer Menu
             Inserting a Menu
             Inserting a Data View
             The Custom-View Editor
             Defining Key Fields
             The Data View
             Data View Commands
             Querying the File
             The Query Definition Data File
             Ordering the File
             Physical Order
             Key Field Order
             Sort Index
          Part II - Data Views
             Creating a Data View - Review
             Repositioning a Menu Item
             Modifying the Employees Data View
             Creating Employees Fields
             Extended Field Options
             Data-File Menus
             Input Order
             Adding Keys
             Adding Employees
          Part III - The Print Menu
             Printing
             The Print Menu
             Custom Reports
             Sending Data to the Spreadsheet
             Sending Data to the Word Processor
             Creating a RAD Report
             Executing a RAD Report
          Part IV - System Administration
             User Modes
             Users
             Hierarchy Diagram
             Procedures and Job Streaming
          Summary



Introduction


     With the ANGOSS Developer, you can create both simple
     applications, to help organize your personal SmartWare
     files, and large applications that businesses use for any
     number of purposes.  Although the ANGOSS Developer does not
     present obstacles to the programmer, programming knowledge
     is not a requirement.

     Applications created with the ANGOSS Developer, called RAD
     Applications, make use of SmartWare's four application
     modules: Database, Spreadsheet, Wordprocessor, and
     Communications.  Since SmartWare is available on Windows, X
     Windows, DOS, and Unix, these applications automatically
     inherit the ability to run on any of these platforms.

     To get the feel of a RAD application, run the Sample
     application or try the following tutorial.


The Developer Tutorial


     In its most basic form, this is a ANGOSS Developer is a
     development environment that makes it easy to combine custom
     views, worksheets, documents, reports, and programs into a
     controlled application.

     Intended only as an introduction, this tutorial will guide
     you through the steps needed to build a simple Human
     Resources application - it will give you an idea of what the
     ANGOSS Developer and the systems created with it, can do.
     Note that some familiarity with SmartWare is useful but not
     necessary.

     Notes before starting:

          The example application, called RADHR, will be created
          in a directory of the same name below a fictitious home
          directory called /usr/johndoe. Thus the directory
          containing RADHR will be /usr/johndoe/radhr. Substitute
          the home directory name with whatever is appropriate.

          Approximately 1 Meg of disk space must be free for this
          application.





Part I - New Applications


Creating an Application

     First of all, start SmartWare.

     If you're running under X, turn off SmartWare's pulldown
     menus by selecting:

          Tools
          Preferences
          Terminate-Pulldowns

     New applications are created from the SmartWare command
     list.  Select the commands:

          Remember
          Make-Application

     This displays the Make Application dialog box.

          In the Application Directory text box, enter:
          /usr/johndoe/radhr

          In the Start up script text box, enter: radhr

          Script files are used to start RAD applications.  The
          remaining three fields on the dialog box determine
          whether start up scripts will be created for these
          platforms.  Create one or more start up scripts (you
          should at least create the start up script appropriate
          for your system).

     When you have finished, select the OK button.

     SmartWare will start copying files to the new application
     directory.


Starting the Application

     The RADHR application can be started by moving to the RADHR
     directory and then entering one of the following commands:

     For Character Unix:

          radhr

     For X Windows:

          xradhr

     RADHR will then prompt for a user ID.  Enter the "root" user
     ID (this ID will be explained later):

          Enter the user ID: root

     The first time into a system, the start up sequence will
     update system files.  This will not happen on subsequent
     start ups.


Looking Around the System

     At this point you should have a screen that contains a menu,
     The Main Menu, with the items, "Management & Utilities" and
     "Exit the application", on it.

     While the character mode version of the RAD App is visually
     different from the graphical one, the makeup of The Main
     Menu is the same.  Of the differences between the two modes,
     the existence of pulldown menus and tool bars in the
     graphics mode version are the most obvious.

     Graphical or not, the main menu is a "navigation" menu.  You
     can select items from navigation menus with any of these
     four methods:

          * Using the up/down cursor keys, highlight an item and
            press Enter.
          * Using the space bar or backspace key, highlight an
            item and press Enter.
          * Double click on an item with the left mouse button.
          * Press the first letter of an item - if more than one
            item exists with the same first letter, the
            highlighter will cycle through those items.

          Note: In character mode keyboard equivalents can be
          obtained by pressing Esc, Esc, BackSlash.

     Try this by selecting Management & Utilities.

     A second menu should appear partially covering the main
     menu.

     Now, select the System Management item.


Changing the System Title

     Let's make our first change to RADHR by entering a more
     descriptive system title.  Select System Defaults from the
     System Management menu.

     This time the menus are cleared.  The screen now contains
     four fields with a flashing cursor in the System Title
     field.

          Delete ANGOSS from the System Title field.
          Replace it with Human Resources.

     After pressing Enter, the cursor moves to the next field.

     We're not concerned with the other fields so, press the Esc
     key (Ctrl C) or the right mouse button.

     A dialog box then appears requesting whether or not we want
     to "Recalculate SYSDEF.VW each start up session?".
     Recalculating the System Defaults adds to the start up time.
     Generally, this recalculation is not necessary.

          Press Enter or click on the No button.

     When the navigation menus reappear, notice that the system
     title at the top of the screen has changed.


     Ok, so far we have not actually used the Developer system.
     The Management & Utilities menu is basically a System
     Administration tool set, but developers will undoubtedly use
     many of its functions - there will be more on this later.


Accessing the Developer System

     One of the nice things about a RAD Application is that you
     build the system while running it.  You can see and try out
     changes immediately.

     To start, let's return to the Main Menu by escaping or
     selecting the Return to Previous Menu item (twice).

     You should now have just the Main Menu on the screen with
     the highlighter on Management & Utilities.

     To access the Developer:

          Simultaneously press the key combination:  Ctrl A

     To prevent unauthorized access, the Developer system is
     password protected.

          Enter the default password into the dialog box:  1621

     The Developer's menu takes a moment to appear - this loading
     pause as well as the password entry request only occur the
     first time the Developer is accessed in a session.

     Note: the Developer password can be changed by a Management
     & Utilities menu item.


The Developer Menu


     In a graphics environment, the Developer menu is a pulldown

     type that is located near the top of the window.  Items on
     the pulldown are:

          Insert  Modify  Delete  Reposition  Utilities  Help

          Pulldown menus are accessed with the mouse.
          Alternatively, the Alt key activates the menu, cursor
          keys or an item's first letter make a selection.

     In character mode, the Developer menu is a command list
     located near the bottom of the screen. Items on the command
     list are:

          Insert  Modify  Delete  Reposition  Utilities  Help

          The space bar and backspace keys cycle the highlighter
          through the menu items. Enter selects the highlighted
          item.  A single mouse click or the first letter of an
          item can also be used.

          Because of the rotary nature of these menus, command
          lists are also referred to as ring menus.


Inserting a Menu


     Now that the Developer has been accessed, we can add a new
     item to the Main Menu.

          Select Insert.

     Insert presents a list of items that can be placed on
     navigation menus.  In this case, we want to add a sub menu
     to the Main Menu.

          Select Menu.

     In the Insert Menu dialog box, add the following for the
     Description, Autohelp, and menu file name fields:

          Enter the Description: Tables Menu
          Enter the Autohelp: Menu containing table views
          Enter the menu file name: tables

     Since this will be a database level menu, leave the resident
     module selection on Database.

          Now, select the Insertion Point button.

     In the menu map to the right of the command buttons, you can
     use the up/down arrow keys or the mouse to position the
     highlighter on an item.

          Select the Insert button (or use the Alt I key
          combination).
          Then select OK (or press F10).

     You are then returned to the Insert Menu dialog box.

          Select OK.

     Finally, you are given the option to enter comments about
     the modification - these comments are stored in a log.  You
     can also choose to finish or to continue working in the
     developer system.

          For now, let's just select Finished.

     And that's all there is to it.  The Developer completes the
     command and then returns you to normal execution mode.


     The Main Menu now contains the Tables Menu item we created.
     Notice that the autohelp text is displayed along the bottom
     of the application.

     To open the Tables Menu.

          Select Tables.

     As you can see, the Tables Menu contains a single choice:
     Return to Previous Menu.


Inserting a Data View

     The next step is to add a data view to this menu.

          Again, access the Developer System with: Ctrl A.
          Select Insert.


     As before, Insert presents a list of items that can be
     placed on navigation menus.  In this case, we want to add a
     Database to the Tables Menu.

          Select Database.


     In the Insert Database dialog box, add the following values:

          Enter the Description: Departments
          Enter the Autohelp line: The Department data view
          Enter the Menu File Name: depart
          Enter the Screen File Name: depart

     Leave the view path field as $$sysfiles.

          Now, select the View... button.

     A second dialog box appears which gives you the option to
     create a view similar to one that has already been created
     however, we're going to create a view from scratch.

          Select the OK button without entering a value in the
          text box.


The Custom-View Editor

     The Developer system creates a custom view called depart,
     places the description at the top left, and then presents
     the SmartWare custom-view editor command list:

          Option:  Attach  Create  Delete  Edit  Move
          Input-Order  Paint  Replicate

     NOTE: If you're already familiar with the custom-view
     editor, you can skip this section - the data file, called
     depart, will contain two fields: Code (A8) and Description
     (A50).

     Now, we must create a data file that stores information
     entered by users.

          Select Create.

     This presents the Create command list.

          Select Data-File.

     The custom-view editor now requests a data file name.

          Enter the name: depart

     Records in a data file can all have the same storage lengths
     regardless of the information's size within each record.
     This is referred to as Fixed-Length.

          Select Fixed-Length.

          Finally, select No-Password.

     At this point, we're going to add fields to the data view
     and file. Using the cursor keys or the mouse, move the
     cursor to line 3, column 4 (the cursor position is shown
     below the command list).

          Select Create.

     Again, this presents the Create command list.

          Select Field.

     The custom-view editor now requests a field name.

          Enter the name: Code

     Usually, fields are placed on the data file.

          Select Data-File.

     This presents a new screen where the field's type, width,
     title placement, and other options are defined. In this
     case, we just want to use the default values.

          Press F10.

     Ok, now let's create one more field. Move the cursor down to
     line 5, column 5.

          Select Create.

          At the Create command list, select Field.

     Now the field name.

          Enter: Description

     Place this field on the data file as well.

          Select Data-File.

     In the Field Definition Menu, leave the type as Alpha and
     move the pointer down one to the Field Width option.

          Enter the number: 50

          Select F10.

     We should now be at the custom-view editor's top level menu.
     Since these two fields are all we'll need for this data
     view, let's exit the editor.

          Select F10.

     This brings us back to the Insert Database dialog box.


Defining Key Fields

     Creating key fields can make data file sorts, queries, and
     searches very fast when performed on those fields.

     NOTE: Keys are immediately updated so that, when a file is
     ordered to a key and a record is added or modified, its
     position in the file is adjusted when the record is
     released.

     RADHR provides the opportunity to define key fields from the
     Insert Database dialog box.

          Select the Add Key... button.

     A field prompter appears.  The Code field is a natural key
     field choice. The cursor keys move the pointer around the
     prompter, make sure it points to Code.

          Press Enter or simply double click the mouse on Code.

     When the Key Definition menu pops up, just accept the
     defaults by pressing F10.

     Now, select the Insertion Point button and insert the data view
     above the Return to previous menu item.

     You are then returned to the dialog box.  Since that's all
     we need to do, select OK.

     RADHR then takes a moment to update its internal
     information.  When this is complete, you are again given the
     option to enter comments about the modification into the
     Changes log.

          For now, just select Finished.

     RADHR returns us to the Tables menu with Departments as the
     first option.


The Data View

     To see the view that we have created, select Departments from
     the Tables menu.

     This screen is generically referred to as a Data View.  Data
     views actually contain three components:

          *  Data File        This file or files defines the
                              record structure and holds
                              information entered by users.  In
                              this case, we created the file as
                              depart and added its fields in the
                              custom-view editor.

          *  Custom-View      Sometimes called a Screen, this
                              file defines how the Data File (or
                              Data Files - more than one can be
                              attached) appears to the user.  It
                              too was created with the
                              custom-view editor.

          *  Command Set      This menu provides the user with an
                              interface to the data.  The
                              Developer system created it with
                              the most common database commands
                              but you can customize it by
                              removing or adding commands.


Data View Commands

     For the moment, we are going to put the developer system
     aside (until Part II of the tutorial) and use the data view
     commands just as any user would.  Again, the Graphical
     interface uses pulldown menus while the Character interface
     uses command lists - in this case, both are refered to as a
     View Menu.

     The first thing we need to do is add some records.

          Graphical:

          Open the Edit pulldown menu and select Enter.

          Character:

          Select Enter from the command list.

     Because we're in data entry mode, the data view commands
     disappear.  Instead, a function key list appears near the
     bottom of the screen and the cursor flashes in the Code
     field.

          In the Code field, enter: FOFFICE
          In the Description, enter: Front Office

     A second blank record is displayed.

          In the Code field, enter: SHIP
          In the Description, enter: Shipping Department

     A third blank record is displayed.

          In the Code field, enter: HOFFICE
          In the Description, enter: Head Office

     Now add three or four of your own records.

     When you have finished, press the Esc key.

     To move through these records, experiment with the F5 and F6
     keys and the Ctrl Home and Ctrl End key combinations.  Graphical
     environment users can use the horizontal arrow icons on the
     toolbar (if you press and hold the left mouse button on one
     of these tools, you can read the autohelp message at the
     bottom of the window - moving the mouse along the toolbar
     without releasing the left button shows the current tool's
     autohelp).

     Notice that the values following the word Rec: at the bottom
     right of the screen change as you move through the file.
     This indicates the current record number.


     Ok, let's look at the remaining Data View commands.  The
     following group of commands - Browse, Delete, Krunch, Find,
     Update, and Return - are straight forward.  Try these
     commands out yourself.  Note: the location of these commands
     for graphical users is listed in parenthesis.

     Browse Mode (Data pulldown menu)

          If you select the Browse command, records are displayed
          across the screen and the cursor keys become active.
          Browse toggles between the two display modes.

     Delete and Krunch (Edit pulldown menu)

          Delete de-activates or re-activates the current record.
          A red flag at the bottom right indicates the record's
          delete status.  Note that deleted records are not
          actually removed from the data file until the Krunch
          command is used.

     Finding Records (Data pulldown menu)

          You can search for records with the Find command.  This
          command provides a fast binary search through the
          file's key fields or a sequential search on any field.


     Updating Records (Edit pulldown menu)

          The contents of records can be changed with the Update

          command.  The rules for moving around the record and
          editing fields are the same as those of the Enter
          command.

     Return (File pulldown menu)

          Use this command or Esc to exit the file.

     The Order and Query commands require a little more
     explanation.  In particular, these commands include a data
     file that retains definitions and indexes created by the
     user.  The easiest way to explain this data file is to
     create a query first.

     NOTE: Due to the number of options behind the Print command,
     it will be discussed later in a section of its own.


Querying the File

     Files can be temporarily limited to a subset of records by
     executing a query.  Query definitions determine what the
     subset will be. Let's try this now.

          Graphical:

          Open the Data pulldown menu and select Query.

          Character:

          Select Query from the command list.

     RADHR presents the Create Query dialog box.

          In the Definition Name, enter: Office

     With this query, we will create an index having only office
     codes.  The description should reflect this.

          In the Description field, enter: Access office codes only

     To create the query:

          Select the Define... button.

     Now the query-by-example (QBE) screen is displayed with the
     cursor flashing in the first field.

     We want this query definition to select just the records
     that contain OFFICE in the Code field.  To do this, we use a
     special symbol (the exclamation point) that means 'contains'
     followed by the search data (refer to the Database Manual
     for complete instructions on query usage).  For example:

          Enter: !OFFICE

     The cursor moves to the next field.  We don't need to add a
     second search criteria so let's just quit.

          Select F10.

     This takes us back to the Create Query dialog box.

          We are done here, so select OK.


The Query Definition Data File

     Now that a query definition has been created, we can look at
     the data file that maintains the query definition and index
     file names.

     Normally, you can use the cursor keys to move to different
     records but, in this case, we only have one definition.
     Notice that the record shows the name of the query, its
     description, the view it was defined for, the date it was
     last used, the last user, and, if you move the highlighter
     all the way to the right, the last modified date and who
     modified it.

     The pulldown menu or command list operations are:

          Run       Executes the currently highlighted query and
                    returns to the active view (in this case, the
                    Departments view).

                    Note that, if the query has been run before,
                    RADHR provides the opportunity to rerun it or
                    use the previous run results - that is, order
                    the file to the last index created by this
                    query.


          Create    Similar to the steps we took earlier when
                    creating the OFFICE query.  Note that you can
                    use an existing query definition as the basis
                    for a new one.

          Edit      Edits the highlighted query.

          Delete    Removes the highlighted query definition and
                    its reference in this data file.

          View      Displays the highlighted query definition.

          Now       Creates and executes a query but does not
                    place a record in the Query Definition data
                    file.

          This_View Presents only those queries created for the
                    current Data View.

          Quit      Returns to the Data View command list.


     Let's run the query.

          Select Run

     The query executes and creates an index.  When this is
     complete, a Query Summary box appears indicating the number
     of records searched and the number of matches found, as well
     as, the index's full name (the index name is taken from the
     query definition name).

          Use Esc to clear this summary box.

     Notice how, the Department view's status line (second line
     from the bottom) shows that the file is ordered to the
     OFFICE index.  A quick look with browse mode on should
     reveal that the file displays only those records with the
     word OFFICE contained within the Code field.


Ordering the File

     There are two ways that the sequence of records in a data
     file can be altered from the order in which they were
     entered.

          Keys can be used to immediately arrange the data file
          alphabetically (or numerically) based on the contents
          within each record's key field.

          Sorts too, are used to arrange the data file but are
          generally performed on non key fields or on a
          combination of fields.  When a sort definition is
          executed, an index file is created (remember that a
          query also produces an index).  Note that sorting data
          files with a large number of records may take a
          considerable amount of time.

     The Order command presents a secondary menu containing the
     data file's key fields plus two other options: Special_Sort
     and Physical.  Let's take a look at it now.

          Select Order.

     On the department file, Code is the only key field, so this
     Order command lists:

          Code, Special_Sort, Physical


Physical Order

     The Physical option is the simplest to explain.  It simply
     returns the file to the order in which records were entered.

          Select Physical.

     If your data file was still ordered to the OFFICE query
     prior to executing the Physical command, you should now
     notice that the file is in its original order.  The status
     line should also have changed.



Key Field Order


     There are three sub-options when ordering to a key field.
     The first arranges the entire file based on the value in
     each record's key field.  While it is also possible to limit
     the file to a range or even a single value, the department
     view is not the type of file we would do this with.  Since
     that is precisely what the other two options do, we will
     discuss them in a more suitable Data View.  For now, let's
     just order the whole file.


          Select Order.

     The only key field in this file is Code.

          Select Code.

     We want to place all the records in key field order.

          Select Whole_File.

     Notice that, when the command has completed, the view's
     status line shows that the file is in key field order.



Sort Index

     Like the Query command, Special_Sort has a data file that
     retains the names of user-defined sort definitions and
     indexes.  The steps are similar.

          Select Order.
          Select Special_Sort.

     The RAD application presents the Create Sort dialog box.
     With this sort, we're going to order the data file to the
     description field.

          In the Definition Name field, enter: Descript
          In the Description field, enter: Sort on department descriptions


     Following that:

          Select the Define... button.

     Now RADHR presents a field prompter pointing to the first
     field.  With the cursor keys or mouse, move the pointer to
     the Description field.

           Press Enter.

     We can choose to have the sort place records in a
     lowest-to-highest or highest-to-lowest sequence.  Let's
     change this to Descending.

          Pressing the D key.
          To finish, press F10.

     We are then returned to the Create Sort dialog box.

          Press OK.

     Refer to the Database Manual for complete instructions on
     sort usage.


     RADHR displays the Sort Definition data file and command
     set.  Notice that this screen is identical to the Query
     Definition data file described earlier.


     To execute the sort:

          Select Run.

     The sort executes and creates an index.  As with the query

     earlier, the view's status line (second line from the
     bottom) shows that the file is ordered to the DESCRIPT
     index.


     Ok, let's completely exit the system - we'll restart it in
     part II.

          Select Return (on the File pulldown menu) to get back to
          the Tables Menu.
          Select Return to previous menu to get back to the Main Menu.
          Select Exit the application
          And confirm that you want to return to the operating
          system (OS).





Part II - Data Views


     Since you're now somewhat familiar with the ANGOSS Developer
     and RAD applications, descriptions of steps in the second
     part will be brief.  This should make it faster to move
     through the tutorial.


Creating a Data View - Review

     Follow the steps used in Starting the System at the
     beginning of the tutorial to restart RADHR.  The Main Menu
     should appear with the highlighter on the Tables Menu item.
     Move this down so that it highlights the Management &
     Utilities item.

     Start the Developer with the Ctrl A key combination and enter
     the password: 1621

     We're going to add an Employees file to the Main Menu.
     Considering that you already know how to create a Data View,
     these steps should be easy.

          Select Insert.
          Select Database.
          Enter the description: Employees
          Enter the autohelp line: The Employee data view
          Enter the Menu file name: emp
          Enter the Screen file name: emp
          Select the View... button.
          Don't create a similar view, just select OK.

     At this point we're in the custom-view editor.  First create
     the data file.

          Select Create.
          Select Data-File.
          Enter the file name: emp
          Select Fixed-Length.
          Select No-Password.

     Now create a field.

          Select Create.
          Select Field.
          Enter the field name: Last Name
          Select Data-File.

     The Field Definition Menu should be displayed.  Notice that
     the field width's default value of eight is too small for
     many surnames.  Let's change it.

          Move the cursor to Field width and enter: 25
          Press F10.

     For now, let's quit and save the view.

          Press F10.
          Don't create a key field.
          Select Insertion Point... and make the insertion below the
          Tables Menu.
          Select OK.
          Select OK.
          Select Finished.


Repositioning a Menu Item

     It might make more sense if the most commonly used option is
     in the first position on the menu so, let's move the
     Employees view.  There are small differences between the
     graphical and character versions in the way you go about
     moving menu items.  In graphical mode, you select the menu
     item after the Reposition command is issued while, in
     character mode, you must highlight the menu item before the
     Developer system is started.

          Graphical:

          Start the Developer with Ctrl A.
          Select Reposition.
          Select Employees.

          Character:

          Highlight the Employees item.
          Start the Developer with Ctrl A.
          Select Reposition.

     The remaining commands are the same.

          Move the insertion point highlighter to Tables Menu.
          Select Insert.
          Select OK.
          Don't bother with the Changes Log, select Finished.



Modifying the Employees Data View

     The Employees data view currently contains just one field.
     To add more fields:

          Select Employees.
          Start the Developer with Ctrl A.


     As usual, RAD's command list pops up but, when modifying a
     Data View in character mode, the view's command list is
     displayed too.  This is because we may want to make changes
     to either the data view's command list or the custom-view
     and data file - remember, a data view consists of three
     parts.

     This time, we want to modify the Employees custom-view (also
     referred to as screen) and data file.


          Graphical:

          Select Modify.
          Select Database.
          Select Screen_and_DB's.

          Character:

          Select Modify.
          Select Screen_and_DB's.

     Data views may have data files loaded in the background.  In
     this case, we don't have any background files so it's
     irrelevant to specify whether we should unload them or not.
     Usually however, background data files are not unloaded.

          Select No.

     First of all, let's move the Last Name field down two lines.

          Select Move.
          Select Item.
          Select Field.

     The field prompter pops up and displays our only field.

          Press Enter.
          Move the cursor to Line 5, Col 5.
          Press Enter.



Creating Employees Fields

     Here is a list of the fields (not including the Last Name
     field) that we will be creating.

     Employees Fields

          Name                Type      Width

          Employee Number     counter   5
          Employment Date     date      10

          First Name          alpha     12
          Address             alpha     30
          City                alpha     20
          Telephone           alpha     12
          Department          alpha     8
          Salary              numeric   7

     Ok, let's place the Employee Number field where the Last
     Name field used to be.  Employee numbers need to be unique
     and a good way to ensure that, is to use a counter field.
     This type of field increases in value each time a record is
     entered.

          Move the cursor to Line 3, Col 5.
          Select Create.
          Select Field.
          Enter the field name: Employee Number
          Select Data-File.

     The Field Definition Menu should be displayed.  We're going
     to change the field type to Counter and the field length to
     five.

          With the space bar (or mouse), move the highlighter to
          Counter.
          Move the pointer to Field width and enter the number: 5
          Press F10 to exit the Field Definition Menu.

     Using the field list above, create the remaining fields.


Extended Field Options

     Aside from just the type, width and title placement, a
     variety of other field options can be altered.  To
     demonstrate this, let's edit the Salary field and take a
     look at the extensions offered by the Field Definition Menu.

          Select Edit from the Custom-View Editor's first level
          command list.
          Select Field.
          In the field prompter, point to Salary and press Enter.
          Leave the field's screen width at seven by pressing
          Enter.
          Move the pointer down to Extended Field Options.
          Using the space bar, move the highlighter to Yes.

     The Field Definition Menu expands.

     Note that extended field options affect the field on the
     custom-view but not on the data file (this is also true for
     the Field Title Placement).  If the data file is also
     attached to another custom-view, these options can be set to
     entirely different values.  Think of the custom-view as a
     way to display fields and control input to the data file.

     Items on the Field Definition Menu are, for the most part,
     self-explanatory (though you may wish to use F1 Help or
     refer to the Database manual for more information).  In many
     cases, valid options can be listed with the F6 key. One
     point regarding the View Field Name: you can change the
     field name on the custom-view but the original name is
     retained on the data file.  While this may be necessary
     sometimes, take care changing the name because it adds a
     level of complexity that may later make it difficult to
     diagnose problems.


     For the Salary field, we want to make two changes: the
     display format should be changed to a currency type; we'll
     also add an entry message.  Continuing from our last steps.

          Move the pointer to Field display format.
          Press F6 for a list of options.
          Enter the characters: R$
          Move the pointer to Data Entry Message.
          Enter: Yearly Salary Amount
          Press F10 to exit the Field Definition Menu.



Data-File Menus

     Now let's add a menu to the Department field.  In this case,
     we want to access the codes from the department file.  To do
     this we must first attach the Department data base to the
     Employees custom-view and then create a Data-File menu.

          Select Attach.
          Select Data-File.
          From the file prompter select depart.

     That takes care of attaching the Department file.  Note that
     the Data-File menu we are about to create can only appear
     when a user updates the field containing the menu.

          Select Create.
          Select Menu.
          From the field prompter select Department.
          Select Data-File.
          From the attached data file list select depart.

     At this point we are presented with fields from the
     department file.  These are the fields that will appear on
     the menu.

          From the field prompter, use F6 to select both Code and
          Description.
          Press F10.

     The value returned when a user selects a particular item
     from the menu must be specified.

          From the field prompter, select Code.

     The menu's size and location can be set.  Let's just use the
     default.

          Press F10.

     As was stated earlier, data-file menus only appear when
     updating the field containing the menu.  In fact, data-file
     menus also require the user to a press the key combination:
     Alt F5.  To make users aware of this, let's edit the field and
     add an entry message.

          Select Edit.
          Select Field.
          In the field prompter, point to Department and press
          Enter.
          Leave the field's screen width at eight by pressing
          Enter.
          Move the pointer down to Extended Field Options.
          Using the space bar, move the highlighter to Yes.
          Move the pointer to Data Entry Message.
          Enter: Use Alt F5 to access the Department menu
          Press F10 to exit the Field Definition Menu.


Input Order

     When updating a record, the input order determines the
     sequence for editing fields.  By default the sequence that
     fields were created in is used.  To change this, use the
     Input-Order command.

          Select Input-Order.
          Press the key combination Alt R.
          Press F10.

     The Alt R key combination forces the sequence to start at the
     top left field, move across the screen, then down to the
     next line and so on.

     Ok, that's all we need to do to the Employees custom-view.
     Let's exit the custom-view editor and update the system
     information.

          Select F10.
          Select Finished.



Adding Keys

     When a data view is first created, the Create dialog box
     provides an option to add keys.  This doesn't happen when a
     data view is modified.  Instead, the Developer system
     provides a separate command list option to modify keys.


          Start the Developer system (Ctrl A).
          Select Modify (graphical users must then select Database).
          Select Add_Key.
          Point at Employee Number and press Enter.
          Press F10 to accept the defaults.

          Select More Development to keep the Developer system
          active.

          Again, select Modify (graphical users must then select
          Database).
          Select Add_Key.

          Point at Last Name and press F6.
          Point at First Name and press F6.
          Press Enter.
          Press F10 to accept the defaults.

          Select Finished.

     Notice that the second time we added a key, we selected two
     fields.  This was done to refine the ordering of records
     when more than one employee has the same last name.  With
     keys of this type - that is multiple field keys - the first
     field is referred to as the major key field and the others
     as minor key fields.



Adding Employees

     Add some records with the Enter command - any employee names
     will be fine - but add more than one employee per
     department.  You should see that the Employee Number is
     automatically entered and incremented for each record.
     Remember, when entering data into the Department field, the
     Alt F5 key combination presents a data file menu.

     Before moving on to Part III, take some time to look at the
     Find, Order, and Query commands and their sub-commands.





Part III - The Print Menu


Printing


     At the end of Part III, we'll see how developers can create
     sophisticated reports that are accessed but not modified by
     users.  However, users are not limited to the developer's
     reports.  They can create their own custom reports or send
     data to the spreadsheet and word processor modules.  Let's
     begin with the Print Menu, employing it as any user would.


The Print Menu

     If you have quit RADHR, restart it, go into the Employees
     data view, and select Print (File menu for graphical users).
     This opens the Print sub menu.

     The first option, Print Current Record, does just that.  It
     prints the record as it appears on the screen with both
     field titles and data.  The remaining three options use a
     definition data file similar to the ones used by the Query
     and Special_Sort commands (discussed in Part I).  Of course,
     the definitions themselves are quite different.


Custom Reports

     To start with, let's create a custom report.

          Select Custom Report.
          Enter the Definition Name: resource
          Enter the Description: Human Resource List
          Select the Define... button.


     The Report Generator

     At this point, RADHR accesses the SmartWare report generator
     in order to create a report definition.  Its command list
     appears as:

          Option:  Form  Table  Page  Edit-Fonts  Remove-Fonts

     We're going to define a simple table report that lists the
     contents of each record's Employee Number, Name, and
     Department fields in column format.  If you're already
     familiar with the SmartWare report generator, you can skip
     this and go on to the next section.

     The first thing we need to do is to indicate that the report
     contains a table.  This is accomplished through the Page
     Definition screen.

          Select Page.
          Move the Page Definition pointer to the last option, Is
          there a Table on the Page.
          Move the highlighter to Yes.

     A number of sub-options appear regarding the size and
     spacing of the table on the page. For our purposes, the
     default values are adequate.

          Press F10.


     Now let's define the table.

          Select Table.
          Select Columns.


     The Columns command list allows us to add and arrange
     fields, calculations and text on the report.  In this case,
     we're simply going to add fields.

          Select Field.
          Select Employee Number from the field prompter.

     That should produce the Field Options screen.

     Again, let's accept the default settings.

          Press F10.

     This field now appears on the dotted line: the field name
     above the line serves as the column title on the printed
     report; the numbers below indicate the column length and
     type (numeric).  The cursor flashes on the last character of
     the field - let's move it to the right and add the next
     field.

          Press the right arrow key twice.
          Select Field.
          Select Last Name from the field prompter.
          Press F10 to accept the Field Option defaults.

     Continue this process by adding the First Name and the
     Department field.  To finish:

          Press F10 three times.
          Select OK.

     This takes us to the report definitions view (similar to
     that of the query).

          Select Run.

     A dialog box appears with a number of options.  You can send
     the report output to the printer or screen or disk.  You can
     specify whether all records should be printed or just the
     results of break point totals - we did not define break
     points on this report, so Totals Only is not a valid choice.
     The remaining options determine the start/end pages and the
     number of copies to print - pressing Enter on each of these
     without typing any numbers results in default settings where
     one copy of the report, from first to last page, is printed.

     The SmartWare report generator is an extensive subject
     covering form, table, and combination reports plus options
     within these reports such as labels, break points,
     calculations, titles, and fonts.  To learn more about the
     report generator, refer to the Database Manual.


Sending Data to the Spreadsheet

     To send data from the current view to a worksheet:

          Select Send to Spread Sheet from the print menu.
          Enter the Definition Name: salary
          Enter the Description: Table of employee salaries
          Select the Define... button.

     In the Send dialog box, the Record Format field determines
     the vertical or horizontal appearance of data in the
     worksheet.  Send Fields determines the data that gets sent.
     If this is set to List-Fields, the desired fields should be
     entered into the Select Fields text box.  The Summarized
     option uses SmartWare's send crosstab command.  Refer to the
     Database Manual for instructions on defining crosstabs.

     In this case, we're going to send the name and salary fields
     from all records in the file.

     Leave the Record Format set to Row and move to the Send
     Fields option.

          Select List-Fields.

     Move to the Select Fields text box.

          Press F6 to produce the field prompter.
          Move the pointer to the Last Name field.
          Press F6 (mouse users can click on the field).
          Move the pointer to the First Name field.
          Press F6.
          Move the pointer to the Salary field.
          Press F6.
          Press F10.
          Select OK.

     We should now be back at the Create Send dialog box.

          Select OK.

     This takes us to the send definitions view (again similar to
     that of the query).

          Select Run.
          Select OK.
          Select OK.



     You should now be in the spreadsheet module's entry mode and

     are free to make changes to the worksheet.  To return to the
     print menu:

          Graphical:

          Select Exit from the File pulldown menu.

          Character:

          Press F10.
          Select Resume_application.


Sending Data to the Word Processor

     This process, called Mail Merge, creates a "form letter" for
     each record in the current view.  The idea here is that
     fields (such as First Name) can be substituted into a
     generic letter.

     To do this:

          Select Mail Merge from the print menu.
          Enter the Definition Name: memo
          Enter the Description: Memo for upcoming meeting
          Select the Define... button.

     In the Create Merge dialog box:

          Press F6 to produce the field prompter.
          Move the pointer to the First Name field.
          Press F6 (mouse users can click on the field).
          Move the pointer to the Last Name field.
          Press F6.
          Press F10.
          Select OK.

     We should now be back at the Create Merge dialog box.

          Select OK.

     This takes us to the merge definitions view.

          Select Run.
          Select OK.

     You should now see the selected field names within an
     otherwise blank document.  These fields are surrounded by
     double arrow characters (which indicate that they are Merge
     Variables) and prefixed with plus signs.  The plus sign is
     actually a merge variable option that causes the variable to
     be omitted if the input string is empty.

     Merge variables can be placed anywhere in a document.  As
     well, merge variables can be reused.  To manually insert
     merge variables, use the Ctrl J key combination to enter the
     merge start symbol, type a valid variable name, and press
     Ctrl K to complete it.  For a complete description of merge
     variables and the entire merge process, refer to the Word
     Processor manual.

     Enter whatever text you wish to have in your memo.  For
     example:

          MEMO

          Copy to: <<First Name>> <<Last Name>>

          Re: Product Review Meeting
          Date: March 21
          Time: 2:00 PM
          Place: Presentation Room


     When you have finished creating the form letter:

          Select Exit (F8 in character mode).

     RADHR then provides the opportunity to print the letters
     immediately or leave it for later. Print output can be sent
     to the printer or to a file.

     Since this mail merge is now set up, it can be used at any
     time without modification - simply select it and specify
     that you do not want to modify the definition.

     Note that a mail merge uses only those records in the
     current index.


Creating a RAD Report

     While developers can insert reports at any database menu,
     one common place to do this is on a data view's print menu.
     The type of report we're about to look at is fixed by the
     developer (i.e., users cannot modify the report).  It has
     the ability to combine a report definition, an input screen,
     a query and a sort, as well as, an SPL program.
     Furthermore, options that are determined at run time, such
     as the number of copies to print, can be preset or prompted.

     To begin, move the highlighter to the last item on the print
     menu and then start RAD.

          Select Insert.
          Select Additional.
          Select Print.
          Select Report.

     In the Insert Report dialog box:

          Enter the description: Department Salaries
          Enter the Autohelp line: Salaries paid to employees by department
          Enter the Default component name: sal_rp
          Select the Report Components button.

     The Report Setup dialog box is then displayed.  Basically,
     this dialog box provides access to the report components and
     the execution parameters.

     The first step here is to create a Report Layout.

          Select the [Attach] button beside Report Layout.

     The Attach Report Layout dialog box defaults the layout file
     name to sal_rp.

          Select New.

     This takes us to SmartWare report generator (we used it
     earlier in the Custom Reports section).  As before, we will
     indicate that the report contains a table.

          Select Page.
          Move the Page Definition pointer to the last option, Is
          there a Table on the Page.
          Move the highlighter to Yes.
          Press F10 to accept the remaining defaults.

     Now let's define the table.

          Select Table.
          Select Columns.

          Select Field.
          Select the Department field.
          Press F10 to accept this column's defaults.

     Move the cursor a space beyond the Department field.

          Select Field.
          Select the Last Name field.
          Press F10 to accept this column's defaults.

     Move the cursor a space beyond the Last Name field.

          Select Field.
          Select the First Name field.
          Press F10 to accept this column's defaults.

     Finally, move the cursor a few spaces beyond the Fisrt Name
     field.

          Select Field.
          Select the Salary field.
          Change the Column Width to 9.
          Press F10 to accept this column's settings.

          Press F10 to complete the column setup.

     OK, that takes care of the columns.  What we need now is a
     breakpoint placed on the Department field.  This breakpoint
     will be used to sum the salaries of each person within a
     department (that's why we added more one employee per
     department).

          Select Breakpoints.
          Select Add.

     The Department field should now be highlighted.

          Press Enter.
          Press F10 to accept the defaults in the Totals Option
          box.
          Using the cursor keys, move the highlighter to the
          Salary field.
          Press S to sum that field.
          Press F10.
          Press F10 to complete the Breakpoints.

     You can add a Grand Total to sum all the salaries and a
     report title if you like.  For now, let's just quit the
     report generator.

          Press F10.
          Press F10.

     That brings us back to the Report Setup dialog box.  For our
     breakpoint arrangement to work, we must insure that the file
     is ordered correctly.

          Select the [Attach] button beside the Order To item.

     The Attach Order To dialog box defaults the sort file name
     to sal_rp.

          Select Sort.

     The field prompter should now be displayed.

          Select the Department field followed by the Last Name
          field.
          Press F10 to complete the field selection.
          Press F10 to accept the Sort Definition defaults
          (Ascending Order).

     Again, that brings us back to the Report Setup dialog box.

          Select the [Modify] button beside the Parameters item.

     The Execution Parameters dialog box displays a number of
     options that affect the report during run time.  Of these
     options:

          Set the Destination field to Ask-User.
          Set the Records Used field to Whole-File.

          Select OK to close the Execution Parameters dialog
          box.
          Select OK to close the Report Setup dialog box.

     Finally, we return to the Insert Report dialog box.

          Select an insertion point and complete the dialog box.

          Select Finished to complete the Developer session.


Executing a RAD Report

     Let's test our report.  We should now be on the Print menu.

          Select the Department Salaries item.

     A dialog box pops up that tells us the number of records
     that will printed.  We can also select a destination for the
     report.  When testing, it's a good idea to send the output
     to the screen or text screen.  The text screen option is
     much faster but it does not display the report exactly how
     it appears when printed.

          Select Screen or Text-Screen.
          Select OK.


     To summarize, the following stages describe how the report
     worked at run time:

          Whole File          The Employees data view was ordered
                              physically to insure that all
                              records would be included in the
                              report.

          Sort                The file is then sorted first by
                              the Department field and then by
                              the Last Name field.

          Destination         The data is sent to the report
                              layout program to be displayed on
                              the screen.

          Layout              The report layout program displays
                              each record in the current order.
                              When a new value for the Department
                              field is encountered, records from
                              the previous group are summed
                              together based on the values in the
                              Salary field.  This total is
                              displayed before the next
                              department group is started.

     Now, exit out of the RADHR application and take a break.





Part IV - System Administration

     In Part IV, we'll set aside the Developer system and
     investigate the application's administration capabilities.
     Generally, access to these tools is provided by the
     Management & Utilities menus.  Before we start, you may want
     to backup or copy the RADHR directory tree.

     To begin:

          Start RADHR.
          Select Management & Utilities.


User Modes


     RAD applications can be set up so that access is controlled
     in groups.  This is useful in multi-user situations where,
     for example, one group of users is limited to an order entry
     menu while another group is confined to a shipping menu.

     By default, RAD applications come with three user modes:
     Developer, Administrator, and User.  So far, we have been
     using the developer mode (since it's the only mode that
     gives us the ability to build an application).

     Let's take a look at this now.

          Select User Management.
          Select User Mode Maintenance.
          Enter the password: 1621


     Here, the Main Menu's items are listed under Description.
     The columns beside this show the item access for each user
     mode except DEV mode (developers have access to everything).
     The slashes in the User column indicate that anyone
     belonging to the group User, will not see the Manage &
     Utilities item on the Main Menu and therefore will not have
     access to that menu.

     To add a new User Mode:

          Move the highlighter to the User column (any row will
          do).
          Select Usermode.
          Select Add.

     In the Add Usermode dialog box:

          Enter the Short name: Group
          Enter the description: Level 1 Users
          Select OK.
          Select Yes in the backup warning message.

     You should now have a new user mode with the same
     capabilities as User.  In addition to the Management &
     Utilities item, let's disable the Tables Menu.

          Move the highlighter into the GROUP column and the
          Tables Menu row.
          Select Access.
          Select Disable.

     On the Access menu, you may have noticed that items can be
     Enabled or Passwords attached.  In fact, aside from access
     limitations, there are a number of other menu aspects that
     can be modified by user mode.  The Defaults menu allows you
     to change menu types, colors, help exposure, a user mode's
     starting menu (it doesn't have to be the Main Menu), and
     more.  Menu aspects can be changed globally, on a
     per-menu-basis, or by item.  If you're a developer, you can
     also change menu and item information through the All Users
     command.

     Ok, that takes care of the Main Menu, but what about the
     other menus?  There are two ways to go about making user
     mode changes to other menus: one way is to select Next Menu
     from the File menu, the second is described below.

          Select File.
          Select Quit.
          Select Return to Previous Menu.
          Select Return to Previous Menu (returns to the Main Menu).
          Select Employees.

          Press the Ctrl U key combination.

     Note that the User Mode Maintenance screen can be accessed
     with the Ctrl U macro on any navigation or view menu.

     We're going to disable the Krunch command for GROUP users.

          Move the highlighter into the GROUP column and the
          Krunch row.
          Select Access.
          Select Disable.

          Select File.
          Select Quit.

     Finally, there is one more user mode command we should try.

          Exit the Employees view and return to the Main Menu.
          Press Ctrl U.

          Select Usermode.
          Select Switch.
          Select GROUP.

          Select OK in the message dialog box.

          Select File.
          Select Quit.

     We've temporarily switched to the GROUP user mode.  As you
     can see, the Main Menu is restricted to the Employees and
     Exit items.  If you check out the Employees view, you will
     not find the Krunch command.

     To switch back, perform the same steps but select DEV rather
     than GROUP.


Users


     In multi-user situations, individual users have their own
     passwords and working directories.  So far, we've been using
     the ROOT user which belongs to the DEV user mode.

     To set up a user:

          Select Management & Utilities.
          Select User Management.
          Select Users.


     The User Management Screen is presented.  This is actually a
     data view which currently contains only the ROOT user
     record.  Let's add a hypothetical administrator named
     Warren.

          Select Enter (graphical users will find it on the Edit
          pulldown menu).

     Now, enter the following data into these fields:

          Field      Data

          User ID             WARREN
          Password            555LT
          User Name           Warren Piece

     In the Assigned User Mode field:

          Press Alt F5.
          Select ADMIN.

     The Information Set determines the default paths used by the
     system for this particular user (currently there is only one
     set of paths).  In the Information Set field:

          Press Alt F5.
          Select standard.

     Because we haven't set up any language information, skip the
     Language field.  Select the following options for these
     fields:

          Field       Select

          Autohelp                      Yes
          Application Help              Author
          Technical Reference           Read_only
          Procedures                    Author
          Definitions                   Author
          Administrator                 Yes
          Language Maintenance          Yes

     This group of fields determines whether a user can create
     and/or access help files, procedures, and definitions (such
     as user defined queries), as well as, perform administration
     and language maintenance tasks.  Since Warren is an
     administrator, it seems likely that he needs the above
     capabilities.

     The Personal Directory field defaults to the user ID name.
     This is a reasonable value.

          Press Enter.

     If the directory \WARREN does not exist, RADHR requests
     permission to create it.

          Select Yes.

     That takes care of setting Warren up as a user in RADHR.
     Exit the view and return to the Management & Utilities menu.

     At this point, each time he starts the system, he must login
     with his user ID and then enter the password.  You can
     however, have the login occur automatically by setting the
     environment variable, USER, to his user ID.  Refer to your
     operating system manual for information on this variable.
     Note: in DOS, the environment variable is ANGIIUSR.


Hierarchy Diagram


     With small applications like RADHR, it's not difficult to
     remember the overall structure of the system.  However, in
     large systems, a tool like the Hierarchy Diagram can be
     useful.  We'll take a brief look at it despite the size of
     our application.

     From the Management & Utilities menu:

          Select Menu Hierarchy Diagram.

     Because it takes time to create, the diagram is not
     automatically kept up to date.  To bring it up to date:

          Select File.
          Select Generate.
          Accept the Generate dialog box defaults and select OK.

     The process takes a moment and then redraws the screen with
     the items we have added.

     With the cursor keys, you can move to other items in the
     diagram.  Try experimenting with menu selections.  Among
     other things, there are tools that allow you to jump
     directly to an item, view a menu as it appears in the
     application, display the action/object/function of all
     items, and demonstrate the direct route from the top menu to
     the currently highlighted item.

     When you have finished experimenting:

          Select File.
          Select Return.


Procedures and Job Streaming


     These two items provide an automated way of stepping through
     application items.  Procedures direct a user through each
     step, allowing them to interact but not stray from the
     pre-set course.  Job Streams work a little differently:
     interaction occurs before items are run, providing a
     mechanism for unattended processing.

     Since the item types used in procedures is not limited, as
     it is with job streams, let's setup and run a simple
     procedure.


     Procedure Setup

     From the Management & Utilities menu:

          Select System Management.
          Select Procedures & Job Streaming.

     Each Procedure and Job Stream contains a record in this
     file.

          Select Enter (Edit menu in graphics mode).
          Enter the Short Name: test
          Enter the Description: Test Procedure
          Select Procedures as the type.
          Skip the Users box and move to the User Modes box below
          it.
          Enter: DEV
          Save the record.

          Select Steps (Edit menu in graphics mode).

     This produces the hierarchy diagram with a Control Screen
     placed on top of it.


     To Enter the first step into the Control Screen:

          Select Insert (Edit menu in graphics mode).
          Select Access-Application.
          Move down through the hierarchy to Tables Menu.
          Move right to Departments.
          Move right to Print.
          Move down to Update.
          Choose Select from the menu.

     For the second step:

          Position the highlighter on step 2.
          Select Insert (Edit menu in graphics mode).
          Select Access-Application.
          Move down to Employees.
          Move right to Print.
          Move down to Browse.
          Choose Select from the menu.

     For the final step:

          Position the highlighter on step 2.
          Select Insert (Edit menu in graphics mode).
          Select Access-Application.
          Move down to Employees.
          Move right to Print.
          Move down to Update.
          Choose Select from the menu.
          Choose not to make it the same step.

          Select Save (File menu in graphics mode).
          Select Return (File menu in graphics mode).

     Now, return back to the Management & Utilities menu.  Note
     that setting up a Job Stream is nearly identical.


     Procedure Execution

     While it is possible to insert individual Procedures or Job
     Streams onto navigation menus, in this case, we'll just
     execute it from the view.

          Select Run a Procedure or Job Stream.
          Choose Select.

     The PROCEDURE CONTROL SCREEN pops up between each step,
     giving users the ability to continue, back up, skip, attain
     help, and abort.


Summary


     That's it.  We've covered many of the basic aspects of
     developing a RAD application, but there's more to experiment
     and create with.  Try adding spreadsheet and document views
     to the application;  if you have some programming skills,
     the audited program option automates the task of tracking
     processes;  for organizing large amounts of data, the
     archiving feature may be valuable; add help files to the
     application and automatically generate documentation...

     For a complete list of items that can be inserted on menus,
     refer to Chapter 3 of the Developer Manual.



