[comp.databases] IRW Specifications

Steven_Edward_Skindell@cup.portal.com (10/21/88)

Intelligent Report Writer (C) Copyright 1985

INTELLIGENT REPORT WRITER

By Steven Edward Skindell, M.A.
Version 1.05 Copyright (C) 1985
108 Ruffin Road *  Summerville, SC 29483
(803) 821-0855

NOTE : PLEASE READ THE README.1ST FILE FOR INFORMATION REGARDING REGISTRATION AND ANY UPDATE/CHANGES


TABLE OF CONTENTS

INTRODUCTION
SYSTEM REQUIREMENTS
DATABASE FEATURES
INSTALLATION FOR A HARD DISK SYSTEM
GETTING STARTED WITH THE INTELLIGENT REPORT WRITER
CREATING A SAMPLE DATABASE
KEY FIELDS EXPAINED
ADDING THE NEW RECORD TO DISK
EDITING A RECORD ON DISK
DATA DICTIONARY EXPLAINED 
SEARCHING & PRINTING RECORDS
SELECTING SEARCH ATTRIBUTES
	SEARCHES EXPLAINED
		Instring equal
		String greater than or equal to
		String less than or equal to
		Number equal to
		Number greater than
		Number less than
		Date equal to
		Date greater than or equal to
		Date less than or equal to
		multiple instring
		Forced multiple instring
		NOT instring
		Multiple NOT instring
	     Dates between  MM/DD/YY-MM/DD/YY
		Soundex Code
QUEUE FILES EXPLAINED (the search hopper)
EQUATIONS EXPLAINED
CREATING INTELLIGENT REPORT WRITER DOCUMENTS
ANALYSIS OF SAMPLE.DOC
INSERTING TEXT USING OTHER DOCUMENT FILES AS INPUT
GLOBAL REPLACEMENT
MULTIPLE CHOICES
INSERTING A FILE
INSERT THE COMPUTER DATE INTO A DOCUMENT
INSERT THE COMPUTER TIME INTO A DOCUMENT
INSERTING TEXT BASED ON SELECTION FROM A MINI-DATABASE
INSERTING TEXT FROM LIBRARY SECTIONS
INSERT DATA FROM THE DATABASE MANAGER
INSERT SELECTED TEXT DEPENDING ON WHAT IS IN THE DATABASE
INSERT TEXT FROM DISK DEPENDING ON WHAT IS IN THE DATABASE
FIGURING OUT AGE IN YEARS
LOOKUP AND INSERT A PARAGRAPH FROM A TABLE
USER COMMANDS
CALCULATIONS WITHIN THE DOCUMENT
SETTING A NUMERIC VARIABLE FROM A CALCULATION
SETTING A NUMERIC VARIABLE FROM THE KEYBOARD
SETTING A NUMERIC VARIABLE USING DATA FROM A RECORD
IF-THEN-ELSE INSERTING TEXT BASED ON VARIABLES
INSERTING A NUMERIC VARIABLE INTO THE DOCUMENT
SETTING CHARACTER VARIABLES
SETTING FIELD DATA WITH CHARACTER VARIABLE TEXT
INSERTING A CHARACTER VARIABLE IN THE DOCUMENT
INPUT FIELD DATA FROM THE KEYBOARD
SETTING A CHARACTER VARIABLE FROM THE KEYBOARD
SAVING FIELD DATA BACK INTO A RECORD


INTRODUCTION

Welcome to the Intelligent Report Writer! The Intelligent Report Writer was designed for you -- the professional who writes a report on regular basis.

Most of the data in scheduled reports usually remain the same from one report to the next. For example, in a psychological report most of the identifying information is unchanged from year to year. Items such as gender, date of birth, address, city, zip code, guardianship and  phone number. By learning to use the tools provided in the Intelligent Report Writer you can by-pass many duplicate clerical tasks.

You are freed to do more of the things you were trained to do (rather than paperwork).

The Intelligent Report Writer System includes three integrated modules: the Template Editor (to create and edit document templates), the Database Manager (a full featured data base management system that includes powerful search routines) and the Intelligent Report Writer (the module that uses the database information and interacts with the report template to turn your template into one that actually comes alive and writes information itself!).

The Intelligent Report Writer has been under development on various computers for the past 8 years.


SYSTEM REQUIREMENTS

	* IBM-PC/XT/AT or Compatible
	* MSDOS/PCDOS 2.10 or higher
	* 640K RAM
	* Color or Monochrome Monitor
	* 1 Floppy Disk Drive
	* 1 Hard Disk Drive
	* Printer


INTELLIGENT REPORT WRITER FEATURES

     * Each record can be up to 64K characters long.
     * A database file can consist of 4 gigabytes of
       information.
     * Deleted records are re-allocated when new records are
       added.
     * The number of records is limited only by your disk
       space.
     * Up to 72 fields can be assigned per database.
     * You can access your records by using up to 24
       different keys.
     * All keys are automatically maintained when inserted
       or updated.
     * You can have duplicate, modifiable and segmented keys
       assigned.
     * Records can be found by any key assigned.
     * Key Fields can be segmented to include other fields.
     * Each database can include up to 24 key fields.
     * All keys are automatically maintained when inserted
       or updated.
     * Finding a record by any key is extremely fast.
     * Key fields can be specified to be a combination of
       unique, duplicate and/or modifiable.
     * Records can be printed by any key.
     * Records can be searched by sophisticated search
       attributes (up to 72 at one time).
     * Equations can be designed to calculate using
       constants and fields.
     * A calculator can be called up at any time
     * Paragraphs of information can be inserted based on
       the data.
     * A data dictionary can be called up that will allow
       the operator to insert pre-written paragraphs of
       information into the record.
     * After a template is executed (using the current
       record the report can be appended or modified before
       it is printed out to the screen or printer.


GETTING STARTED WITH THE INTELLIGENT REPORT WRITER

You are now ready to run the Intelligent Report Writer System. To do this type IRW at the command line and press ENTER.  

The Intelligent Report Writer logo appears on your screen for a few seconds...and is followed by the Database screen.

The database screen is where you edit and add records of information. A record is similar to a folder that contains information on a piece of paper inside the folder. On the piece of paper contains a number of different lines on it. On each line contains a different piece of information (such as a mailing address card with a Name, Address, City, State and Zip Code). A database is nothing more than a collection of many different folders (records).

A phone directory is a good example of a database of information.

Now the difference between a phone directory database and an electronic computer database is that rather than manually flipping through pages and pages of folders (records) trying to find a certain address you instead supply the Intelligent Report Writer with a key piece of information and let the computer find the folder for you.

You will notice that there are two sample databases included. One is a Psychological Report Writer database that is currently being used in a Mental Retardation Facility and the other is a way to write mulitple inquiry letters to prospective employers. To run a Psychological Report press the letter r and move the cursor bar on the file "PSYCHDB" and press ENTER. Many Intelligent Report Writer Commands are included in the PSYCHDB template.


CREATING A SAMPLE DATABASE

You are now going to create a database that will include the following pieces of information: Company, Address, City, Zip Code, and a Comment. It is intended to get you familiar with the most commonly used commands of your Intelligent Report Writer System.

At the initial Database Screen press Function Key F2 to bring up the Main Menu. Move the cursor bar using the up and down arrow keys until the option "ADD DATABASE" is highlighted. Now select the "ADD DATABASE" option by pressing the ENTER key.

After selecting the ADD DATABASE option the module to create a new database will be run. The following menu will now appear on your screen

         +-----------------------------------------+
	    |1 = Create, 2 = Edit, 3 = Abort ?        |
         +-----------------------------------------+

Since you are creating a new database press option 1.

At the following prompt type in a valid PC/MSDOS filename and press ENTER.

		Esc)abort  .. Filename: Address <ENTER>

