





                          DOCUMENTATION FOR CUI/BAS
                          Version 1.01    10/01/88



    C.U.I. DATABASE SYSTEM by Alan E. Varga, 267 Evergreen Lane,
    Bloomingdale, IL 60108-1815.
    DISCLAIMER: Every effort has been made to insure the reliablility of
    this software.  However NO WARRANTY is expressed or implied and NO
    LIABILITY will be assumed for any damages resulting from its use. 
    Additionally, is it not intended for commercial use.
    NOTICE: These programs have been released to the public domain and
    distribution is authorized provided this documentation file is made
    available to all prospective users.











































                     Documentation for CUI Database System


                               Table of Contents

    Introduction.........................................................3
    Getting Started......................................................4
    Installation.........................................................5
          Change Passwords...............................................5
          Install a Data Disk............................................5
          Create/Reorder a Format File...................................5
    Data Entry...........................................................7
    Report Designer......................................................8
    Change/Delete a Format File..........................................8
    Release Notes........................................................9










































                                        
                                   - Page 2 -



                     Documentation for CUI Database System


                                  INTRODUCTION

    I am not a career programmer.  I am an end user who enjoys tinkering and
    simulating features found in commercial software without having seen the
    source code.  Although some would say that Model 4 BASIC is a rather
    crude language I have explored several of its features and would now
    like to share some of the techniques I've developed over the past 2-3
    years.
    The two main programs are for data entry and writing reports.  I wanted
    something more sophisticated than a mailing list so I could maintain
    subscription expiration dates, record and tape libraries, etc. with some
    sorting and search capability.
    Once I had the two main programs, I needed support utilities, and then I
    added game programs, accounting programs and non-standard reports by
    expanding the menu system and calling all programs with CHAINS instead
    of loading each one separately.  (Of these, only the support utilities
    are included).
    What all this is leading up to is that you have the choice of using some
    or all of the programs included as they are, modifying the features you
    don't like and adding new programs of your own choosing to the existing
    menu structure.  I'd be interested to find out if anyone finds these
    programs useful besides me.  You can leave me a message here in the LDOS
    forum or on EasyPlex (70701,2373).  Thanks for your interest.




























                                        
                                   - Page 3 -







                                GETTING STARTED

    The first prerequisite is that you have a copy of BSORT/CMD from
    Misosys.  I have based all of the sorting on this sort program and some
    amount of rewriting will be involved if you want to use a different sort
    program.  I chose BSORT because it can be called from within a BASIC
    program and will return to the next BASIC statement when sorting is
    complete.
    Next, you need to decide on your storage media.  I have two single-sided
    5-1/4" floppies, so the configuration I had in mind was putting the
    programs on drive 0 and the data files on drive 1.  You can switch
    programs to perform new operations on the same data disk or swap data
    disks to work on new files.  If I had a hard drive, my choice would be
    to use it for the programs.  Since I had limited room on the program
    disks I had to break up the main programs and the file utilities.   For
    this reason there are several copies of MENU01, each of which specifies
    which programs it controls.  I've ARCHIVEd the programs the way they are
    organized on my disks.  If you transfer all of them to a hard disk, keep
    one copy of MENU01 and modify it so that all menu choices are available,
    and remove the prompt for inserting a new floppy in drive 0.  You should
    also modify other prompts throughout the system when using the <F5>
    key.
    Finally, see MENU/DOC for menu orientation.  I will refer to the
    programs by name, but it's pretty easy to figure out that FIL01 refers
    to the first menu selection in Format File Maintenance.



























                                        
                                   - Page 4 -



                     Documentation for CUI Database System


                                  INSTALLATION

    MGT01 - CHANGE PASSWORDS

    User numbers 1-6 have higher program access ability than user numbers
    above 10.  Certain functions shouldn't be accessed except under rare
    circumstances and can do some damage if used improperly.  These programs
    are designated by a (P) following the menu selection description, e.g.
          07 - MANAGEMENT FUNCITONS (P)
    User numbers 11-89 may be assigned with this program if you have several
    operators.  The password for user 11 is initially set to DEMO.  There
    should be a copy of the password file on all program disks (drive 0). 
    If you change a password, remember to change it on all program disks or
    use LS-DOS to copy the password file to each of your disks.
    When a priority access level is desired type user number 99.  Instead of
    the usual INVALID USER NUMBER error, the password prompt will appear. 
    Type anything to force an error message.  Notice that the INVALID USER
    NUMBER is followed by a three-digit number.  The last digit of this
    number tells you which priority password to type when you enter user
    number 55 again.  I have programmed a rotation of 6 priority passwords
    but you may increase this number to as high as 9.  When the cycle has
    finished (101,102,103,104,105,106) start over with the first password
    again (111,112,113,114,115,116).  The priority passwords have been
    initially set to AAA,BBB,CCC,DDD,EEE, and FFF.  Because of the
    encrypting subroutine I have allowed only capital letters for now.  If
    you try to read the password file from LS-DOS or scroll through the file
    with a standard BASIC random access routine, the passwords will be
    scrambled enough for most non-commercial purposes.

    FIL01 - INSTALL A DATA DISK (P)

    This program will set up a Format File Directory, a Report Parameter
    format file, and a Sort Parameter format file on a blank formatted
    disk.

    FIL02 - CREATE/REORDER A FORMAT FILE (P)

    This program is the heart of the C.U.I. Database System.  It builds the
    Format File for a random access data file.  The parameters requested are
    number of fields (and order of fields if reordering an existing file),
    field lengths and descriptions, and sort parameters.  If this file is to
    be used with the C.U.I. Database System, you should indicate that at
    this time so it will be included in the Format File Directory.  If you
    are simply maintaining a record of the file layout but already have a
    customized data entry program for a specific data file, indicate that
    this file is NOT a C.U.I. file.
                                        
                                   - Page 5 -







    There are 3 strict conventions.  First, you must reserve Field 1 of
    every CUI file as a one-character record status indicator (active or
    deleted).  Second, the most important search field should be Field 2. 
    Finally, there is a maximum of nine fields per record.  Because of the
    first restriction you are effectively limited to 8 fields, not 9.
    If you find you've made a mistake in setting up the file initially,
    don't panic.  By re-running this program you can change the order of the
    fields.  You can change their lengths with the FIL03 program.  Your data
    file will be copied with old fields intact, deleted fields excluded and
    new fields initialized with blanks.












































                                        
                                   - Page 6 -



                     Documentation for CUI Database System


    DAT01 - DATA ENTRY

    This will probably be the most frequently used program in the package. 
    A list of C.U.I. files available on drive 1 will be displayed.  If you
    don't see the file you are looking for, just ask to redisplay the file
    directory; you will be prompted to swap data disks and then see the
    files available on the new disk.
    After making your selection, a rundown of file statistics will appear to
    familiarize you with the fields available, the number of active and
    total records in the file and the date of last modification (maintained
    by CUI, NOT by LS-DOS!).  After you press <ENTER>, the first active
    record in the file will be displayed.  You may scroll backwards and
    forwards through the active records; add new records (which will be
    included in the scrolling capability); delete records (which will be
    removed from scroll viewing); change fields in active records; search
    for specific matches on any field; and re-sort the file by its main sort
    key.  If you need help in remembering which commands and function keys
    do what, just type H for Help screens.  You can even review the file
    information you saw when you opened the file with the new modification
    date and current number of total and active records.
    This program should maintain up to 200 records with a 25 character key
    search field with no trouble.  If you want more records or a longer key
    search field, you'll have to experiment.  Before I increased my memory
    to 128K, I had trouble with larger files.  The capacity may increase if
    you move some /SYS files to MEMDISK.
    If you find there are too many deleted records wasting space in a file,
    use the Random File Map/Cleaner (UTL02) which will rewrite and sort the
    file without the deleted records.























                                        
                                   - Page 7 -







    DAT02 - REPORT DESIGNER

    Now that you have data entered, you probably want to view it, right? 
    This program will display a list of available reports and ask if you
    want to print one of them or create a new one.  If you don't see the
    report you're looking for, you can swap disks and re-display the new
    menu just like in DAT01.  To create a new report, pick a data file and
    enter the numbers of the fields you want to print in the order you want
    to print them.  If you make a mistake, clear the headings and start
    over.  If the report runs more than 80 columns wide, the data fields
    will be listed horizontally rather than vertically.  Here is an example
    of each format:
          name    address         city
          Alan    267 Evergreen   Bloomingdale
                                  or
          name..... Alan
          address.. 267 Evergreen
          city..... Bloomingdale
    After the fields are selected, you should decide on the sorting order. 
    You are allowed a maximum of 3 sort fields.  Your next decision is
    whether to print a hardcopy or not.  If you print the report on your
    screen, the report will pause at the end of each screen until you type
    <ENTER>.  When the report is complete you have the option of saving the
    field and sort parameters.  After the parameters are saved, the report
    will be displayed on the menu the next time you run this program.
    Once report parameters have been stored you can print the standard
    version at any time.  However, if you want to include or exclude fields
    or change the sorting order, you have those options, too.  It might be
    useful to change the parameters if you want to include different fields
    but don't want to create and save a whole new report.  After printing
    you can save the new parameters, or you can exit and the existing
    parameters will remain intact.

    FIL03 - CHANGE/DELETE A FORMAT FILE (P)

    From time to time you may find that you want to include a new field in a
    data file or you need to expand the size of a field (converting to
    9-digit zip codes perhaps).  Rather than create a new file and re-enter
    all of your existing data you can use this program to change the field
    length or description and have CUI do all of the work.  I've found this
    to be a great time-saver on more than one occasion.

    Well, good luck!  If you need any help or something doesn't seem to be
    working just right, please drop me a line.  Have fun exploring the other
    programs which aren't documented.  That's the best way to learn about
    most software - after making a backup copy just beat on it until it
    blows up.
                                        
                                   - Page 8 -



                     Documentation for CUI Database System


                                 RELEASE NOTES
    Version 1.01
    DAT01 - DATA ENTRY
    Data buffer 5, the Format File Directory, was not being closed before
    chaining to a new program <F5> or before chaining to the sort routine.
    Consequently there would be intermittent errors trying to run the Report
    Designer immediately after using Data Entry.  This has now been
    corrected.

    UTL01 - FILE LIBRARY
    This is the BASIC disk cataloging program.  The prompts and help
    messages have been re-worked to clarify what information is expected
    from the user.  This program maintains the filename portion of the data
    file.  You can also use DAT01 to maintain the attributes portion of the
    data file.  (One possible use of the attributes is to track various
    stages of development throughout your programming library, for example
    if your adding a particular subroutine to all of your programs.)



































                                        
                                   - Page 9 -