NOTE: At this point if you want to abort press the Esc key.

Notice the following field definition screen. This allows you to define each piece of information in the folder. You will also define the order of the information on the page in the folder (on what line the information is going to occur).


	Is this field going to use a Data Dictionary? (y/n)

	DIC FIELD  TYPE LENGTH  PRINTER LABEL KEY D M SG

If you are creating a real database application it would first be wise at this point to determine on a piece of paper the specifications of the information you want to include in your database folder.

In the example database you are creating the first piece of information you want to include in each record is the COMPANY name. The COMPANY name specification will be entered first.

Before you enter information specifications first let us first explain about the editing commands that may make this task a little easier for you.

The up and down direction keys move the cursor from one line to the next.
The TAB key or ENTER move to the next field within a line.
The SHIFT TAB key moves the cursor to the previous field within a line.

Enter if the field is going to allocate a dictionary file on disk for frequent duplicate entries, then type the field name, the field type, the field length and finally the input prompt or instruction that will be displayed on the screen when data is being added or edited for the field.

----- Example -----

DIC FIELD   TYPE LENGTH PRINTER LABEL  KEY D M SG SG

n   Company c     25     Client Name   y   y y 
Please type Company name

n   Address c     25     Address
Please type in Address.

y   City    c     15     City
Please type in City.

n   State   c     15     State
Please type in the State.

n   Zip     i      9     Zip Code
Please type in the Zip.

n   Comment c    160     Up-Date
Enter the Comment below.

Next, type in the sample database specifications  exactly as shown above.


KEYS FIELDS EXPLAINED

Up to 24 fields can be assigned as key fields. You assign a field as a key by placing a y (for yes) under the KEY label. If the key field allows duplicates then y (for yes) is placed under the D label. If the key is modifiable (allowed to be changed) then y (for yes) is placed under the M label. Each field added as a segment must be subtracted from the 24 fields that can be designated as a key.

If you want to assign a key to a field that includes segments of other fields then place the field number of the segment field you want to include under the next SG label. For example, if you want to keep a key sorted by state and then by city place number 4 next to the first segment in the State field


DIC FIELD   TYPE LENGTH PRINTER LABEL  KEY D M SG SG

n   State   c     15     State          y  y y  4
Please type in the State.


In addition, if the zip code is to be included as a segment with the City segment then number 6 (for the zip code field) would appear next to the City segment SG.


DIC FIELD   TYPE LENGTH PRINTER LABEL  KEY D M SG SG

n   State   c     15     State          y  y  y 4  6
Please type in the State.

If you reach the end of a edit field you will notice that the cursor advances on the the next item.

A option menu appears at the bottom of the screen when the Esc key is pressed or you reach the last field on the screen
 
		----- Example ------

		(s)tat  (p)revious   (n)ext   (c)reate  (e)dit   (a)bort   

p = to ENTER to a previous screen of fields press p for previous.

n = to advance to the next screen to add more fields press n for next.

c = to create the database press c for create.

e = to ENTER and edit the current screen of fields press e for edit.

a = to abort adding a database and ENTER to the Database initial screen.


After pressing c for create the database is created.

You are next prompted to decide if you want to add the records now

     +-------------------------------------------+
     |	DO YOU WANT TO ADD RECORDS NOW? (y/n)  |
     +-------------------------------------------+

Press y for yes or n for no.

If you decide to add records at this point the initial Database Screen will appear with the defined fields displayed.


DATABASE EDITING COMMAND

	F1 Displays the Help Menu

	Esc Aborts any editing and ENTERs text to its original
	    form.

	Up Arrow Moves cursor up one line.

	Down Arrow Moves cursor down one line.

	Ctrl-t Deletes the word the cursor is on. Must be
     starting character of word to delete.

	Up Arrow Moves cursor up one line.

	Down Arrow Moves cursor down one line.

	Ctrl-End Deletes text from the cursor to the end of the
              field.

	Ctrl Right Arrow Moves cursor to the next word.

	Ctrl Left Arrow Moves cursor to the previous word.

	F2 Loads and then displays the data dictionary

	F3 Inserts the current computer date into the field.

	F5 The first press of F5 selects the starting point to
        cut. The second press of F5 selects the ending point
        to cut. The arrow keys are used to position the
        cursor to the starting and ending points to cut.

	F6 pastes text at cursor (text that was cut using F5).
        This can be a useful feature if you are adding
        information into many different
	   records.

	F10 Writes the record to disk

	Home Cursor jumps to the beginning point in the field.

	End Cursor jumps to the ending point in the field.

	Ins Insert mode toggle. The cursor is large when the
         insert mode is on and small when the insert mode is
         off.

	Del Deletes character under cursor. Can be used when
         insert mode is on or off.

	ENTER Ends editing and ENTERs edited text back to data
           field.

DATA DICTIONARY EXPLAINED 

A Data Dictionary is initialized for every field specified to use a data dictionary at the time the database is created. The data dictionary has two purposes: 1) to allow rapid input of data into a data field; and 2) to allow for searching consistant data across records.

For example, in the sample database you may find that 40 % of the records entered have the City name Pontiac. Instead of typing in Pontiac each time you select Pontiac from the Data Dictionary Menu by moving the cursor bar on the option "Pontiac" and pressing ENTER. The information Pontiac is entered into the data field for you ... you do not have to type out Pontiac. This is a savings in time when you use the data dictionary to insert standard paragraphs of text into the data field.

Each option in an individual data dictionary is limited to the length allowed for the data field.

You can quickly move the cursor bar on a data dictionary option by pressing the first letter of the option you want to insert. For example, to move the cursor bar onto David press the letter D.

		+-----------------+
		|	Cindy        |
		|	David        |
		|	Mark         |
		|	Jim Jones    |
		+-----------------+

PgUp and PgDn keys will scroll the options in the data dictionary by page. Pressing the Home key will bring the cursor bar on the first option. Pressing the End key will place the cursor bar on the last o

SEARCHING & PRINTING RECORDS

To specify the fields to print move the highlighted cursor on Fields to Print and press ENTER.

Database: FILEX		Print: 0		Search: 0

		Fields to Print
		Search Attributes
		Forward Ordered Search
		Reverse Ordered Search
		List Queue Files
		Execute Queue
		Delete Queue Files
		Select Key Field
		Clear
		Quit

The following screen appears

		a (01) Name		:
		b (02) Address		:
		c (03) City		:
		d (04) State		:
		e (05) Zip		:
		f				:
		g				:
		h				:
		i				:
		j				:
		k				:
		l				:
	
		Total Length = 0
		Esc)end	x)clear	... Select Print Field? (a-l)


Select the data fields that you want printed by pressing the lower case letters next to each field.

After selecting each field you will notice that next to each field descriptor selected appears an "X". Notice that next to the prompt "Total Selected:" appears the total number of fields selected.

When all fields to be printed have been selected press the Esc key. The previous Search & Print Main Menu appears.

Command Summary
	Esc = ends and exits to the previous menu.

	x = clears the current fields selected and start the process over
	    again.

	a-l = select the field to print.



SELECTING SEARCH ATTRIBUTES

This function allows you to find only specific records to include in a print-out.

Move the highlighted cursor bar on Selecting Search Attributes and press ENTER.


Database: FILEX		Print: 0		Search: 0

		Enter Fields to Print
		Enter Search Attributes
		Forward Ordered Search
		Reverse Ordered Search
		List Queue Files
		Execute Queue
		Delete Queue Files
		Select Key Field
		Clear
		Quit

 
The following display appears and is similar to the print selection display


	a (01) Name		:
	b (02) Address		:
	c (03) City		:
	d (04) State		:
	e (05) Zip		:
	f				:
	g				:
	h				:
	i				:
	j				:
	k				:
	l				:
	
	Total Selected = 0
	Esc)end	x)clear	... Select Search  Field? (a-l)


Command Summary
	Esc = ends and returns to the previous menu

	x = clears the current fields selected and start the process over
	    again

	a-l = select the field to search on


To enter search criteria select the lower case letter next to the field you want to search (do not press ENTER)


	a (01) Name		:
	b (02) Address		:
	c (03) City		:
	d (04) State		:
	e (05) Zip		:
	f				:
	g				:
	h				:
	i				:
	j				:
	k				:
	l				:
	
	Total Selected = 0
	Esc)end	x)clear	... Select Search  Field? (a-l) c

For example, to print only a certain city you would press the lower case letter c. After you have selected the field to search by the following search attribute menu appears with the options of search attributes. A particular type of search attribute can be specified by pressing the lower case letter that is to the left of the desired type or by placing the cursor bar on the desired type using the direction keys and pressing ENTER.


	TYPE OF SEARCH ATTRIBUTE
	Instring equal
	String greater than or equal to
	String less than or equal to
	Number equal to
	Number greater than
	Number less than
	Date equal to
	Date greater than or equal to
	Date less than or equal to
	Multiple instring
	Forced multiple instring
	NOT instring
	Multiple NOT instring
     Dates between  MM/DD/YY-MM/DD/YY
	Soundex Code


INTELLIGENT REPORT WRITER SEARCH TYPES EXPLAINED

One of the important features of the Intelligent Report Writer is the ability to do sophisticated "mainframe type" searches. Attributes of search criteria can be entered and stored in a queue (hopper) file and then all searches can be executed at one time.

Below are the types of searches that can be specified:

Instring search: The instring search looks for contiguous characters, numbers or combinations of characters and numbers that occur side by side. For example, you could search for specific area codes in a telephone number such as


		(313) 422-1818


in this case you would enter (313).

Another example of the instring search would be searching other types of codes in which the positions of the numbers mean something such as the code 05-10.17. You can search all codes that have -10.17 in the last five digits by simply entering 10.17 and pressing the ENTER key. If you wanted to locate all parts that had 05 in the first two digits you can accomplish this by simply entering 05- and then pressing ENTER. Or, say you want to find parts that have digits 10 in the middle, you can locate them by en






tering -10. and then pressing ENTER.

String greater than or equal to: This is an alphabetic or alphanumeric type of search that is useful when looking at strings that are greater than or equal to the string that is specified.

It is important to keep in mind that in this type of search the search always starts on the left and proceeds to the right. Thus, if alphabetic or alphanumeric strings are used, the search module always starts at the first position on the left and then proceeds to the right.

While this can be quite useful in searching through alphabetized lists, it can also be used when searching through complex alphanumeric codes such as those used to identify account numbers on utility bills.

A unique feature of this field type is the manner in which it treats upper and lower case letters. Lower case letters are assigned values greater than upper case letters - and consequently, when the search encounters two letters, say an upper case D and a lower case d, it assigns a greater value to the lower case d than the upper case D.

String less than or equal to: This type of search is actually the opposite of the preceding search type. It will look for alphanumeric strings or codes that are less than the string or code that was entered. Remember though this type of search begins on the left and proceeds to the right in any given string or alphanumeric string. Remember too, that lower case letters are assigned a greater value than upper case letters.

Number equal to: This type of search only looks at numbers that are equal to the entered value. This type of search can accommodate decimals.

Number greater than: This type of search looks at only numbers and not combinations of numbers and non-numeric characters. This type of search can accommodate decimals.

Number less than: This type of search looks for numbers that are less than (and not including) the entered value. This type of search can accommodate decimals.

Date equal to: Although this is self explanatory, please keep in mind that the search module looks at dates in the MM/DD/YY format - consequently, if you are searching something that is less than or equal to March 5, 1989, you must enter 03/05/89.

Date greater than or equal to: Although this is self explanatory, please keep in mind that the search module looks at dates in the MM/DD/YY format.

Date less than or equal to: Although this is self explanatory, please keep in mind that the search module looks at dates in the MM/DD/YY format.

Multiple instring: This is a very powerful multiple alphanumeric instring search, since it allows you to search for more than one instring at a time (separated by commas) according to an "either or" logic.

This type of search will look for information in any order - and in effect says "give me any or all combinations of the following parameters:...".

Forced multiple instring: This type of search allows you to look for different strings that not only match in terms of content, but match in terms of order as well. For example, if you were looking for years that had cold, dry, windy weather, you would use this type of search.

NOT instring: This too is a very powerful alphanumeric instring search that allows you to reject a record if any portion of the string that you have typed in matches the comparison field. Thus, if you use this search type and in effect say "not Smith" it will reject any combination of Smith such as BlackSmith, Smithsfield, Gun Smith, Smithski, Dear Smith, etc.

Multiple NOT instring: This type of search allows you to enter multiple alpha-numeric strings (separated by commas) that you do not want to occur in your record in any way, shape or form. Not only does this allow you to take a negative "and/or" logic, it saves the user from doing multiple searches and sorts.

Dates between two dates: This type of search allows you to enter a range of time from one date to another date. For example, to search for all dates between 11/15/80 to 11/15/85 the following would be entered:

			11/15/80-11/15/85

All dates between 11/15/80 and 11/15/85 would meet criteria for this type of search (including the dates 11/15/80 and 11/15/85).

Soundex Code: This Soundex Code was developed during World War II and is still being used in major computer applications today. The advantage of this type of search is that it allows you to enter a word or phrase and then search through the database finding all records that sound like the word entered. For example, if you want to search for words that sounded like "Joice" the following would be entered:

			Joyce

The way Soundex works is like this: all letters are first converted to upper case then the first letter of the word is maintained. Next, all vowels are removed (A,E,I,O,U). The remaining characters (except for the first letter) is translated into a code number based on the following translation table:

        B F P V              1
        C G J K Q S X Z      2
        D T                  3
        L                    4
        M N                  5
        R                    6

If the resulting Soundex code contains any repeating numbers then one of the numbers is removed -- this process continues until there are no repeating numbers.

For example, the word "Joyce" would produce the Soundex Code

		J2

Select the search type desired for the field selected by moving the cursor bar using the direction key on the desired option and pressing ENTER.


	TYPE OF SEARCH ATTRIBUTE
	Instring equal
	String greater than or equal to
	String less than or equal to
	Number equal to
	Number greater than
	Number less than
	Date equal to
	Date greater than or equal to
	Date less than or equal to
	Multiple instring
	Forced multiple instring
	NOT instring
	Multiple NOT instring
     Dates between  MM/DD/YY-MM/DD/YY
	Soundex Code


Next, type in the search attribute(s) desired:


		Attribute: Pontiac,Troy,Davison


and press ENTER.

For the example above, because it is a multiple instring type of search, we are requesting in the attribute that if any one of the cities specified in the city field of a record matches then either go on and look at the next search attribute or print the record. If "Pontiac" or "Troy" or "Davison" is in the field of the record looked at then it meets the criteria of the current attribute specified (only the fields that are specified to be printed) print-out.


	a (01) Name		:
	b (02) Address		:
	c (03) City		: Multiple Pontiac,Troy,Davison
	d (04) State		:
	e (05) Zip		:
	f				:
	g				:
	h				:
	i				:
	j				:
	k				:
	l				:
	
	Current Selected: 3
	Total Selected = 1
	Esc)end	x)clear	... Select Search  Field? (a-l)

Notice that after entering the search attribute the search field selection screen has updated the "Current Selected:" information and the "Total Selected:" counter.

Continue the above process until you have specified all search information.

When you are finished press Esc.
 
Notice that the search menu appears


Database: FILEX		Print: 3		Search: 1

		Enter Fields to Print
		Enter Search Attributes
		Forward Ordered Search
		Reverse Ordered Search
		List Queue Files
		Execute Queue
		Delete Queue Files
		Select Key Field
		Clear
		Quit


You will notice in the search menu that the "No Fields Selected to Search" counter has been updated to show how many search attributes have been selected.

You are now ready to go on and actually do the search.

There are 2 different orders a search can take. One is reverse order and is specified by selecting Reverse Order Search at the search menu. The other is a forward order and is specified by selecting Forward Order Search at the search menu.

To select the order of search move the highlighted bar using the up and down arrow keys on the desired option and press ENTER.

The forward order means records are searched and printed (if matched) from the lowest key to the highest key ordered in the database. The key is the same one that is currently being used to find records in the database.

The reverse order means records are searched and printed (if matched) from the highest key to the lowest key ordered in the database. The key is the same one that is currently being used to find records in the database.

You are now asked if you want to store the search and print specifications in a queue.


		Store in Queue? (y/n) y


The queue allows you to enter multiple searches (with different print formats and search attributes) for immediate or future use. By pressing y at this prompt you will be asked to give the queue a filename.


		Queue Filename: Hop1 <ENTER>


QUEUE FILES EXPAINED

If the queue is specified then the search information will be placed in a queue storage file. You can now enter a new set of different search attributes and print formats to place in another queue storage file. To execute all the queue storage files move the cursor bar using the direction keys on "Execute Queue" and press ENTER


Database: FILEX		Print: 3		Search: 1

		Enter Fields to Print
		Enter Search Attributes
		Forward Ordered Search
		Reverse Ordered Search
		List Queue Files
		Execute Queue
		Delete Queue Files
		Select Key Field
		Clear
		Quit


After all queue file have been executed the search menu re-appears.
  
All the files in the queue can be viewed by moving the highlighted cursor bar on the option List Queue Files.

Database: FILEX		Print: 0		Search: 0

		Enter Fields to Print
		Enter Search Attributes
		Forward Ordered Search
		Reverse Ordered Search
		List Queue Files
		Execute Queue
		Delete Queue Files
		Select Key Field
		Clear
		Quit


After selecting the option "List Queue Files" the Queue File menu appears

		+------------------------+
		| Hop1                   |
		| Hop2                   |
		| Hop3                   |
		+------------------------+


Notice in the above example there are three searches.

To execute one of these searches move the cursor bar using the direction keys over the desired option and press ENTER. To abort and return to the previous menu press the Esc key.

After deciding if you want to save the search in a queue file determine the type of output by moving the cursor bar using the direction arrow keys over the option and pressing ENTER
 

		printer    screen


Most of the optional prompts explained below are for printer and display output parameters only.

If printer output is selected you will are prompted to select the length mode to send to your printer. Place the cursor bar over the option using the right and left arrow keys and pressing ENTER


		Normal (80 char)     Compressed (131 char)


Printer codes are sent to the printer to put the printer in normal character mode or to put the printer in compressed character mode.

The heading appears at the top of every printed page.


		Title Heading? All birth dates > 02-15-86 <ENTER>


If a reverse order is specified then the order of the print-out will be descending order based on the current key specified. If a forward order is specified then the order of the print-out will be ascending order.

If the queue is not specified the database will be searched and the matched records will be output to the device specified. If the queue is specified then the search menu will re-appear. Press l to look at all the filenames in the queue. Select the specific search to execute by pressing the lower case letter next to the queue filename.
 


EQUATIONS EXPLAINED

The Database Manager allows 12 equations per database. Equations of a record are calculated by pressing F7 when adding/editing a record. Equations can contain values from data fields and constants.

Before you begin creating equations you should have a list on paper of exactly what fields you want to be involved in each equation.

To create or edit equations first press F2 to get to the Main Menu. At the Main Menu move the cursor bar on UTILITIES and press ENTER. At the UTILITIES MENU move the cursor bar on Equations and press ENTER.

On your screen appears 20 slots for 20 equations. Start adding equations in consecutive order (i.e., 1 then 2 then 3 etc...) until all the equations are entered. To do this, first type in the number of the slot you want to put an equation in (or change the equation in the slot) and press ENTER.


	NO EQUATIONS = 0
	 1
	 2
	 3
	 4
	 5
	 6
	 7
 	 8
	 9
	10
	11
	12
	13
	14
	15
	16
	17
	18
	19
	20
Esc quit  F10 Save   ... Edit Equation Number? 1 <ENTER>

 
Next, type in the equation


			F3=F1+F2*100 <ENTER>


and press ENTER.

To the left of the equal sign (=) is the field that the result of the equation gets stored into after computation. It starts out with the lower case letter F followed by the field number. In the example above F3 is used for field 3.

To the right of the equal sign = is the equation. The operators can include addition +, subtraction -, division / and multiplication *.

Remember to store the results of calculation into a data field.

You can use parenthesis in your equations to force a part of the equation to be evaluated first. For example, in the equation


			F1=2/(F2*F3)


the parenthesis around (F2*F3) forces the value in field F2 to be multiplied times the value in field F3 before that result is divided into the value 2. You can use as many parenthesis as you like but remember, that the equation must be balanced -- for every left parenthesis ( there must be a corresponding right parenthesis ).


CREATING INTELLIGENT REPORT WRITER DOCUMENTS

At the Database initial screen press F2 to bring up the Main Menu. At the Main Menu move the cursor bar on UTILITIES MENU and press ENTER. At the UTILITIES MENU move the cursor bar on ADD DOCUMENT and press ENTER.

Type in a valid PC-DOS filename to the prompt

		Filename:

and press ENTER.

Notice your drives will come on and the Text Editor appears.


	----- Example -----

My name is [What is your name?SHORT 25] and I live on [Your street
address?SHORT 25] in [Your city?SHORT 15], [The name of your
State?SHORT 15].

NOTE: To save the above text press the F10 function key.

Move the highlighted cursor bar on Quit and press ENTER. The Database Screen will re-appear.

To execute the document SAMPLE.DOC press F3 at the Database initial screen.

Move the highlighted cursor bar on SAMPLE.DOC and press ENTER.

Since you have just begun using this program there are no other files in the menu except SAMPLE.DOC so just press ENTER.

Select from the next menu how you want the results of the interactive document to be output. Move the highlighted cursor on the option and press ENTER.

			Abort
			Comm Port
			Disk
			Printer
			Screen


For our example here choose Screen.

The file SAMPLE.DOC will now be executed.

Next, enter the information requested from the executed SAMPLE.DOC file. Remember, press ENTER after each entry.


		  ----- Example -----

          What is your name? Steven Skindell <ENTER>

          What is your address? 29888 North Rd. <ENTER>

          Name of your city? Westland <ENTER>

          Name of your state? Michigan <ENTER>


When all the data has been entered the following text will be displayed on your screen


	----- Example -----

	My name is Steven Skindell and I live on 2888 North Rd.
     in Westland, Michigan.

You will now be back at the initial database screen.


ANALYSIS OF SAMPLE.DOC

NOTE: To edit a previous document with the text editor select the Editor option at the Database initial screen by holding down the ALT key and pressing e. Move the highlighted cursor bar on the option "Old Document" and press ENTER. Next, move the highlighted bar on the filename you want to edit "SAMPLE.DOC" and press ENTER ... the Editor will be run and the file will be loaded into memory.

When the document SAMPLE.DOC executes, the prompt that appears on the video screen is located between the left bracket [ and the ?].

	----- Example -----

	My name is [What is your name?SHORT 25] and I live on
     [Your street address?SHORT 25] in [Your city?SHORT 25],
     [Your State?SHORT 15].


Enter the word processor and make the following changes to the SAMPLE.DOC file. Change the question mark ? in the prompt "Name of your state?" to a colon :

Your text should look like this


		----- Example -----

          [Name of your state:] 

Move the cursor over to the right of state:] and insert 


		----- Example -----

          , {<Michigan><Ohio><Maine>} 


The document should now look like this

	----- Example -----

	My name is [What is your name?SHORT 25] and I live on
     [Your street address?SHORT 25] in [Your city?SHORT25]
     [The name of your State:], {<Michigan><Ohio><Maine>}


NOTE: When the above document is executed, the information between the < and > brackets are options. The option is selected at the keyboard by moving the cursor bar on the
desired option and press ENTER.

Save the revised SAMPLE.DOC text to disk and exit the text editor or word processor. Follow the steps listed below to execute the SAMPLE.DOC file:


1. You should first be at the Database initial screen.

2. Press F3 to execute the Intelligent Report Writer.

3. Select the SAMPLE.DOC from the Menu

4. Specify output to the screen.

5. Enter data to the questions about name, address and city. The mini-menu below appears on the screen with the 4 options to choose from regarding the persons state:


	   ----- Example -----

       	   	Name of your state:
          	Michigan
          	Ohio
          	Maine
          	KEYBOARD INPUT


Select an option by moving the highlighted cursor bar using the direction keys over the desired option and press ENTER. The selected text is then inserted into the document in the location where the prompt is. The prompt is then deleted from the document. For example, if you select the option "Ohio" then the text "Ohio" is inserted into the document.

If the KEYBOARD INPUT option is selected, you will be asked to type in the text to be inserted -- this is referred to as KEYBOARD INPUT -- what you type in at the keyboard is inserted into the text.

During KEYBOARD INPUT you will notice a window appear on your screen. You can type 8 lines of text. Pressing the ALT H keys displays a help window explaining all the commands available to edit the text you want to insert. Notice that as you type and get to the end of a line that the words that do not fit on the same line wrap-around to the next line. Pressing the ENTER key places a carriage ENTER at the end of the line you are on and brings the cursor down to the next line -- this allows you to format text






 the way you want it to look within your document. When you are finished editing the text for keyboard input press the Esc key.



INSERTING TEXT USING OTHER DOCUMENT FILES AS INPUT

When the \F command is placed after the either the question mark ? or the : next to a prompt, the data entered from the keyboard represents a filename on the disk. The entire text file is inserted into the document. This text file can also contain Intelligent Report Writer commands.

The following example demonstrates this.

Use your text editor or word processor and create the following files (save each one onto disk):



          FILE		TEXT TO ENTER FOR THE FILE
		--------  -----------------------------
          MICH 	Michigan -- the land of great lakes.
          OHIO		Ohio -- the buckeye state.
          MAINE	Maine -- land of snow crabs.


Next, edit the file SAMPLE.DOC so it looks like this

	----- Example -----

     My name is [What is your name?SHORT 25] and I live on
     [Your street address?SHORT 25] in [Your city?SHORT 25],
     [The name of your State:\F].{<Mich><Ohio><Maine>}


Save the modified SAMPLE.DOC file back to disk.

Execute the revised SAMPLE.DOC.

Type in your name, street and city to the prompts that follow. Next, select the filename of the information about the state that you want inserted into the text. This is done by typing the number 1-3 next to one of the states displayed and pressing ENTER (the state really represents a filename).

The text from file selected is now inserted into the document and all of the prompt (including file choices) are deleted from the text.

Enter the text editor or word processor again and change the SAMPLE.DOC file to look like this


	My name is [What is your name?SHORT 25] and I live on
     [Your street address?SHORT 25] in [Your city?SHORT 25],
     [The name of your State?\F].


Save the SAMPLE.DOC file to disk.

Execute the revised SAMPLE.DOC document. Type in the name of the file to insert into the document (i.e., type OHIO and press ENTER). Text from the file OHIO is inserted into the document and the prompts are deleted.


GLOBAL REPLACEMENT

The ?\R command is used to globally replace anything in the document with something input from the keyboard. The string to be searched and replaced follows the ?\R prompt. For example, using the prompt [NAME?\Rname], whenever and wherever "name" appears in the document will be replaced by what is entered from the keyboard.

For global replacement commands to function properly, it is important to place all ?\R commands at the end of the document file. This allows global replacements to be made after the entire document has been processed.



MULTIPLE CHOICES

The :\M command is used to insert multiple phrases into a document. The option list follows and is enclosed between left { and right } brackets.

		  ----- Example -----

          {< Michigan,>< Ohio,>< Maine,>}


Notice that a space follows the left < bracket and a comma comes before the right > bracket for each option.


          [Select 2 options:\M]{< Michigan,>< Ohio,>
          < Maine,>}


Output to the display appears as a selection window

		  ----- Example -----

          Select 2 options:\M
          >  Michigan,   
             Ohio,       
             Maine,

The Space Bar key acts as an on and off toggle. To select an option move the > character to a option you want to select and press the Space Bar key. You will notice that the option becomes brighter when it is selected. Continue to select more options and when you are finished press ENTER -- this will insert all the options selected into the document.

For example, by selecting " Michigan," and " Maine," the text "Michigan and Main" would be inserted into the document. The commas are automatically removed when there are only two options selected. This allows you to enter multiple phrases into a paragraph and have the paragraph come out gramatically correct.



NOTE: If you want multiple files to be inserted from the disk use the command :\FM. The selections between the brackets <> are the filenames of the text to be inserted.



INSERTING A FILE

To merge a file into the document file place the document filename after the command [\F and before a right bracket ].


			----- Example -----

			[\Ffilename]


For example, if 2 files on disk TEST1.DOC and TEST2.DOC contain the following information


TEST1.DOC:
	This is file 1 here. [\Ftest2.doc]


TEST2.DOC:
	This is file 2 here.


and Intelligent Report Writer executes TEST1.DOC, then TEST1.DOC inserts TEST2.DOC at the prompt [\Ftest2.doc] and the prompt is deleted.

The following output text now appears


		----- Example -----

		This is file 1 here. This is file 2 here.


NOTE: Intelligent Report Writer is recursive (always searching and executing itself) until all commands in the document are removed.

The search for commands always starts at the beginning of the document.



INSERT THE COMPUTER DATE INTO A DOCUMENT

To insert the current computer date into the document, include the command [\D] in the document in the place where you want it inserted. The date is inserted in the format Month, Date Year (i.e., January 24, 1986). The computers internal time clock must be set correctly for this command to work properly. The [\d] command (using a lower case letter d) inserts the current computer date into the document in MM/DD/YY format (i.e., 02/11/86).



INSERT THE COMPUTER TIME INTO A DOCUMENT

To insert the computers current time into a document, include the command [\T] in the document in the place where you want it inserted. The [\T] command reads the current time of the computer and inserts the time into the text in the format Hour:Minute:Second am/pm (i.e., 02:10:00 pm). The computers internal time clock must be set correctly for this command to work properly.


INSERTING TEXT FROM LIBRARY SECTIONS

The [prompt?\L] is a command that requests a library filename to be typed. A library is a text file stored on disk and consists of one large document divided up into sections. A section begins with the command #NN (NN being the consecutive section number) and ends with either the next section command #NN or the library sentinel command #END.

The purpose of library sections is to see a section of COMMANDS that will be inserted into the document before they are actually executed.

After typing the library filename press ENTER. The first library section scrolls onto the screen. At this point you have the option of scrolling to the next section, inserting the current section into the document or changing to another library file. If a library section is selected it is inserted into the document and the [prompt?\L] command is removed.

Using the text editor or word processor create the following Library file


	----- Example -----

	#1
     section one. I currently reside at [Please type in the
     state that you live in?]
	#2
     section two. The state that I currently live in is
     [Please select	the state that you live
     in:]{<Ohio><Michigan><Kansas><California>}.
	#3
	section 3. Your name is [What is your name?SHORT 25].
	#4
	section four. Now is the time for all good men to come
     to the aid of their fellow countryman. The time is [\T]
     and the date today is [\D].
	#END


Save the text to disk under the filename SAMPLE.LIB.

Remain in your text editor or word processor and create a second document file


		----- Example -----

		The section inserted into this document is [Please
          type in the library file?\L].


Save this text under the filename SAMPLE2.DOC.

Exit the text editor or word processor and ENTER to the Database initial screen.

Execute the SAMPLE2.DOC.

The prompt from the document file appears on the screen and requests a library filename be entered. Type in the filename SAMPLE.LIB and press ENTER.


		----- Example -----

		Please type in the Library file?\L
		SAMPLE.LIB <ENTER>


Notice that the first section appears on your screen


	----- Example -----

     Section 1. I currently reside at [Please type in the
     state that you live in?]


A menu of options appears at the bottom of the section displayed.


		----- Example -----

		Use this one?  c)hange  n)ext  y)es  k)eyboard


The options are: c to change to another library file, n or ENTER to display the next section, y for yes to accept the section displayed as the one to be inserted into the document file and k for data to be entered from the keyboard (KEYBOARD INPUT).

When the last section is reached, the computer beeps and displays on the screen the notice "This is the last one!".

Pressing y inserts the section displayed on the screen into the document and the library prompt is deleted.

Note: Library sections can also include IF-THEN-ELSE statements and database input commands. This is a very powerful combination when also using IF-THEN-ELSE commands to load files.

Files loaded by IF-THEN-ELSE statements may include other library section commands.



INSERT DATA FROM THE DATABASE MANAGER

The Intelligent Report Writer can insert data from a Database record. The command to insert a field of information into the document is (*NN*) where NN is the field number of the record of the database. The command (*NN*) is placed in the text document where it is to be replaced with the data from the database field. To create and use a database as input into an Intelligent Report Writer Document please review the section CREATE A DATABASE.

For example, the database NAMES contains the following data

		(01) First Name: Joe
		(02) Last Name : Smith
		(03) Address   : 10771 North Road
		(04) City      : Pontiac
		(05) State     : Michigan
		(06) Zip Code  : 48223
		(07) Phone No  : 422-2811
		(08) AGE       : 31


To insert the above information of the record into a text document, include the following commands in the document where you want the field information inserted


		----- Example -----

		Name: (*1*) (*2)
		Address: (*3*), (*4*), (*5*) (*6*)
		Phone Number: (*7*)


When the document above is executed by the Intelligent Report Writer using the record passed and the output will look like this


		----- Example -----
	
		Name: Joe Smith
		Address: 10771 North Road, Pontiac, Michigan 48223
		Phone Number: 422-2811



INSERT SELECTED TEXT DEPENDING ON WHAT IS IN THE DATABASE

You can include IF-THEN-ELSE logic within your commands by using the syntax (*IF *23* "m"<male>"f"<female>"ELSE"<not known>*)

The number 23 is the field number of the database record that you want to evaluate. The m and f are compared to see if field 23 has a m or f in it. If a "m" is in field 23 then the entire IF-THEN-ELSE structure is replaced by the word "male". If a "f" is in field 23 then the entire IF-THEN-ELSE structure is replaced by the word "female". If neither a "m" or a "f" is in field 23 then the command "ELSE" is executed and the entire IF-THEN-ELSE structure is replaced with the phrase "not known".

The "ELSE" command is optional. If the "ELSE" command is not placed into the IF-THEN-ELSE structure there is no match then the entire IF-THEN structure is deleted from the document and no text is inserted.

The IF-THEN structure is valuable in making intelligent form letters or documents. For example, gender of the person can be taken into account.


(*1*) is a (*8*) year old (*IF *1* "m"<male>"f"<female>*).
(*IF *1*	"m"<He>"f"<She>"ELSE"*) currently resides at (*3*)
in (*4*), (*5*).


When the above document is executed using the record passed of our sample database NAMES, the following text is output


       Joe is a 31 year old male. He currently resides at
       10771 North Road in Pontiac, Michigan. 


You can also include Intelligent Report Writer commands inside the field of the data record. Similar to the library command explained earlier, this allows you to have a series of particular questions to be asked -- the questions being maintained NOT in the document text but actually within the database record. Each record could contain an entirely different series of questions.

For example, consider the following database QUES and the data in the record passed

		----- Example -----

          QUES 1: [What is your name?]
          QUES 2: [How old are you:]{<1-10><11-20><21
          -30><31-40>}


If the following document


		(*1*) is between (*2*) years old.


is executed using the record passed of the database QUES then the user is asked to type in the persons name and then to select an age range. Output would look something like this 


		----- Example -----

		Joe is between 25-30 years old.


Printer commands such as begin underline, end underline, begin boldface and end boldface can also be included in a data field of the database record.

 
INSERT TEXT FROM DISK DEPENDING ON WHAT IS IN THE DATABASE

The (*IF\F *NN* .. "ELSE"*) command is similar to the previous IF-THEN-ELSE structure. The difference being that instead of using information that is within the document to insert you insert text from a disk file. The advantage of using this command is that the files can include additional Intelligent Report Writer commands that are only executed if they exist in the computers memory.

Let us use an example to demonstrate this powerful tool.

There are three files that have been saved to disk (MALE.DOC, FEMALE.DOC and SAMPLE.DOC)


	MALE.DOC:
          You are a very handsome male NAME.[What is your
          name?\RNAME]

	FEMALE.DOC:
          You are a very beautiful woman NAME.[What is your
          name?\RNAME]

	SAMPLE.DOC:
		Name: NAME
		(*IF\F *9* "m"<male.doc>"f"<female.doc>*).


If SAMPLE.DOC is executed from the Intelligent Report Writer using the database record


		(01) First Name: Joe
		(02) Last Name : Smith
		(03) Address   : 10771 North Road
		(04) City      : Pontiac
		(05) State     : Michigan
		(06) Zip Code  : 48223
		(07) Phone No  : 422-2811
		(08) DOB       : 02/15/80
		(09) Sex m/f   : m


then the SAMPLE.DOC file will determine from the database selected if field 9 has an "m" or a "f" in it. If a "m" is in field 9 then the file "male.doc" will be inserted into the document and the process of executing the SAMPLE.DOC will continue. An analogy to this is like a dominoes chain reaction. Powerful ... you bet!

If there is a "f" in the database field then the file "female.doc" will be inserted into the document and the process of executing the SAMPLE.DOC will continue.

The optional "ELSE" command can also be used in the file IF-THEN-ELSE structure for inserting a file.

Remember that filenames included between the < > brackets MUST be valid filenames and MUST be resident on the disk otherwise an error message will occur.


FIGURING OUT AGE IN YEARS

When (*AGE:VX=FN*) command figures out the difference in years between the computers computer current date and the date in field FN. This number, in years, is stored into a numeric variable VX and the entire prompt is deleted. To explain this better look at the following sample record


		(01) First Name: Joe
		(02) Last Name : Smith
		(03) Address   : 10771 North Road
		(04) City      : Pontiac
		(05) State     : Michigan
		(06) Zip Code  : 48223
		(07) Phone No  : 422-2811
		(08) DOB       : 02/15/80
		(09) Sex m/f   : m


Notice field 8 contains the client's date of birth. The computer date is currently set at 02/15/86 so we know that the client is exactly 6 years old. You insert the current age into a variable by including the command (*AGE:V2=F8*) anywhere in the document prior to the place you want to insert the variable vX. The [INS:VX] command is used to insert the age directly into the document. Please refer to the section on calculations to learn more about numeric variables.


          (*1*) is a (*AGE:V2=F8*)[INS:V2] year old (*IF *9*
          "m"<male>"f"<female>*) who currently resides at
          (*3*) in (*4*), (*5*).


The variable V2 is used as a storage area to hold the number. When the document is executed, using our sample database record, the output looks like this


		----- Example -----

          Joe is a 6 year old male who currently resides at
          10771 North Road in Pontiac, Michigan.


The (*AGE:VX=VN*) command is a powerful tool when used with the IF-THEN-ELSE command to include text into the document based on the age in a field. For more information about this please refer to the section on inserting information based on the range of a numeric variable.


LOOKUP AND INSERT A PARAGRAPH FROM A TABLE

The (*NN* LOOKUP "filename"*) command is used to reduce typing. A lookup file is first created on the disk containing blocks of paragraphs (a block is a group of text terminated with a carriage ENTER). The reference number of an individual block is based on the sequence order it is placed in the file. For example, examine the following sentences in the file "TEST":

         This is sentence number one here.
         This is sentence number two here.

Each block ends with a carriage ENTER. This file contains two blocks with reference numbers 1 and 2.

When a document is executed it looks up and inserts what is in a table file based on the value of what is in the database record.

For example, say the following document is executed 

       The sentence selected is: (*5* LOOKUP"TEST"*)

using the data in field 5 of a database record which contains

       (5)SENT#: 1

the document inserts the selected information from the file "TEST" depending on what the value is in the database record. In this example the sentence "This is sentence number one here." is inserted into the document.

Each block in a lookup file can contain other intelligent report writer commands. Used with the library commands this can be a very powerful combination of tools.


USER COMMANDS

There are 6 current user commands that can be activated within the Intelligent Report Writer document. A user command is executed when it is encountered within the document. User commands allows the document to display messages, play sounds, pause, clear the screen, and display active variables and database field information. A User command begins on a new line within the document and is ended with a carriage ENTER.
After a user command is executed it is deleted from the document. No text is inserted into the document where the user command is activated.

Explained below are various commands that can be included within your document.

[USER1 text] is a user command that places text on the screen. The text is word wrapped. This text might be a message to the person at the keyboard stating that calculations are currently being made within the document and the user should be expected to wait for a few seconds


	----- Example ------

	[USER1 Please wait a moment! Calculating ...]


[USER2 100-5000] is a user command that makes a sound with a frequency from 1 - 5000. This sound might mean a new section of the document is being executed .. or that the calculations are finished


	------ Example -------

	[USER2 4000]
	[USER1 All done!]


[USER3 1-32767] is a user command that delays the execution for the rest of the document 1 - 32767 iterations. You will have to experiment with how long this number is on your computer because different computers run at different speeds. Experiment with different values and compare the start and stop timings with a stop watch.


	------- Example -------

	[USER3 5000]


[USER4] is a user command that clears the screen when it is executed.

	------- Example --------

	[USER4]
	The screen is now clear except for this message.

[USER5] is a user command is like a pause. It waits for any key to be pressed before the document continues to be executed. A message is printed down on the bottom line of the screen stating "Press any key to continue ...."

	-------- Example --------

	[USER5]


[USER6 VN CN FN] is a command that allows you to display on the screen the current contents of numeric variables V1..V72, alpha-numeric variables C1..C72, and current database field contents


	------- Examples ---------

	[USER6 V25]
	[USER6 C5]
	[USER6 F3]

	
CALCULATIONS WITHIN THE DOCUMENT

Intelligent Report Writer has 72 variables to store numeric values. A variable is a storage area in the computers memory where a number is stored. A numeric variable takes on the form v1-72 (i.e., V1, V2, V3, V55, V72). A numeric variable can contain numbers typed in from the keyboard, a number in a field of a database record, numeric constants and other numeric variables.

Mathematical operations include addition (+), subtraction (-), division (/) and multiplication (*).

The following are some examples of legal numeric expressions


			---------- Examples -----------

			V1=25
			V1=V1+V2
			V5=100
			V3=V1+V5
			V4=100-V3


SETTING A NUMERIC VARIABLE FROM A CALCULATION

To set a numeric variable to number use the command format


			----- Example -----

			[SET:V25=V15+100-25.25]


Let us explain exactly what this command means. To the left of the equal = sign is the numeric variable where the equation (to the right of the equal sign) is set to after the calculation is executed. The equation part consists of V15+100-25.25-V13 where V15 is whatever the number held in the variable V15 represents, V15 is then added to a constant value of 100 and is then subtracted by a constant value of 25.25.

The SET command is resides between the right and left brackets [].

Parenthesis can be used within your equations to force a part of the equation to be evaluated first. For example, in the equation


			----- Example -----

			[SET:V25=2/(V2*V3)]


the parenthesis around (V2*V3) forces the value represented by variable V2 to be multiplied by the value represented by variable V3 before that result is divided into the number 2. You can use as many parenthesis as you like but remember that the equation must be balanced -- i.e., for every left parenthesis ( there must be a corresponding right parenthesis ).



SETTING A NUMERIC VARIABLE FROM THE KEYBOARD

To set a variable from the keyboard use the SET command in the format


		----- Example -----

		[prompt?\SET V25]


The value typed from the keyboard is entered into the variable V25. The prompt is the text that is displayed on the display.


SETTING A NUMERIC VARIABLE USING DATA FROM A RECORD

To set a variable that includes information from a database record use the SET command in the format


			----- Example -----
	
			(*SET V25=F1+F2-V3/25*)


In the example above the variable V25 is SET to the results of the equation only after the record has been loaded into memory from the database. Specific fields included in the calculation consist of the lower case letter f followed by the field number of the record. Other variables as well as constants can be included in the calculation.


IF-THEN-ELSE INSERTING TEXT BASED ON VARIABLES

This is a very powerful tool to merge selected paragraphs from the disk or within the command based on the value of a variable.

To insert text into a document based on the value of a variable, use the format


		----- Example -----

          [IF V10=25..30<the value is between twenty five
          and thirty>15<the value is fifteen>88..91<the
          value is between eighty eight and ninety
          one>ELSE<none of the answers have been selected>].


The above example says that if variable v10 has a value between 25 to 30 then insert the text "the value is between twenty five and thirty". If variable V10 has a value of 15 then insert the text "the value is fifteen". If the variable V10 has a value between 88 to 91 then insert the text "the value is between eight eight and ninety one". The ELSE command above is used to include the text "none of the answers have been selected" as an alternative only if none of the other options match.


To insert text from files stored on disk into the document based on the value of a variable use the command format


	----- Example -----
	[IF\FV100=10..20<FILE10.T20>50..100<FILE50.100>ELSE<NOT   
     HING>]


The optional \F in this command inserts the files "F10.20", "F50100" and "NOTHING" off the disk depending on the value of variable V100. The filename between the <filename> must be a valid PC-DOS filename.



INSERTING A NUMERIC VARIABLE INTO THE DOCUMENT

To insert any of the 300 numeric variables into the document use the command

			----- Example -----

			[INS:V100]


In the above example the variable V100 is inserted into the document where the INS command is placed.



SETTING CHARACTER VARIABLES

There are 72 alpha-numeric character variables available to store text which may include the addition of other character variables, text and field information. The command [SET$:CN=$CX$ text $CY$ text $FZ$ text $FW$] inserts the text to the right of the equal sign into the character variable CN. The character variable begins with the lower case letter C followed by the number N of the character variable . Any field variables and character variables specified to the right of the equal sign must have a start






ing $ followed by the variable and then another $.
 
Notice that there must be a $ after the command SET (i.e., SET$). Text to the right of the equal sign to be used as a constant has no quote marks enclosing the text. For example, [SET$:C2=$C1$ is a good $F1$] using the data in field 1 of "man" and character variable c1 of "Joe" the results are stored in character variable C2 as Mark is a good man. 



SETTING FIELD DATA WITH CHARACTER VARIABLE TEXT

The command

		 ----- Example -----

		 (*SET$:FN=$CX$ text FY$*) 

is similar to previous alpha-numeric command previously described above with the exception that the result gets stored into data record field FN. Using this command and the [\WRITE] command allows you to modify data in the database record (i.e., data input from the document gets stored back into the fields in a database record).



INSERTING A CHARACTER VARIABLE IN THE DOCUMENT

The command


		----- Example -----

		[INS$:CN]


inserts a alpha-numeric character variable cN into the document where the command appears within the text.


INPUT FIELD DATA FROM THE KEYBOARD

The command


		----- Example -----

		(*prompt?SET FN*)


gets data from the person at the keyboard and then inserts this data into the database record field FN. No quotation marks are used with this command. This command along with the [\WRITE] command actually allows you to change data in a database record on disk.



SETTING A CHARACTER VARIABLE FROM THE KEYBOARD

The command


		----- Example -----

		[prompt?SET CN]


inputs information from the keyboard into the character variable cN.


SAVING FIELD DATA BACK INTO A RECORD

The command


		----- Example -----

		[\WRITE]


writes the current modified record back to disk.