Lexa 

 Corpus Processing Software 

 Vol.2 

 Database and Corpus Management 

Raymond Hickey 
English Linguistics
Essen University 

Contents 

Database Management 

1.	DbStat 
	1.0.	Introduction 
		1.0.1.	Desktop key settings 
	1.1.	Database editing 
		1.1.1.	Processing two databases 
		1.1.2.	Treatment of field types 
		1.1.3.	Default values 
			1.1.4.0.	The purpose of an index 
			1.1.4.1.	DbStat index files 
		1.1.5.	Size limitations 
	1.2.	Description of commands 
		1.2.1.	Navigation and Control key settings 
		1.2.2.	Databases and indexes 
		1.2.3.	Database editing 
			1.2.3.1.	Database viewing 
			1.2.3.2.	Appending records 
			1.2.3.3.	Merging and copying 
			1.2.3.4.	Data insertion 
			1.2.3.5.	Record duplication 
		1.2.4.	Searching records 
		1.2.5.	Filtering records 
		1.2.6.	Marking records 
		1.2.7.	Deletion commands 
		1.2.8.	Editing database text files 
		1.2.9.	Exporting to disk 
	1.3.	Statistical computation 
		1.3.1.	Measures of central tendency 
			1.3.1.1.	Global calculation 
			1.3.1.2.	Manner of calculation 
			1.3.1.3.	Using the calculator 
		1.3.2.	Tests on sets of data 
			1.3.2.1.	Chi-square 
1.3.2.2.	Pearson’s product moment correlation coefficient 
			1.3.2.3.	Spearman’s coefficient of rank correlation 
			1.3.2.4.	Standard error 
			1.3.2.5.	T-score 
			1.3.2.6.	Z-score 
			1.3.2.7.	Generate Z-values 
			1.3.2.8.	Mann-Whitney U-test 
			1.3.2.9.	Wilcoxon matched-pairs signed-rank test 
			1.3.2.10.	Sign test 
			1.3.2.11.	F test 
		1.3.3.	Organization 
	1.4.	Miscellaneous commands 
	1.5.	Create a new database 
	1.6.	Delete records 
	1.7.	Sort and indexing a database 
		1.7.1.	Sort database 
		1.7.2.	Which language? 
		1.7.3.	Index database 
	1.8.	Shell, copy, delete 
	1.9.	Field information 
	1.10.	Database statistics 
	1.11.	Export, import 
		1.11.1.	Delimited and SDF text files 
	1.12.	Set date format 
	1.13.	Miscellaneous 
	1.14.	Command line arguments 
	1.15.	DbStat file types 
	1.16.	Key settings in directory lister 
	1.17.	Command activation via picklists 
	1.18.	Activating the text editor 
		1.18.1.	Text editing 
		1.18.2.	Function key settings 
		1.18.3.	Navigation keys 
		1.18.4.	Deletion procedures 
		1.18.5.	Find and exchange 
		1.18.6.	Printing text from DbStat 
		1.18.7.	Using picklists on the text editing level 
	1.19.	Using an initialization file with DbStat 
 
2.	DbTrans 
	2.0.	Introduction 
	2.1.	Search parameters 
	2.2.	Field choice and file specification 
	2.3.	Manual operation 
	2.4.	Batch mode and initialization 
 
3.	DbPage 

4.	DbLook 
 
5.	ReportDb 
	5.0.	Introduction 
	5.1.	Description of commands 
	5.2.	Function key settings 
	5.3.	Using ReportDb in the batch mode 
	5.4.	Exporting data from DbStat/ReportDb to a word processor 

6.	DbList 
	6.0.	Introduction 
	6.1.	Description of commands 
	6.2.	Function key settings 
 
7.	CompDb 
 
8.	MergeDb 
 
9.	ClassFld 
 
10.	PackMemo 
 
Direct Calculation 

1.	CalcStat 
	1.0.	Introduction 
	1.1.	Description of input modes 
		1.1.1.	Single Expressions 
		1.1.2.	List Processing 
			1.1.2.1.	Statistical calculations 
	1.2.	Function key settings 
	1.3.	File types created by CalcStat 
	1.4.	Command execution via picklists 
 
Corpus Management 
 
1.	Corpus Manager 
	1.0.	Introduction 
	1.1.	Consultation 
		1.1.1.	Consult via record 
		1.1.2.	Consult via keyword 
		1.1.3.	Choose text database 
		1.1.4.	Re-index text database 
		1.1.5.	Generate keyword index 
		1.1.6.	Parameters for search 
		1.1.7.	Show current settings 
	1.2.	Direct search 
		1.2.1.	Simple text search 
		1.2.2.	Examine search output 
		1.2.3.	Wild card text search 
		1.2.4.	Show wild card finds 
		1.2.5.	Run pattern matcher 
		1.2.6.	External string search 
	1.3.	DOS services 
		1.3.1.	Load text editor 
		1.3.2.	Run database manager 
		1.3.3.	Execute DOS command 
		1.3.4.	Load DOS temporarily 
		1.3.5.	Display environment 
		1.3.6.	Show directory list 
		1.3.7.	Set current directory 
	1.4.	Function and special key settings 
	1.5.	Structuring text files 
		1.5.1.	Limits on text structures 
	1.6.	File types used and generated by Corpus Manager 
	1.7.	Using initialization files with Corpus Manager 
	1.8.	Supplied databases 
 
2.	Character Index 
 
3.	DosDemo 
 
4.	DosDict 
	4.1.	Description of commands 
 
5.	DosHelp 

Bibliography, Glossaries, Appendices 
 
Bibliography on Statistics 

Glossary of Statistical Terms 

Appendix A	Text files generated by DbStat 
 
Appendix B	Error messages issued by DbStat 
 
Appendix C	Troubleshooting with Corpus Manager 

 

 Foreword 

 The present volume of the Lexa package is divided into two sections. The first deals with database management along with statistical computation and the second with software for handling corpora within an easy-to-grasp environment. 

 Database management 

 The database management software serves several purposes. The most obvious one is of course the processing of databases, for instance those generated with lexical processing programmes of the Lexa group (see Vol.1). 
	A second and important goal of this software is to offer linguists software with which they can carry out the type of statistical operations on a computer which are frequently required in language studies; these are realised with the database manager which has a whole range of inbuilt statistical options which are discussed in detail below. The operations possible can range over a broad spectrum covering such different aspects as sociolinguistics, lexicology, language performance evaluations, phonetic investigations or diachronic typology (quantitative changes in language use over time). 
	The numerical data to be processed must first of all be available in the form of lists contained in ASCII text files. These can be used immediately with CalcStat for more direct computation or can be imported into a (dBASE compatible) database which is subsequently used for statistical purposes. The database manager DbStat is capable of statistical computations which involve two series of data thus allowing tests like the Chi-square test, or estimations of correlation like the Pearson product-moment correlation coefficient or the Spearman rank correlation coefficient. The results of computations are either stored directly in a database or can be deposited in an ASCII text file which can be examined later and even function as renewed input into a database for later statistical purposes. 
	The type of statistics possible with DbStat and CalcStat is what is known as inferential statistics. Here one is concerned with computations on numerical data which allow one to say if something is true or not (for example that two sets of data are correlated) with a certain degree of confidence. The other main branch of statistics is descriptive statistics. This is quite well covered by many commercially available packages running under the general title of presentation graphics which as the name implies is concerned with demonstrating the relationships between sets of numerical data in a graphical manner to make these intuitively recognizable. 
	Most of the types of statistical computations which linguists will be interested in are non-parametric (so-called distribution-free tests of significance). As the data is not usually of the discrete type, but rather nominal, non-parametric tests are of increased importance. Such tests are based on the notion of ranking the data which serves as input to a computation. Several tests of this type have been included in DbStat, e.g. the Spearman or the Mann-Whitney U-test. In addition, linguists are frequently interested in determining whether any given set of data match an expected distribution; here the appropriate test is the Chi-square test which is a measure of the goodness of fit between an observed set of data and an expected set. 
	Users of this software should note that no introduction to statistics is offered as this would of course go far beyond the bounds of the current project. It is assumed that each user will have at least rudimentary knowledge of statistics before tackling DbStat (i.e. not just as a database manager but as a means to statistical computation as well). Nonetheless, as a reminder to those whose statistics might be a little rusty, a glossary of terms is supplied at the end of this volume. Suggestions for further reading can be found in the list of references also contained in the appendices section. 
	A set of statistical tables will be necessary for many of the tests which can be carried out with DbStat, for example the result from a Spearman test of rank correlation coefficient depends on the critical value for a certain significance level (one or two tailed) and a certain number of degrees of freedom. Critical values are contained in statistical tables which are included as appendices to introductions to statistics (again see the references at the end of the book). 
	To the linguist, indeed to anyone involved in statistics, a word of warning is always required: test results are never absolute. After all, statistics is about probability. Here one speaks of a significance level, say 5% or 1%, at which a certain hypothesis about the data one is examining is probable. Furthermore one must design one’s investigation in a manner which will not only do justice to one’s data but also protect one from false conclusions. For instance it would be fatal to use a parametric test for data for which no assumption about the distribution (normal or otherwise) is legitimate. 
	The programmes of the present set are intended for use with the text files of corpora such as that of historical English compiled at the University of Helsinki. They can for instance be used for selective extraction of information from groupings of files or for the construction of lexical databases which can acquire information cumulatively from any subset of text files. In this respect the present group should be viewed as a complementary set to the programmes for lexical data processing described in Vol.1 of the present documentation. 

 Corpus Management 

 The driving idea behind Corpus Manager has been to provide a means of structuring existing texts in the simplest possible way which would then allow users to retrieve information selectively from within an easy-to-grasp user interface. The texts to be used can be determined by the user or prepared in advance by some supplier of texts, e.g. a university department engaged in compiling a corpus. 
	The basic procedure for generating text databases is as follows: you take any ASCII text, for instance part or parts of a corpus, and load it into your editor. Now you place markers (one of three types) at user-determined points in the text. These markers are used by Corpus Manager as text record delimiters. The three different kinds represent the three different levels of record nesting which the programme caters for. Having done this you start Corpus Manager and from the desktop you generate an index on the text you have just prepared with record markers. You may now open picklist windows and choose various topics which are dealt with in your text. The picklists appear like a table of contents in a book with three levels, one below the next. When you choose a topic from any of the lists offered the associated section from your original text file is displayed on a separate screen and you may view this, scroll in either direction, search for strings, etc. 
	To add some sophistication to this system a further index is also provided for: a keyword index. The user creates a simple list of words which occur in the text file. Corpus Manager now generates another index file with information on the occurrence of these items. Any keyword can be selected from the keyword group and then you are presented with a picklist with all the text records in which this keyword occurs. 
	Direct searching of the text database is equally possible. You enter a search string (using DOS wild cards if you wish to increase scope) and a list of finds is returned and you may then examine the text records in which strings were found, highlighting the finds on the screen if you wish. 
	The text database used with Corpus Manager can be of any size and any contents. You can chain a whole series of existing files to a text database using the Lexa utility Lexa Chain; you can use the automatically generated log file to check on what source files were chained together, these may also be "unlinked" later by reversing this process with Lexa Unchain. 
	To illustrate the scope of this text database manager a sample database has been prepared by the present author. It consists of a section of the Helsinki corpus of diachronic English and is supplied with some additional files on the distribution diskettes. In addition to this the text of an introductory book on personal computers is supplied in electronic form in the text database PC_KNOW.TDB which can be used with Corpus Manager by users who still feed the need and desire to acquire knowledge on handling data on personal computers. To this end the utilities DosDemo, DosHelp and DosDict have also been included in the package. 

Raymond Hickey					Munich 
							September 1992 

 

 Database Management 

 1.	DbStat 

 Syntax:	1)	dbstat [file_name] 
		2)	dbstat /s[-setup_file] 
		3)	dbstat /e[-file_template] 
		4)	dbstat /i[-ini_file] 

 1.0.	Introduction 

 The aim of DbStat is, on the one hand, to provide users with an easy-to-use programme with which one can edit any dBASE compatible database (including those which have been created by Lexa or CalcStat, to mention two other programmes of the Lexa group which are capable of generating databases), and on the other hand to put at their disposal an interface for exporting the contents of a database (or part of them) to a text, availing of a report form in the process. You can visualize this as follows: 

	Database File	->	Report Form	->	Text File 
	(Field contents)	(Export template)	(Lines of text) 

 The report form decides in what manner the field contents of the records are to be imported into the text, indeed if some fields are to be suppressed, others to appear more than once, etc. Furthermore a report form may contain extraneous text (i.e. not part of the fields of a record) which is inserted into the current text in the editor whenever a record is exported from the database. At the latter end the user can determine (by marking) just how many records from the current database are to be transferred to the text editor. Should the number of marked records be too great to be imported into the text area, you may send the output of an export to a disk file which can be edited at will later. 
	Apart from its application as an interface to text editing, DbStat can also be used for pure database management. You can create databases sort them, delete records, search for contents, edit a database in full screen mode or browse through it, etc. 
	A further major aim of DbStat is to provide users with an easy-to-use programme with which one can carry out a number of computations required for inferential statistics. Many of these tests are of the kind which are most often required by linguists in their work as they are non-parametric and rank-based, intended for ordinal data which is the most common type found in linguistic studies. 
	The current programme is a database manager with which one can edit any dBASE compatible database in a flexible and comfortable manner. The databases to be edited are either already available or can be created by users. To get started users can take a look at the databases contained in the directory statdata on the distribution diskettes. Furthermore one can derive new databases from these and use the new ones to import data into from text files. This would be sensible if one had data in the form of numerical tables and wished to import the data into a database for later statistical computation. 
	Once one has some databases one can sort them, delete records, search for contents, edit a database in full screen mode or browse through it, etc. The functions available are those which one would expect from a sophisticated database manager. A consequence of this is that one can use DbStat for normal database management even if one is not directly involved in statistics. This is simply a spin-off of the ability of DbStat to handle databases with the full complement of normal management functions. Note that to begin with these general functions are discussed, the specific statistical ones being dealt with in section 1.3 below. DbStat starts by presenting you with a desktop from which you can undertake a variety of operations. 

 1.0.1.	Desktop key settings 

	1)	Shift-F1	Execute DOS command 
	2)	Ctrl-F1	Shell down to DOS 
	3)	F3		Pack ‘memo’ file of database 
	4)	F5		Index use when processing databases 
	5)	F7, Alt-F4	End session with DbStat 
	6)	F9		Show environment information 
	7)	F10		Save structure of database 
	8)	Alt-T		Activate text editor 

 Items (1), (2), (5) and (6) of the above list hardly require any comment as they correspond to similar settings in all of the major programmes of the Lexa group and should be familiar to users from the documentation in Vol.1. The editor which is activated by means of Alt-T is discussed below. 

 F3  Pack ‘memo’ file of database With DbStat you can edit memo files which are associated with databases in the dBASE format. These files have the extension .dbt and bear the name of the database they are associated with. In the course of processing memo files they tend to get bloated due to the somewhat inefficient technique of storing data in such files. In order to compress these files and thus save on disk space the utility PackMemo has been included in the Lexa set and can be called from the desktop of DbStat with the name of the memo file passed to it (as a command line parameter) which you choose from a directory listing which opens on pressing F3. Depending how often you have processed the contents of a memo file, packing it can lead to a reduction of down to a quarter of the original file size. 

 F5  Index use when processing databases. Three items of information can be specified concerning indexes from the desktop of DbStat. 

 1)	Should an index be used when processing a database? If you answer "yes" 
	then DbStat will try to load an index file which then (a) governs record 
	display and (b) greatly accelerates the finding of search strings in records 
	by examining the contents in the keyfield of an index. 

 2)	Should the user select an index when loading a database? Take care here: if 
	you specify "no" then DbStat will look for an index file which matches the 
	name of the database selected for processing. For instance if you choose a 
	database TEST.DBF then DbStat will search for an index file called 
	TEXT.DBX. If it does not find one then obviously the database is loaded 
	without an index. Should it, however, locate an index in the same directory 
	as the database then this is read and linked with the database in question. 
	Be very careful to ensure that the index is up-to-date with the database 
	otherwise record display will be erratic. The index file loaded will of 
course 	have had to have been generated from the desktop via the appropriate option  (Sort, Index Db.) at some earlier point. It is there that you specify what field is to act as keyfield for the index which is to have the same name as the database from which it is derived. 
 
	Should you opt to select an index file then you may choose one with a 
	different name from the database it is associated with. Here is a practical 
	example. You are using the supplied test bibliographical database 
	BIBLIO.DBF which has an index BIBLIO.DBX, derived using the field 
	SURNAME of the database. For a particular processing session you would 
like to have the records ordered by year. To do so select the supplied index 
	YEAR.DBX and this is automatically achieved. 

 3)	The matter which requires greatest attention with indexes is whether they 
	are up-to-date with their associated databases on not. One effective means 
	of ensuring this is to force DbStat to re-index a database each time you load 
	it with an index file. The cost of this is just the few seconds necessary to 
	re-index the database from the desktop before entering the editing level. 

 Note Values for the three relevant index parameters can be specified in an initialization file; consult the supplied file dbstat.ini to see how this is done. 

 F10  Save structure of database. On pressing this key a window opens on the left of the screen and you are prompted to enter the name for a text file which will contain the structure of the database which you then choose from a directory listing which is displayed. Such structure files are useful documentation on database which you process frequently. 

 1.1.	Database editing 

 Once you have selected a database from the window which opens on choosing the first option, you are presented with a screen which displays the contents of the first record of the chosen database. 
	You notice immediately that the usual items of information about a database file from the dBASE environment are indicated before each field, i.e. name, type and size of each field. The inverse video representation which you see on the screen corresponds in length to that of the field in question. However a field can be longer than the 62 spaces which will fit on the screen layout used. In this case you can scroll to the right in the input line for a long field and use commands of the User Input Editor (see the relevant Appendix) like Home and End to jump to the beginning or end of the field respectively. 
	The screen is filled with the number of fields determined by the type of database DbStat reads to begin with. There is an upper limit of 80 fields; if a database has more than 23 fields then using the UpArrow, DownArrow or the Home, End keys will scroll the field display vertically. 

 It is truism that beginners always create databases with too many fields in each record. This slows down processing enormously and wastes disk space unduly. Keeping your databases tight and compact is the golden rule in efficient database management. 
	When DbStat starts it is in the so-called list mode in which you can page in a database file by means of the PageUp and the PageDown keys. To edit a record press Return. You can jump to the beginning of a file with Ctrl-PageUp and to the end with Ctrl-PageDown. You can go to a specific record by pressing Ctrl-G or Ctrl-Home and entering a number. 

 1.1.1.	Processing two databases 

 DbStat can handle two databases simultaneously. When you start from the desktop, one database is loaded into the first work area (to be recognized from the reference DB.: 1 in the first line of the screen). If you want a second database then you must load this by pressing Alt-2. The directory lister is activated and you can choose a database for work area 2. Pressing Escape cancels this command and you are returned to the first area. Assuming, however, that you successfully chose a database then this is loaded into work area two and you may now switch between databases with Alt-1 and Alt-2. 
	Note Certain commands require that two databases be loaded, e.g. the record transfer command (activated with Alt-D). With such commands, the structure of the databases in both areas must be identical. A new database can be loaded into either area at any time by pressing F5 which activates the directory lister from which you choose another database. 
 
 1.1.2.	Treatment of field types 

 As DbStat has access (via the database header) to information on the type of each field of a database it can treat these types correctly. You will note the following abbreviations for different fields within DbStat; they correspond to the four main kinds of dBASE-type fields. 
 
	Field type		Possible field data contents 
	C (=character)		Alphanumeric data (no restrictions) 
	N (=numeric)		Numeric data, blank, dot (= decimal point), dash (= 
sign) or comma (= thousand separator) 
	D (=date)		Numeric data which represents a valid date 
	L (=logical)		The letters T,F,Y,N 
	M (=memo)		A number as offset to text file associated with 
database 

 The correct treatment of fields is achieved internally by DbStat itself maintaining a dictionary with four fields (FieldName, FieldType, FieldLength, FieldDecimal) which correspond to the four items of information contained in the header of a database file in the dBASE environment. Each field of the database then has certain values for these fields which determine the display of the fields and the data which can be entered into them. Note that if the database file contains a reference to a memo field (see your database documentation about this) then this is ignored by DbStat. 

 1.1.3.	Default values 

 The various field types obtain certain default values if they are not already filled with information from a data file. This is necessary so that when writing the file to disk, DbStat fills the field section of each line of text correctly. A character field is filled with as many blanks ($32) as it is long; the same applies to a numeric field; a date field is filled with the initial date 01/01/1980 (in ANSI format: 19800101) while a logical field contains an F for false. 
	If a numeric field contains a decimal place (an item of information gained from the database header on loading DbStat) then this is located at the correct position in the series of blanks in an empty numeric field. This decimal point cannot be replaced by a number when editing the contents of this field as this would be tantamount to changing the structure of the database which is not permissible when editing with DbStat. 

 1.1.4.0.	The purpose of an index 

 Any database can have an auxiliary file associated with it called an index. The purpose of an index is to provide rapid access to records of the database. An index is a text file and functions as follows. From a certain specified field (or fields) of a database the entry is (are) extracted and included in a file at regular intervals. This file then contains the information of a field of each record of the database. The file is sorted according to a certain order, normally in ascending alphabetical order (it could also be in reverse order, with or without attention being paid to case). An index file opened with a database serves two essential functions. 

 1)	An index determines the order of display of records.  Say one has an (open) 
	index on the field AUTHOR in a bibliographical database then the records 
are displayed in an alphabetical order determined by the name in the field 
	AUTHOR, irrespective of whether the records are physically in 
alphabetical order according to this field or not. This has a certain side 
effect. The hard disk must be accessed repeatedly during navigation with 
an open index file (unless by chance the order of the index file is the same 
as the physical order of records within the file). This is obvious: if in the 
example above you are at the letter "F" according to the author field and 
move to the next record which, going on the index, should contain a name 
beginning with "G" then the index must load the record which fits this 
requirement. Assume for argument’s sake that the last record with an 
author whose name begins in "F" is physically number 6 and the next 
record which begins in "G" is physically number 211 then the index file 
must jump from 6 to 211 if you give the command "go to next record" 
(PageDown in DbStat) when the display is governed by this index. 
Normally this means accessing the hard disk. Paging through a database 
can then be a relatively slow process as disk head repositioning can, in an 
unfavourable situation, be required for nearly every record. 

 2)	An index is used for rapid searching.  If you look for a string from the field 
	which acts as the keyfield with an index then the system combs through the 
	index file (in memory) to see if it exists. If found, it then jumps straight to 
	that record in the database and displays it. The alternative is the "Locate" 
	procedure (activated with Ctrl-F in DbStat) which combs through the 
	actual database (on disk), record for record. This is understandably a 
	slower method of finding strings. With simple searches it is advisable to 
use an open index file for reasons of speed. For searches outside of the 
keyfield of an index, use the locate command; for complex searches 
(involving conditions referring to more than one field, you should set a 
filter via the Alt-F3 key combination). 

 1.1.4.1.	DbStat index files 

 The current database manager creates and uses its own index files all of which have the extension .dbx (= database index). It is essential for users to grasp that these indexes are specific to DbStat, they are neither in the format required for dBASE nor that for Clipper or FoxBase. The reason for this is simply that there is no documentation on the format of these latter files so that the present author had no choice but to create his own type of index. The .dbx indexes generated here only allow one key field but are very compact, thus occupying a minimal amount of valuable system memory which may well be needed for text editing within DbStat. Furthermore, the sorting of information in a DbStat index is always alphabetically ascending and case insensitive. Bear in mind that the alphabetical order is dependent on the language chosen on the desktop (or specified in an initialization file). 
	When editing a database an open index is automatically updated so that the changes are reflected in the index file. This refers specifically to changes in the contents of the keyfield of a record and to the appending of new records to the database. 

 1.1.5.	Size limitations 

 There are only a few limitations which users should be aware of when processing databases with DbStat. 

1)	Marking can only be done with the first 10,000 records; sorting and 
2)	deletion operations have maxima of 10,000 records also. 
3)	A database which you edit can have up to 80 fields, each of which can be 
up to 256 characters in length. 

 
 
 1.2.	Description of commands 

 1.2.1.	Navigation and Control key settings 
 
 Alt-1  Switch to first database Assuming that there is a database in the second work area to which you have moved, then this keystroke returns you to the first (default) work area. 

 Alt-2  Switch to second database Moves to the second work area activating the directory lister if a database has not already been loaded into area two. 

 Return  Edit record / save changes to record  The Return key in DbStat has the double function of (i) entering the edit mode to change the contents of a record and (ii) leaving this mode (and saving changes). In DbStat the changes made to the current record are saved when you move to another record (e.g. press PageUp or PageDown to move to the previous or following record respectively). This causes the record pointer to be re-positioned and before it does so DbStat automatically writes the current record on screen to disk. 
	Once you have entered the edit mode for a record you can move up and down between fields using the UpArrow, DownArrow or the PageUp, Page Down keys. Use Home and End to move to the beginning or end of a field respectively. 

 Escape  Abandon changes   As one would expect, this leads to changes made to a record field being abandoned. The display is refreshed to show the record with the contents of the current field before it was edited. 

 Page Up  Scroll backwards   Moves backwards one record in database file. 

 Page Down  Scroll forwards   Moves forwards one record in database file. 

 Grey-Plus  (Edit), scroll forwards and edit  To obviate the necessity of pressing Return, PageUp and Return again when moving from record to record in the edit mode, these three keystrokes have been set to this single one. 

 Grey-Minus  (Edit), scroll backwards and edit  Works analogously to the previous keystroke but moves backwards in the current database. 

 Ctrl-PageUp  Beginning of database   Jumps to beginning of database file. 

 Ctrl-PageDown  End of database   Jumps to end of database file. 

 Home  First field in current record   When not editing a record pressing this key leads to the cursor being positioned on the first field (if it is not already there). 

 End  Last field in current record   When not editing a record pressing this key leads to the cursor being positioned on the last field. 

 UpArrow  Move up a field in record   When editing a record, moves the cursor up to the previous field; edit mode still active. 

 DownArrow  Move down a field in record   When editing a record, moves the cursor down to the next field; edit mode still active. 

 Note The Escape key interrupts any iterative operation such as searching for field contents, exporting several records to text, etc. 

 1.2.2.	Databases and indexes 

 F5  Load new database Activates the directory lister to allow you to select a new database. Pressing Escape aborts the operation and returns you to the database you were editing. However, if you do choose a new database, then this is loaded (along with an index of the same name, if found). Bear in mind that any active filter is de-activated as DbStat cannot assume that the filter constructed for one database is suitable for another. Furthermore any marking for export is lost as the marking counter is reset to zero. Note There is no checking on whether the index is inline with the database (this onus rests on the user!). A corollary of automatic index loading is that if you wish to use an index with another name than that of the database chosen then you must specify manual index selection via F5 on the desktop (see comments above). 

 1.2.3.		Database editing 

 1.2.3.1.	Database viewing 

 F10  Browse view database This is a mode in which you see the contents of each record on separate lines. When an index is active then you are offered a browse window on the right of the screen in which only the contents of the keyfield of each record are displayed. You can page in this window in the normal manner (with _, _, [Ctrl-]PgUp, [Ctrl-]PgDn). Reposition the record pointer with Return or return to the current record with Escape. 

 Note If you press F10 and no index is currently active then the browse mode works as for Shift-F10 (not index-determined). 

 Shift-F10  Browse view database (without index). The browse mode in database editing is one in which a single record occupies one line (as opposed to the full-screen mode in which one record fills a single screen). It has the advantage that it allows the user to survey a series of records at once. To this end a type of browse has been implemented in DbStat. When the user presses Shift-F10 it shows you the first 24 characters of the 3 fields of the current database starting from the field the cursor is presently resting on. A highlight bar can be moved within the window which opens. By means of this you can move to a record which you would like DbStat to jump to (press Ctrl-Return to move the pointer or Escape to leave it unchanged). The remaining keystrokes are navigational and should be self-explanatory. 

 If an asterisk appears after the number of a record in the browse window then this indicates that it is tagged for deletion and can be permanently removed from the database via the Delete Records option on the desktop (see below). 

 Ctrl-F10  Browse view and edit current field There is a third browse option available here which has certain advantages over the previous two types. It works as follows. On pressing Ctrl-F10 the screen changes and you are presented with a line by line display of the contents of that field of the current database on which the cursor was resting in the full-screen mode. You are not restricted, as with Shift-F10 to simply viewing as in this mode you can edit the contents of the field displayed. To do this simply press Return, when finished editing press Return to accept changes or Escape to reject them. The editing commands are exactly the same as when editing in the full-screen mode (and follow the conventions of the User Input Editor). Any changes made in the browse mode are echoed on full-screen when you exit the line-by-line display. 

 Ctrl-G, Ctrl-Home  Goto record   Leads to a prompt for a record number to which DbStat then jumps and the contents of which are displayed. If the value is beyond the range of the database, the last record is displayed. 

 1.2.3.2.	Appending records 

 Ctrl-A  Append a record   Adds a new record to the end of the current database file and enters the edit mode automatically. 

 Alt-A  Append a number of records  Similar to the previous command with the difference that the user must say how many records he/she wishes to append. The record pointer is repositioned to the first of the newly appended records. 

 1.2.3.3.	Merging and copying 

 F3  Copy/move field contents within current record This command stores the contents of the current field. It is intended for copying fields within a record. By pressing F3 you store the current field in an internal buffer. Then you move the cursor to the field to which the contents are to be copied. Note in this connection that you have two keystrokes for terminating this command, both with different effects: 

	Return	Move contents from original to new field 
	Ctrl-Return	Copy contents from original to new field 

 Bear in mind that if the receiving field is shorter that the contents being moved then some data is lost. Only works with fields of type Character or Numeric. 

 Shift-F3  Store, retrieve field of record. This command is similar to the previous one but is intended for those cases in which one wishes to copy field contents from one record to another (in the same or a different database). 

 You press Shift-F3 to activate the command; before DbStat proceeds you must specify whether you want to store the contents of the field the cursor is currently on or to retrieve the contents of the field buffer (assuming that something was copied into it earlier). Note that the slide bar in the second line of the screen is replaced by a special prompt. 
	Use either the LeftArrow, RightArrow or the Tab, ShiftTab keys to choose the desired action (as always, Escape aborts the action). If the field buffer has already been filled then its contents are displayed on the second line of the screen. 

 F4  Hold a record for merge This is a means of copying several fields from one record to another. The way it works is as follows. You press F4 and the contents of the current record are stored in an internal buffer reserved for this purpose. A message to this effect is issued. The buffer contents are retained as long as you do not replace them again or close any open databases by exiting to the desktop. Proceed now to the following command. 

 Shift-F4  Merge records. With this keystroke you cause the contents of the internal record buffer (assuming that it has been filled) to be retrieved into the fields of the current record. The operation is not a pure copy but rather a merge by which is meant that only the empty fields of the current record are filled with contents from the internal record buffer. The net effect of this is that you merge the contents of two records with each other, with the second record having higher priority so that its contents are never overwritten. 

 Alt-H  Hold current record number The present command simply notes internally the number of the record you are currently located at. Once Alt-H has been pressed, the following command can be used to return to the record whose number has been noted. The advantage of this command is that it allows you to navigate elsewhere in the database for some reason or other (e.g. to check up on the contents of another record) and return without having to re-locate the record where you were previously positioned. 

 Alt-G  Go to record number held Leads to a jump to the record whose number has been registered internally by the user previously pressing Alt-H. 

 1.2.3.4.	Data insertion 

 F2  Access internal text array.  This command activates a window in which you can enter up to 16 text strings (each up to 64 characters in length). Any of these can be later retrieved into the current field. To edit a text string, press Return, to retrieve a string into the current field of a record, use Ctrl-Return. 
	You may also load the contents of a text file into the array of strings with F5. The text which serves as input is uncritical: DbStat will import as much of it as fits. Input lines are truncated to 64 characters should they be longer and only 16 lines are imported. In addition, any line beginning with a semi-colon is treated as a comment and skipped (this is standard procedure with Lexa text files ). You can try creating a small text file and then load it into the internal text array to see how the function works with user-defined text. 

 Ctrl-I  Insert system date into date field   Assuming that the current field in a record which one is editing is of type "date", the system date (from the computer’s internal clock) is entered into the field. Only possible when editing a record. 

 1.2.3.5.	Record duplication 

 Ctrl-D  Duplicate current record  Duplicates the current record at the end of the current database file and enters the edit mode automatically. 

 Alt-D  Transfer current record to other database.  The same as the previous command but with the difference that the record is transferred to the other database. This works in both directions, i.e. either 1 - 2 or 2 - 1. The only precondition on this command is that the structures of both databases be identical; if not then an error message to this effect is issued. 

 1.2.4.		Searching records 

 Ctrl-F  Find field contents This is the option which you choose if you wish to comb through the records of a database for a search string and not through an open index. It corresponds to the locate command in the dBASE environment. 
	On pressing Ctrl-F a picklist with the fields of the current database appears on the right of the screen. You choose a field for the search operation and press Return. Then an input window opens where you enter the contents of the particular field which you wish to locate. Again terminate this by pressing Return (pressing Escape at any point leads to the entire operation being cancelled). 

 DbStat attempts to find a match for the string entered from the current position in the database onwards (to comb through the entire database go to the top by pressing Ctrl-PageUp to begin with). If the search is successful the screen display is refreshed to show the record with the string in it, otherwise a brief message is issued and nothing else changes. 
	Notes The search method in DbStat is non-exact which means that you only need to type as much of the field as is necessary to delimit it from others. Say you are looking for someone called "Fitzgerald" in an address database then entering "Fitzge" as a search string is probably enough to locate the record successfully. Note that here non-exact search still distinguishes between upper- and lower-case, i.e. in the above example entering "fitzge" will not lead to a find even if there is an entry "Fitzgerald" in the database (unless search is case insensitive). 

 Ctrl-R, N  Repeat search The idea here is that a search is repeated with the same values for (i) the field to be searched through and (ii) the string to be found, without the necessity of entering the string and specifying the field again. The search continues from the present record. After you specify a string and choose a field with Ctrl-F, pressing Ctrl-R repeatedly will then show you all the finds for the string in the current database. 

 Alt-I, F Find record via index This is essentially similar to the locate command just described. Here the index is searched through. As the latter contains the contents of just one field there is no set of fields to choose from. Searching via an index is the fastest of all searches and should be used before all others. 

 Alt-N, R  Repeat index search.  Continues an index search from the point where the index pointer is currently located. 

 Ctrl-L  Determine field for letter search Letter search is a facility included in DbStat with which you can search for the contents of a given field. The special feature of letter search is that it begins to comb through the current database from the first letter you type, jumping to any record which may show that letter in a certain field. Just what field is to be examined for letter search is determined via the present key combination. 
	If an index is active this is used for letter search automatically. Letter search through an open index precludes field determination as only one field is available, namely that of the index keyfield. 

 Space  Start letter search When in the paging mode (i.e. not editing a record) pressing the SpaceBar activates the letter search command. In combination with an open index this is the most effective and rapid means of finding a record. The principle is as follows. You type a single letter. DbStat finds the next record in which this letter is the first letter of the index keyfield. Type a second letter. The next record with both the first and second letters as the initial two letters of the index keyfield is found and displayed. Carry on until you have found the record you want. 
	If there is more than one record with the string you have just typed, press Return to continue to the next find with these initial letters. 
	The record pointer is only re-positioned if you terminate the letter search command with Ctrl-Return. Pressing Escape leaves you at the record from which you activated the command. 

 Note Should an index not be currently open then pressing the SpaceBar for letter search before having chosen a field for search leads to the field picklist appearing from which you can select a field. 

 Alt-S  Treatment of strings with filters and searches. When entering a string to be used for a record filter or for either an index search or a linear search (without the use of an index) you can force DbStat to (i) only match field finds which are exact matches of the string entered, (ii) match any field in which the string typed by the user is merely contained (non-exact) and (iii) force matching of a user string to begin with the first character in a given field (here substrings must match from the beginning of a field). 

 Note The treatment of user strings can be re-specified as often as you like during database processing. Use Alt-S to check on or change the current values. By default, searching and filtering is non-exact and does not require a match to start at the beginning of a field. 

 1.2.5.	Filtering records 

 Ctrl-F2  Conditional replace operation. At any point during database processing you can opt to replace the contents of a certain field. There are two commands for this which differ slightly. The current option requires that a certain string be found in the chosen field before the replace operation takes place. It works just like the find and replace option in a word processor. You may specify whether user confirmation is required for each replacement or not. To abort the command just press Escape. Note that the find and replace strings are echoed at the bottom of the screen. 

 Alt-F2  Unconditional replace operation This is a global replace operation. It is irrelevant what the contents of the selected field already are. However you can choose confirmation of replacement here as above so that not every field need have its contents altered. 

 Ctrl-F3  Blank out records. Here you are offered a pick list from which to choose from. You may choose to display those records which are marked for export or for deletion; or you may have those records displayed which are not so marked. Blanking out only affects the navigation keys and can be overridden by jumping to a record, or by appending a new record. 

 The tick in front of an option indicates what type of blanking out is already active. If you do not want a change, press Escape. Otherwise choose a new type. The last option counts the number of matches for a currently active filter. 

 Alt-F3  Activate or remove filter for current database A filter is a condition or set of conditions, specified by the user, which must be met by the records of a database in order to be displayed. With the present key combination the user can determine what kind of filter is to be operative. Should a filter already be active then this keystroke de-activates it. 
	The minimum of information for a filter is (i) the selected field and (ii) test contents. Filters may be complex, consisting of up to three parts. If more than one part is required then the two parts must be connected by a logical operator. There are three possible operators in DbStat: 

(i)	and	
(ii)	or	
(iii)	and not 

 Once you have entered the contents for one field, you are asked by DbStat if you wish to continue; if you answer affirmatively, one of the three connectors must be chosen to link parts of the filter expression. 
	When you have entered enough information (or have reached the limit of three parts) you are asked if you wish to save the filter to file. An affirmative answer requires that you enter a valid file name. Note that there is no extension necessary here (the extension .EXP is supplied automatically by DbStat). Furthermore no confirmation of overwriting an existing expression file is required. 

 A string for a character field can be up to 30 characters long; case sensitivity can be toggled with F3. 
	Should the field you choose for a search be numerical then you are first requested to specify what mathematical operator is to be used when comparing the contents of a record field and the number which you are about to enter. A small picklist appears from which you select an operator. 
	When you leave the filter specification level the record pointer is automatically positioned at the first record which matches the filter just set. If there is no match then the last record of the database is displayed. In this case your computer may appear to have hung. This is not so. It is simply the case that the record pointer cannot be repositioned as there is no match for the current filter. To remedy this situation, press Alt-F3 again (this deactivates the filter) and you can view all records of the database once more. If the wrong filter was due to a typing error or whatever you can re-specify it via Alt-F3. 
	A filter effects the behaviour of the following navigation keys: [Ctrl-] PageUp,  [Ctrl-] PageDown 
	You can override a filter by moving to a record which does not comply to the filter by any means other than with the above keys. For instance you can activate the browse mode and choose a new record. This is then displayed irrespective of whether it matches the filter or not. Of course, if you press one of the above navigation keys then record display is made to conform to the condition(s) of the filter. 
	If a filter just involved display it would not be of very much use. It becomes interesting to users when one considers that one can extract the records of a database which match a filter and store them separately. To do this you need to take two steps. 

 	Mark all records which match the filter with Ctrl-E. 
	Export these records to a new database file with Alt-F8. 

 This leaves you with a new database which consists of those records which match the currently active filter. The structure of the new database is identical to that of the original database. Note To check on how many records match the current filter (without marking them), press Ctrl-F3 (Blanking out of records, see above) and choose the appropriate option in the picklist which appears. 

 Ctrl-F6  Diskload filter Filter expressions are stored to disk with the extension .exp. The present option activates the directory lister, showing all the files in the current directory which share this extension. If you select one then it is read by DbStat and, assuming that it is a valid expression file, a filter is set on the current database using the information in the file. To check on a filter press F6. Note Filter expressions in DbStat are stored to disk as a character string in the dBASE format (used with the command set filter to). The advantage of this is that a dBASE or Clipper application can read this expression file and use it accordingly.  

 Ctrl-Y  Count matches Assuming that you set a sensible filter for the current database then only a subset of the total records will match this. To check on just how many, press Ctrl-Y; DbStat counts the matches and echoes this at the bottom of the screen, press a key to continue after the count has been completed. 

 1.2.6.	Marking records 

 Alt-E, Tab  Mark record for export Simply marks the current record for export. Note that in the top righthand corner of the screen the reference Exp. appears when you mark a record (or move to a record which is already marked). The current key combination is a toggle, pressing it when a record is marked leads to the marking being removed. 

 Ctrl-E  Find matches for filter and mark for export. Assuming that a filter has been set (see above) the present keystroke finds the matches for the filter and marks them for export. When marking is completed DbStat reports on the number of matches found. 
	If you just want to find out how many records match a filter (without marking them) them activate the window associated with blanking out records (press Ctrl-F3) and choose the option Filter Matches. 

 Ctrl-M  Mark (i.e. tag) empty records for deletion. The present command is a help when ridding a database of empty records. It works by checking the first 3 fields of each record in the current database. If these are found to be empty, the record is marked for deletion. Should you have records with contents and which may for some reason have nothing in the first 3 fields then do not use this command. 

 Alt-C  Clear marking for export Assuming that you have marked at least one record in the current database for export, the present key combination clears the marking. You must confirm the erasure (as you may have gone to considerable trouble to mark records). 

 1.2.7.	Deletion commands 

 Ctrl-T, Delete  Tag for deletion. In any dBASE compatible database the first byte of each record is a so-called tag byte which keeps track of whether the particular record is tagged for deletion or not. If the value of this byte is ASCII $32 (i.e. blank) then the record is not tagged; if it is ASCII $42 (i.e. an asterisk, *) then the record is marked for deletion. Bear in mind here that the record is only tagged for deletion. To actually delete records from a database the dBASE pack command must be executed. This is available on the desktop (see option Delete Tagged Records). When editing a database with DbStat one can toggle marking for deletion by pressing Ctrl-T or Delete. If the record is already marked the tagging is removed, if not it is added. You notice this by the message [Del.] appearing in the top righthand corner of the screen. 

 Ctrl-Z  Zap all fields of current record.  Deletes the contents of each field of the current record to allow one to start afresh. As you are editing a database directly with DbStat you must confirm zapping. There is no undo feature during direct database editing so watch what you are doing. 

 Ctrl-W  Wipe tagging for deletion from all records.  Here you can remove all the tagging for deletion throughout the current database. User confirmation is required before the command is carried out. Bear in mind that, once wiped, the tagging can only be regained by manually marking each previously tagged record again. 

 Ctrl-X  Filter delete This command is identical to that activated with Ctrl-E but that records are tagged for deletion instead of marked for export. The option is useful when removing old records from a database. Say you have a database with a date field then by means of a filter you could have only those records displayed which have a value earlier than a certain user-specified date and then tag these for deletion, packing the database from the desktop later on. 

 Ctrl-F9  Count records tagged for deletion. Counts the total number of records which are currently marked for deletion in the present database. 

 1.2.8.	Editing database text files 

 DbStat allows for the editing of two types of text file directly associated with a database. The first is a so-called memo file (with the extension .dbt) which can be created by a dBASE or Clipper application or directly by DbStat itself if you specify that a field is to be of type memo when generating a new database (see relevant section below). 
	The second file is any text file the name of which is deposited in a field FILE_NAME. DbStat does not require a pre-defined file structure in this case as it does with a memo file. 

 Alt-M Edit memo field Assuming that there is a field of type memo in the current database and that a corresponding file with the extension .dbt can be found and opened then the text editor is activated and you can enter any text to be associated with the current record. When you return to database editing via F7 then you are prompted to save the text in the current memo file. If you do not then the changes to the text are lost. 
	On saving the text the memo file is updated as is the offset number for the location of the text stretch for the current record. For this reason the digit which is to be found in the memo field of the database may change; this is of no significance to the user. You can use the supplied test database MEMO.DBF to see how this option actually works. 

 Ctrl-F5 Edit record text If there is a field called FILE_NAME in the current database then DbStat attempts to load the file name which is contained in the field. Of course this assumes that there is such a name as contents for the field. If the field FILE_NAME is empty then the default file dbstat.tmp is opened (created or loaded). It is not necessary to save the file every time you exit to the database editing level, only when you wish to load a new file. 
	Note that the essential difference between the two text editing commands discussed here is that the ‘memo field’ option uses a single text file for the entire database, whereas the ‘record text’ option allows users to name individual files for each record (if required). Should you specify the same file for different records then it is loaded repeatedly. This does not influence the operation of the text editor in any special way. The net effect is that you append text data to one and the same file on different occasions, i.e. when loaded from different database records. 

 1.2.9.	Exporting to disk 

 Ctrl-F4  Specify output for record export.  Normally output of an export operation is to the internal text editor in DbStat. However, if for some reason you wish to have output sent to a disk file then you can specify this with the present option. You are asked to supply a valid file name which is later used as a capture for export output. With F6 you can check on the current setting for export target. 

 F6  Export, index information Various items of information are presented here, e.g. the number of marked records and information on index management. 

 Once you have looked at this window you should press a key as prompted. You are now presented with a second window in which information concerning the currently active filter is presented. If no filter is set then a brief message to this effect is issued. 
	Note that you can save the filter to a text file at this point by pressing F10. The extension .exp is supplied automatically by DbStat. This filter expression file can be loaded and used at some future date. 

 Shift-F6  Select report form On pressing this key combination you are presented with a directory listing from which you can choose a report form. Only those files with the extension .rep are shown (this is the extension which ReportDb uses for report forms). If there is no appropriate file in the current directory then by pressing F8 you can, via a disk tree, change to a directory where a form is located. Note If you press Escape at this point, then no report form is chosen. This means that on export the contents of each record are exported exactly as they occur, i.e. with one line in the ensuing text file occupied by the contents of one field in each record with each field represented once but only once. 
	For details of what report forms are and how they are generated see the section on ReportDb below. 

 F8  Export current record The simplest means of getting the contents of a record into a text is to move to the record (via PageUp or PageDown during database editing) and press F8. If a report form has been chosen (check with F6 to see if this is the case) the contents of the current record are exported to the current text file according to the form; if none has been selected the record is exported on a one-field-per-line basis. Note If on exporting no text is currently loaded in the text editor, you are at first presented with a directory listing from which you may select a file to receive the contents of the database record(s). If you press Escape at this point a new file, as always, is created (default name: dbstat.tmp) and the record is exported to it. Should you choose a file then the record contents are inserted at the beginning of the file. However, if you already have a file in the text editor then the record contents are deposited in this at the cursor position. Bear the latter fact in mind. Should you have a particular wish about where the record contents are to be placed in the text, move the cursor to this position before starting the export operation. 

 Shift-F8  Export only marked records Records can be marked via Alt-E or Ctrl-E (if a filter is active). When you have decided on what records you require from a database in a text you press Shift-F8 and the marked records are inserted in the currently loaded text file at the cursor position. 
	Assuming a report form has been used the results could look something like the print out below. Here the number of each record is printed to begin with, then a little free text, after this the contents of certain fields, the current date and time and a concluding line. The procedure is repeated until all marked records in the database have been exported to the text file. Note (i) not all fields of each record have been included in the text, (ii) a particular field (2) occurs twice in the text for each record and (iii) a particular field (4) appears in both a trimmed form (trailing blanks removed from the database field) and in a non-trimmed form (record contents plus as many blanks as are necessary to reach the length of the field, in this case 30 characters). 

 Note The export algorithm always combs through the entire database for marked records. Bear this in mind, i.e. the usual rule that an operation only applies from the current position in a database (e.g. during field search) to the end does not apply here. 

 Ctrl-F8  Export entire database This is as simple as it sounds. Every record is affected by the export operation starting from the beginning of the database. You may press Escape to terminate the export operation prematurely if you wish. 

 Alt-F8  Export marked records to new database This command allows one to export all the records of the current database which have been marked to a new database. The structure of the current database is duplicated and as many records as are marked are exported to the newly created database. The name for the latter is specified by the user on activation of the current command. 

 Alt-F10  Export specific field from each record to text file Among the export options of DbStat is the present one which very simply takes the contents of the field the cursor is currently resting on (starting from the first marked record in the database and continuing to the last one) and exports it to a text file, trimming the field contents as it does so. The result is a text file with as many lines as there marked records in the current database. No delimiters are inserted into the text file. The name of the file generated is entered by the user before the operation commences. 

 1.3.	Statistical computation 

 Preamble. The set of options gathered together here have all to do with statistics and thus form the core of DbStat. They can be organized into three groups: 

1)	Tests which involve (two) sets of data.	(Alt-F1) 
2)	Options for determining central tendency.	(Alt-F4) 
3)	Options for preparing or arranging data.	(Alt-F9) 

 All of these can be reached at the bottom of the first menu in the picklist system which is activated by pressing Shift-Tab or Alt-Return when paging in the database (i.e. not when editing a record). 

 Users should bear in mind that the description of commands given below simply refers to how these operate in DbStat. If in doubt as to what a certain test or calculation is intended to achieve, consult the glossary at the end of the book or a book on statistics (see the references section, again at the back of the book). 

 1.3.1.	Measures of central tendency 

 All the options in this menu (activated via Alt-F4) only require a single list of numerical data. The latter is constructed by DbStat by combing through the field on which the cursor is currently resting, starting with the first record. This record may not necessarily be number one in the database: if a filter is active then it is the first record which matches the filter. Check on an active filter (and its conditions) with F6. 

 Note If the cursor was resting on a non-numeric field before you activated this menu then an error message is issued and nothing happens. 
	Assuming that a successful calculation has been carried out, the bottom lines of the screen change and the result is displayed. 

 Once you have registered this you can press any key. You are then asked to take one of three courses of action: 1) Do not store calc, 2) Save to disk file, 3) Put in clipboard. If you opt to store the result in a file one of two situations arises. Depending on the setting for file save mode (see the last option in the Organization menu), the result is either (i) appended to the file used to save calculation results or (ii) a new file is created to store the result. In the latter case, and in the former when you are saving a result for the first time, you must specify the name for a file to deposit the calculation result in. Should you have chosen to create a new file then you must confirm overwriting any file which might correspond to a file name you enter on being prompted by DbStat. Bear in mind that pressing Esc aborts the entire operation. 
	Depositing a calculation result in the clipboard makes it available for further viewing and importation into another field. This is done by choosing the option View clipboard in the Organization menu and then transferring the result to the field the cursor is currently resting on. 

 1.3.1.1.	Global calculation 

 When presented with the calculation menu above you may, as prompted at the bottom of the screen, have all statistics calculated. For this press Ctrl-F5. 

 Note here that the value for the mode is not automatically calculated unless you press Alt-F5. The reason for this is that the mode requires considerably more time to calculate and if you have a large database then you might be kept waiting longer than you desire by the system you are working on. 
	Once you are presented with the above screen you can press any key and are then asked if you wish to save the results to file much in the manner found with single calculations. If you answer affirmatively, then an additional file is generated with the extension .bar in which a horizontal bar chart is deposited which gives a visual indication of the distribution of values in the field used for the calculations. This operation is identical to that carried out by CalcStat after a global calculation (see the relevant section below). 

 1.3.1.2.	Manner of calculation 

 Three main points should be borne in mind by users regarding all types of calculation possible with DbStat. 

1)	All calculation is done to a precision of 4 decimal points. 
2)	Calculation is always sensitive to a possibly active filter. 
3)	An open index may collide with a calculation as the index 
	determines the order in which records are examined. 

 The second fact can be of benefit if used judiciously. Consider the following example. You want to execute some statistical computation on the contents of a certain field but know that the extreme values of the range are not typical as most of the values cluster around a middle value. For argument’s sake, assume that the lowest value in the particular field is 27, the highest 146, but that most values lie between 60 and 90. You could now set a filter on the database such that values of under 60 and over 90 for the field in question are suppressed. This would mean that measurements of dispersion such as interquartile range and standard deviation would give a more accurate picture of the data in the database field. 
	Remember whether you have an open index or not. Say you wish to carry out a calculation on a numerical field which should not be ordered. If an index is open for this field then, assuming that the index is up-to-date, the records will be arranged in numerically ascending order for this field, i.e. the values in the fields will be in an order from smallest to largest which is not what one desires. The solution to this is to exit to the desktop and re-load the database without an active index. 

 1.3.1.3.	Using the calculator 

 To allow users to carry out calculations directly a desktop calculator has been included with DbStat. The principle behind its operation is quite simple. You press Alt-F5 to activate the calculator. Assuming that the field the cursor was currently resting on is numeric or an alphanumeric field with a number in it, the value in this field is transferred to the calculator. You may now use this for a calculation. 
	Once you have finished you may terminate by simply pressing Esc or by using Ctrl-Return. The advantage of the latter is that the result of the last calculation is now imported into the current field of the database (assuming that this is either of type numeric or character). 

 In effect the calculator used here is a reduced version of the desktop calculator CalcStat. Consult the section on the latter below for operational details. 
	For this option to function the file _calc.exe (the actual calculator) must be present in the DbStat home directory or be accessible via the DOS path variable. If this is not the case then an error message to the same effect is issued and nothing happens. 

 1.3.2.	Tests on sets of data 

 For inferential statistics two sets of data are always required. Three possible relationships may obtain between these. 

 1)	One set may represent a set of expected values and the other a set of 
	observed values. (Chi-square) 
2)	The two sets are possibly correlated. (Pearson, Spearman) 
3)	One set may be a sample and the other the parent population from 
	which the sample is putatively drawn. (Mann-Whitney, Wilcoxon, Sign-
test, F-test) 

 The various tests available here (activated via Alt-F1) are intended to cover instances of the relationships outlined above (the names in brackets refer to the tests used for the relationship in question). 
	To initiate the computation for any of the statistical tests in DbStat the user must first of all choose the menu Tests on sets and then select the test required. 
	As all the tests of the current menu require two sets of data, two fields must be specified from which to take values for the internal lists which DbStat then constructs for calculation purposes. You may specify that both fields be taken from the same database or from different ones. In the latter case there must be two databases currently open, in the former case the current database must have two (different) numerical fields. 
	Furthermore for tests of expected distribution and correlation, i.e. for the Chi-square and the Pearson and Spearman tests respectively, the number of records per database (if different ones are chosen) must be the same, if this is not the case an error message is issued and the system aborts the operation. 

 1.3.2.1.	Chi-square 

 Definition.  A test of the goodness of fit of an observed set of data vis à vis an expected distribution (going on some hypothesis or model of data). In general a small value means that the data fit the distribution well, a large one that they do so badly. 
	This first test, and probably one of the most important for linguists, is the Chi-square test. Here two fields must be specified which exhibit the same number of values. After the computation has been made, the user must compare the result with the critical value for Chi-square with the given number of degrees of freedom and at a certain significance level (say 5%). If the computed result is greater than the critical value then the null hypothesis can be rejected for the chosen level. Note The first field which is chosen is that which is used for the expected values while the second is that examined for observed values. 

 Supplied sample database(s):  CHI_SQ_1.DBF, CHI_SQ_2.DBF 

 1.3.2.2.	Pearson’s product moment correlation coefficient 

 Definition A measure of linear association between two sets of data. It is parametric by nature and assumes normal distribution. Suitable for interval and ratio variables. 
	Recall that a correlation coefficient is a measure of association between two random variables. The values which it can assume lie between -1 and +1, these extremes corresponding to perfect negative and perfect positive correlation respectively. 
	The current test should only be applied to data which consist of sets of values of the ratio or interval type. Such data have equal differences between any pair of variable values, the zero point being fixed for ratio and arbitrary for interval scales. Note If you get a value of less than -1 or greater than +1 for the coefficient then re-examine your data for test appropriateness. 

 Supplied sample database(s):  PEAR_1.DBF, PEAR_2.DBF 

 1.3.2.3.	Spearman’s coefficient of rank correlation 

 Definition A measure of association between two sets of data based on rank orders and not on variable values (contrast the Pearson test). 
	If there is a non-linear relationship between variables then the variables themselves are not given values but their rank orders and then an appropriate test is used. The Spearman coefficient of rank correlation is such a test. Again like the Chi-square it is frequently applied in linguistics because the nature of the data often does not allow a test based on ratio or interval data. 

 Supplied sample database(s):  SPEAR_1.DBF, SPEAR_2.DBF 

 1.3.2.4.	Standard error 

 This is simply the standard deviation of a given parent population divided by the square root of the sample size, i.e. Standard Error = sigma / . Within DbStat the first field chosen is assumed to be that of the sample and the second to be that of the parent population. This also applies to the determination of the following two scores. For large parent populations (over 30), for which a normal distribution can be assumed, the standard error is quite useful and can be calculated without necessarily consulting relevant statistical tables. 

 1.3.2.5.	T-score 

 The t-score is computed for samples with a relatively small number of values (less than 30) where a normal distribution cannot be assumed. The result returned here must be compared with the critical value for the number of degrees of freedom which apply at a chosen significance level. It assumes that one knows: size, mean and standard deviation of both samples; these values are computed by DbStat when the user specifies what two fields are to supply the values of the two samples. 

 1.3.2.6.	Z-score 

 This test compares a sample with a population and suggests whether the former has been drawn from the latter; the population mean and standard deviation must be known (these are computed online by the Z-score function). Assuming that the distribution of both sets of data is normal (both that of the sample and that of the population, i.e. of the first and second field for the computation respectively) a standardized score can be calculated with the current option. 

 1.3.2.7.	Generate Z-values 

 This option generates a standardized value for each value in each field of the records examined. Standardization is achieved by subtracting the mean and then dividing the result by the standard deviation. The results of the operation are stored in a file called z_score.txt. 

 1.3.2.8.	Mann-Whitney U-test 

 Definition A non-parametric test of the null hypothesis that two samples are drawn from the same parent population by using their combined rank values. 
	This is another double field test. After computation, DbStat indicates two results: the first is that for U1 and the second for U2. It is necessary to check these values against tables for the U-test. Here the smaller value (U1 or U2) is taken. Bear in mind whether your test is one- or two-tailed. The values for U differ accordingly. 

 Supplied sample database(s):  MANN_1.DBF, MANN_2.DBF 

 1.3.2.9.	Wilcoxon matched-pairs signed-rank test 

 Definition A non-parametric test of the null hypothesis that two matched samples are drawn from the same parent population. 
	This is a non-parametric test which assumes that it is possible to rank the differences between pairs of observations (while ignoring differences of zero but taking the sign into account). The sum of the ranks with the smaller total is taken as the test result and this is compared with the critical value in a table of values for the Wilcoxon test (with a certain number of degrees of freedom). If the result of the test is less than the critical value then the null hypothesis is rejected for the chosen significance level. 

 Supplied sample database(s):  WILCOX_1.DBF, WILCOX_2.DBF 

 1.3.2.10.	Sign test 

 Definition A non-parametric test of the null hypothesis that two matched samples are drawn from the same parent population. 
	The current test is slightly less powerful than the previous one as it does not take the magnitude of the differences between variable values into account. In cases where magnitude difference cannot be attributed any acceptable meaning the sign test often remains the only recourse for a statistical computation of the null hypothesis. 

 Supplied sample database(s):  SIGN_1.DBF, SIGN_2.DBF 

 1.3.2.11.	F test 

 Definition A non-parametric test of the null hypothesis, applied to the variances of two samples, that both are drawn from the same parent population. 
	Testing for homogeneity of variance is a very broad field. In DbStat there is only one test for this, namely the current one which is quite basic. It derives from computing the F statistic which is the ratio of the larger to the smaller variance with two samples, here: the contents of two fields in one or two databases. The value computed must be compared to a table for the F distribution, going on the number of degrees of freedom which apply to one’s test and on the significance level chosen for the test. 

 Supplied sample database(s):  F_TST_1.DBF, F_TST_2.DBF 

 Note For more information on the text files created by DbStat during statistical computations, see the appendix Text files generated by DbStat at the end of the present volume. 

 1.3.3.	Organization 

 This set of options (activated via Alt-F9) consists of a number of useful operations which are frequently necessary when carrying out statistical work. The output of most of the operations is a text file which can then be re-imported into another or the same database for use in some later computation. 

 Rank file, unsorted This is the first of two options which creates a text file in which the rank orders of each field value are listed along with the latter in a two column table. The file generated always has the name rank_lst.txt. 

 Rank file,sorted Here a similar two column table is generated. The essential difference is that the list is sorted. The field value column is arranged in ascending numerical order. The rank order column is also in ascending numerical order, starting at 1 and ending at the number which is equal to the total number of records. 

 Note All tied scores in a rank order column are averaged going on the number of scores which share this value, e.g. if there are 4 field values of 120 in a database with the rank positions 4,5,6,7 then the rank positions are assigned the value 5.5, i.e. 4+5+6+7 / 4. 

 Sort numeric field The current option simply sorts the (numeric) field the cursor is presently resting on and stores the result in a text file called sort_lst.txt. The contents of this file can be re-imported into a database if required. 

 Import text -> field This allows one to import values from a text file table (single-columned) directly into a database without the necessity of exiting to the desktop and closing the database. Useful in conjunction with the previous option. 

 Make interval list It is not infrequent that the values from a database field show too great a range for sensible statistical computation. The present option permits the re-arrangement of the data in class intervals. First of all one must specify the value for the interval to be used. Then DbStat examines the data in the field in question and, going on the interval specified, generates a text file with the class intervals listed and certain frequency values as well. The text file created in the process is called interval.txt. 
	The maximum number of intervals which can be plotted for any single list is 128. Say you are processing a list with a minimum of 12 and a maximum of 2400 and you specify an interval of 2. DbStat will refuse to carry out this calculation because 128 intervals of 2 starting from 12 will only go as far as 268, i.e. 12 + (128 * 2). The solution here is to choose a larger interval, e.g. 20 which can reach up to 2578, i.e. 12 + (128 * 20), a figure which lies well beyond 2400. 

 Do frequency list For a variety of purposes a frequency list of the values in a database field is useful. Here DbStat generates such a list, storing the frequencies (absolute, relative and cumulative) in a file called freq_lst.txt from which data can be retrieved at a later stage. 

 Show field range Here you are presented with the range for the field on which the cursor is currently resting, assuming that this is numeric in type. Before computing the range value, DbStat asks if values of zero should be ignored or not. The idea behind this is that a value of zero is more likely to be due to an empty field than to a field in which the value of a variable at that point was indeed zero. 

 View clipboard At the bottom of the screen the current contents of the clipboard are shown. By pressing Ctrl-Return you can import the value in the clipboard into the field the cursor is currently resting on, assuming that this is either numeric or character in type. 

 Set file save mode All text files which are generated by DbStat are by default opened in the so-called append mode. By this is meant that if a file is found with the same name as that specified by the user then the results of a computation are appended to the file. However, you can override this and force DbStat to create a new file each time you save a statistic to disk by choosing the relevant option in the menu which appears at this point. In this case you must confirm overwriting an existing file if one is found in the current directory with the same name as that entered by the user. 

 Send field to text Among the export options of DbStat is the present one which very simply takes the contents of the field the cursor is currently resting on (starting from the first marked record in the database and continuing to the last one marked) and exports it to a text file, trimming the field contents as it does so. The result is a text file with as many lines as there are marked records in the current database. No delimiters are inserted into the text file. The name of the file generated is entered by the user before the operation commences. 

 

 1.4.	Miscellaneous commands 

 F1  Help  An on-line help facility is available in DbStat. For this command to function correctly the files dbstat.hlp and dbstat.ind must be accessible to DbStat. 

 F9  Environment The environment command offers one a screenful of useful information on the system environment one is working in and some information on how DOS sees the database file one is processing. 

 Ctrl-F1  Load DOS shell This loads the operating system (the effect is that you are transported to DOS) from which you can carry out smaller tasks such as file copying, directory listing or whatever. Bear in mind that DbStat is in the background so that something around 300K of system memory will be occupied by it. Typing exit returns you automatically to DbStat and you can pick up where you left off. 

 Alt-F7  Return to desktop. As the command for exiting DbStat entirely is F7 the variant Alt-F7 is used to exit from the edit screen to the desktop to avoid accidentally landing in DOS by pressing the F7 key slightly too long. 
	You will have noticed that when you page in a database within DbStat your hard disk is accessed very briefly. The reason for this is that DbStat is disk-oriented and must find the position of a record on disk when you scroll to it with the PageUp or PageDown key. Furthermore, if you edit a record and exit with Return then DbStat saves the changes at the record’s position in the database disk file. This means that when you exit DbStat only the current record needs to be saved. Thus exit is swift; do not be worried about the brief access of the hard disk on exiting (compared with the access made on saving a text with a word processor). 

 

 1.5.	Create a new database 

 It is of course possible to make one’s own databases from within DbStat. In the desktop menu there is an option for this which is self-explanatory. You may choose a certain database as a model which means that the screen which appears is now filled with the structural information of the model database and needs only to be altered by the user. 

 There are five permissible field types when creating a database (see comments in 1.1.2. Treatment of field types). These can be viewed by pressing Return, and then SpaceBar, when the arrowhead is positioned before a field in the column Type. Note in this connection that if a memo field is specified (by inserting the letter M in the Type slot) then a second file with the same name as the database but the extension .dbt is also created on striking F10 for database generation. 
	Certain default values for the length of a field are adopted on choosing a certain field type, thus date fields are automatically 8 characters long, logical fields have a length of 1; a decimal place can only be specified if the field in question is numeric in type. 
	To enter information in the various slots, move the arrow around the screen with the cursor keys. When selecting a field type use the SpaceBar to toggle through the list of permissible types. Bear in mind that a decimal point is only legal with a numeric field type. 
	You create a new database from the structure you edit by pressing F10; you abort the operation via Escape. The structure is not retained when a new database is created (there is no structure file stored on disk). However, it can be retrieved again by choosing the new database as model when creating another database at some later date. 
	There is a limit of 80 fields per database constructed internally in DbStat. 

 F3  Store/retrieve field contents.  To avoid the chore of typing field contents more than once this option has been included. When you press F3 you are offered the choice of storing the contents (for all parameters) of the current field into an internal buffer, or retrieving the contents of the buffer into the current field should the buffer already have something stored in it. This facility is useful if you wish to copy a field to a different position in the structure of a database. Open a gap in the structure with F4, copy the contents of the field to be moved into the field buffer (with F3), move the cursor to the field gap and then retrieve the buffer into the empty field. 

 F4  Insert field into structure  To insert a field somewhere in the middle of the new structure press F4: an empty line opens at the present arrow position and all fields beyond this are shifted downwards by one. 

 Shift-F4  Remove field from structure To remove a field (i.e. compress structure), use Shift-F4. This is the reverse of the previous command and extracts the field at the current arrow position. 

 F5 Generate structure database This is an option which is not required within DbStat but which users working with databases in a dBASE environment might need. What it does is to create an extended structure database which is one with precisely four fields FIELD_NAME, FIELD_TYPE, FIELD_LEN, FIELD_DEC and as many records as there are fields in the structure you are devising. Each record of such a database contains the relevant information about the four parameters for each field. You can edit this extended structure database and later use it to generate a new database with the dBASE CREATE FROM command. 

 F10 Save database design Here the current design in the create database template is saved to disk as a new database which you can use with DbStat straight away by choosing it as a database to edit from the desktop. Bear in mind that a newly generated database contains no records. These must be added to the database with the append records command (activated by Alt-A during database editing). 

 

 1.6.	Delete records 

 This is an implementation of the dBASE PACK command. Like its progenitor, its requires that records be tagged for deletion in advance (during some database editing session, by pressing Ctrl-T for deletion tagging; any records which have been tagged for deletion are displayed with the reference [Del.] in the top righthand corner of the screen). You are requested to choose a database and confirm this final act of record deletion. After a disk access to read and write the database, a brief message indicates how many records have been removed from the source database. No additional database is created. 
	You may not delete more than 10,000 records at any one time. The number of tagged records in a database can be determined during editing by pressing Ctrl-F9. Bear in mind that deletion results in permanent alteration of a database (no undoing possible); user confirmation is required. 

 

 1.7.	Sort and indexing a database 

 1.7.1.	Sort database 

 This is an implementation of the dBASE sort command which allows you to sort a chosen database according to a given field or fields. A name for the target database must be specified by the user. He/she must also specify the fields (from a minimum of one to a maximum of four) to act as keyfield(s) during the sort. In addition to choosing the field(s) for sorting the user must convey to DbStat which of the four types of sort, which are presented in picklist form, is to be activated. 

 During the sort command sequence you are offered the opportunity of saving the current setup to file. It is this file which you would use when starting DbStat for an automatic sort at some later point. Bear in mind that for sorting to be successful there must be at least as much space left on your disk as the size of the input database as DbStat creates a temporary file during sorting which is as large as the database to be sorted. A maximum of 10,000 records can be sorted by DbStat. 

 1.7.2.	Which language? 

 By default, sorting in DbStat is according to the (extended) ASCII character set. This works fine for English but leads to difficulties with various European languages which, while present in the upper half of the ASCII set, are nonetheless not sorted correctly when the default sorting order is chosen. 
	To remedy this situation you can chose among 7 further languages in DbStat, all of which have different orders of additional symbols in their alphabets. 

 You may choose a language interactively with the present option or you may specify a language in an initialization file (see below). In either case all sorting and ordering of index entries follows the pattern of the selected language. 

 1.7.3.	Index database 

 Here you can index a database afresh. This is required at least once when you start using the database for the first time and later on if you (i) sort the records of a database, (ii) delete records from it or (iii) append records to the database (from whatever source) on the desktop. 
	The file name for the index which is proposed by DbStat is the same as that of the database to be indexed but with the extension .dbx. If you require any other name then this is the point at which to specify it. After determining the name of the file you choose a field which is to act as keyfield for the index. 
	In order to keep an index from using too much valuable system memory only the first 32 characters of a field longer than this are registered in the ensuing index file. This is ample to fulfill the task of an index, i.e. to find field contents instantaneously and to provide a sorted display of records. 

 

 1.8.	Shell, copy, delete 

 Make shell database If you wish to derive an empty database from an existing one then this is the option you should choose. In essence, the header of the source database is copied to a new file. The resulting database is empty of course. 

 Copy a database By means of the DOS copy command this option generates a simple copy of a database, which you choose from a directory, under a user-specified name. This is convenient when making a working copy of a database to experiment with. 

 Zap all records Deletes all the records of an existing database. The result is a shell (i.e. database structure but no records). Be very careful with this command as there is no way of undoing the deletion of all records. 

 Erase a database This deletes a database which you have chosen and confirmed for deletion. 

 

 1.9.	Field information 

 After choosing a database from a directory window in the usual manner you are presented with a window on the left of the screen with the fields of the chosen database listed. If there are more fields than fit on the screen pressing a key shows you another windowful until all fields have been displayed. 

 

 1.10.	Database statistics 

 With the current desktop option a screen opens on the left showing you the file size in bytes and the number of records in the database as well as the size of an individual record and the number of fields. 

 

 1.11.		Export, import 

 1.11.1.	Delimited and SDF text files 

 When transferring the data in a database to a text file, there are two basic possibilities: (i) each field is delimited by a user-specified character (e.g. some character not used in a field) so that a database manager when re-reading a file knows where to start and to stop reading information for a given field; (ii) each field occupies the number of characters on a line which the field is long in the database. If a field is not full in the donor database then blank-padding fills up the line to the next field boundary in the text file. When re-reading such a file a database manager uses the structure of the receiving database to determine how much of a line to read into each field of a record. 
	In both file types a single record occupies one line, terminated by a carriage return/line feed pair of characters. The file ends in ASCII $26 (Control-Z, the standard DOS end-of-file marker). Where databases have a lot of unused space the delimited file type results in a significant reduction in size as empty space is not included in the resulting file. 

 Export to text In order to allow the textual processing of a database this option has been included. What it does it to create a text file out of a chosen database. Users should be aware at this point that a database can be converted into one of two basic types of text file. Either into (i) a system data format (SDF) or (ii) a delimited text file. The difference between the two is basically this: with (i) the contents of each field are transferred to text and as many blanks are added after this as are necessary to reach the length of the field in the database, say you had the word "London" in a field called CITY and the latter was 16 characters in length in the database then the word "London" would be inserted into the text and 10 spaces added after it. Thus when a database management system is reading an SDF file into a database it always knows where the contents of a certain field begins as the (final) column number of a field in the text line corresponds to the length of the field for the database. 
	With (ii), "delimited" text files, a certain symbol is necessary to mark off the beginning and end of a field. Here there is no need to pad field contents with blanks as the database system which reads such a file afterwards can tell, going on the field delimiter, where a given field begins and where it ends. This second type of file has the advantage of smaller size vis à vis the SDF file (there are no superfluous blanks in the former file). 

 Both types of file stick to the rule that exactly one line of text is used to contain the contents of just one record from the database. This may lead to very long lines in the text file if the record size of the donor database is large. 
	Take care with the questions you are asked with this option. If you answer "no" to whether you wish to right trim each field then an SDF text is generated; with "yes" a delimited text is created, i.e. one with the blanks removed from each field. In this latter case you must further specify the character which is to act as field delimiter. 
	In DbStat you are asked, after having specified a name for the text file, whether each field is to be right-trimmed. Answering "no" implies that you wish to have an SDF file generated and text file creation begins. Saying "yes" at this point leads to a further question, namely what delimiter you wish to have used (as you are right-trimming each field). 
	Either an SDF or a delimited file can be read into another database system as this is the most common format for database information transfer between systems. 

 Field selection Frequently the wish arises to transfer data from one database to another one with a completely different structure. This is a simple operation with DbStat. All it involves is exporting the records of the source database to a text and then importing the latter into the target database. The text file generated here will have the field contents of each record arranged in such a way that these are automatically imported correctly into the target database, irrespective of how different the structure of the latter is from that of the source database. 
	What the user must do is to determine the order in which the field contents of source records are to be placed in the text file to which they are exported. This is done by marking the fields of the source database (via a popup window) in the order in which one wishes to have them subsequently. In addition, it is possible to insert empty fields (these are written as sequences of two delimiters in the text file) and you may repeat any field from the source database and of course have any field or fields ignored during text file generation. The order in which you place fields should agree with the order in which these fields occur in the structure of the target database. It is this which ensures that importation from the text file is successful. 

 Note The text file for this operation is always a delimited text file. 

 Pack databases This option allows you to create delimited files from each of the databases in the current directory. The result is a considerable reduction in database size, useful where you wish to store many databases on a limited medium, e.g. a floppy disk. 

 Note The records of those databases affected by a pack operation are not deleted by this command. 

 Import from text The reverse of the above process. Appends records from a text file to an existing database (need not be empty!). Be careful to specify the right type of text being used for import or else the results are unpredictable. 

 Import from database After choosing donor and receiving databases, DbStat compares the two and, if identical in structure, appends records from the first to the second. The receiving database need not be empty. 

 

 1.12.	Set date format 

 The national date format within DbStat is of relevance at two points. The first is the representation of the contents of date fields during database editing and the second is the export of the contents of date fields into a text. In either case the format used is that which is chosen with the present option. Note that the default value is American, i.e. MM/DD/YYYY as in 01/01/1990, and is used if nothing to the contrary is chosen. Note that the setting for date format is independent of the language chosen for sorting and index ordering. A value for this parameter may be specified in an initialization file (see below). 

 

 1.13.	Miscellaneous 

 The remaining options of the desktop are self-explanatory. They concern the viewing, or editing, of external text files and of report forms which one may wish to use with DbStat databases. For these to function properly the programmes Lexa View, Lexa Text and Report Db must be accessible via the DOS path variable. 
	The last option of the initial window on the right of the screen is important if you want to access database files in a directory other than the current one. Choose the option and specify the new directory. The current drive can be changed as well by specifying it at the beginning of the full path of the new directory. Alternatively you can press F8 for Disk Tree when you activate a directory listing (with the first option of the desktop menu). 

 

 1.14.	Command line arguments 

 One simple parameter passed.  You can load DbStat and pass the name of a database to be loaded from the command line. This is obviously useful with batch files where you do not wish to force the user to choose a database. The name passed to DbStat must be that of a valid database; the extension .dbf is not necessary. 
	Note that DbStat does not check to see whether the name passed corresponds in its contents to a valid dBASE-compatible database: this is up to you to ensure. 

 Automatic sort with "/s" During the sort command sequence you will have noticed that you were offered the option of saving the current configuration to file (see description of this command above). 
	If you have saved your sort setup then you can use the file stored to disk at that point as the sort setup file here and, by specifying "/s" on the DOS command line, force DbStat to start, sort a certain file in a certain manner and terminate automatically again. 
	The advantage of this mode is that it can be called from a DOS batch file, making DbStat suitable for sorting databases without having to interactively specify parameters each time. 

 Notes If you start DbStat with just dbstat /s then the programme looks for a sort setup file dbstat.srt in the home directory of DbStat. Should you enter the name of a setup file after the /s switch then this is used. No path is searched for the setup file in this case so that if the latter is not in the current directory then the path must be part of the setup file name specification, e.g.: 

	dbstat /s-c:\data\setup.srt    (note the use of the dash after /s) 

 The extension .srt does not strictly speaking have to be entered as this is supplied by DbStat if it is not. 

 Expansion of packed databases with "/e".  This parameter causes DbStat to start, unpack any delimited texts into corresponding databases which it may find in the current directory. Be careful here as this can lead to unwanted effects. Note in this connection the following points: 
	Records from delimited texts are appended to databases (original contents of the latter are retained). 
	If there is no database to go with a certain text (the base of the file name must be the same in both cases) then DbStat skips this and tries the next text. 
	A file with the extension .txt is assumed by DbStat to a correctly structured delimited text file. If not, the results are unpredictable. 

 Note If you enter a file specification after "/e" then DbStat will only expand those databases which match the file template, assuming that there are two files with the same name and the extensions .dbf and .txt in the current directory. DOS wildcards ? * are allowed in the file specification. 

 

 1.15.	DbStat file types 

 The following is a list of the file types relevant to DbStat. Users should acquaint themselves with these at the very beginning so that, if one or other is missing, they can go about remedying the situation. 

1)	.DBF	=	dBASE compatible database; this is the data file 
			processed directly by DbStat 
2)	.DBX	=	Index file generated by DbStat 
3)	.SRT	=	Configuration file for a sort operation 
4)	.EXP	=	Filter expression as disk file (can be loaded) 

5)	DBSTAT.INI	=	Initialization file with setup information 

6)	DBSTAT.HLP	=	The text file for the help system 
7)	DBSTAT.IND	=	The index used for quick access of help texts 

8)	.DBT	=	Text file for memo field in dBASE format 
 
 File types not used by DbStat 

 1)	.NDX	=	dBASE index file 
2)	.NTX	=	Clipper index file 

 

 1.16.	Key settings in directory lister 

 F1  Online Help Offers you a screen with the commands which are available in DbStat. 

 F4  Get new drive Allows you to log in a new drive. Lists the (logical) drives available on your system. 

 Shift-F4  New file template Here you can enter a new template to have a selection of files from the present directory displayed. However, this only applies to the selection of a text to edit as in all other cases the extension of the file to be chosen is pre-determined. 

 F8  Activate disk tree Displays the structure of the present disk assuming that the structure file adirs.fil is present in the root directory (this is the same file as is used by DbStat and Lexa File along with other files from the Lexa group). If the structure file is not present, the directories are read and information pertaining to them is stored to disk. You can force a re-read of the current disk via Alt-F8. 
	Move the highlighting to the directory you wish to change to and press Return or abort the present operation with Escape. 

 F9  Show environment Presents you with the accustomed windowful of information on the present and original path, total size of disk and free space along with free system memory and current time and date. 

 Navigation keys 

	UpArrow, DownArrow		Up, down an item a time in listing. 
	PageUp, PageDown  		Up, down a windowful a time in listing. 
	Ctrl-PgUp, Ctrl-PgDn	Beginning, end of the directory listing. 

 Notes To locate a file quickly in a listing, type the first letters of the name and the highlight bar jumps to the next find immediately. 

 Return  Select the currently highlighted file in listing. 

 Escape  Abort operation or start a new file (when choosing a text file to edit). 

 

 1.17.	Command activation via picklists 

 There are two basic means of activating commands within DbStat. The first is that which has been discussed so far: the user presses a function key or combination of keys to start a command. The advantage of this method is one of speed, the disadvantage should be equally obvious: it is necessary to learn a large number of key combinations by heart. The menus can be activated during database editing by pressing Alt-Return or Shift-Tab. 

 What the beginner needs is a means of activating commands without knowing what keys are required. The solution to this dilemma is provided by a set of inbuilt picklists which are activated by a single keystroke. The user does not even have to remember what this is as it is continually prompted on the bottom of the screen. Indeed any of a series of keystrokes will do here. 
	Once a correct key combination has been pressed, a window will appear; this is one of eleven which can be selected by using the LeftArrow and Right Arrow keys. To move within a window use the UpArrow or DownArrow keys (or PageUp, Page Down) for the beginning or end of a list. 

 

 1.18.	Activating the text editor 

 One of the essential features of DbStat is its ability to convert databases to text with ease and grace by means of a predefined report form. For this reason users must read this section carefully. If you do not understand how this interface functions then DbStat will just be a database editor to you and nothing more. 

 Alt-T  Activate text editor Switches from database to text editing. If no file is currently in the text editor a directory listing appears from which you may choose a file to process. The text editor can also be called from the desktop. 
	To retrieve a file from the directory listing, press Return, to open a new file press Escape (as in Lexa Text). 

 Note If you have loaded or started a text and altered it (since saving it last) then you are prompted to save it before exiting DbStat to DOS. Replying affirmatively to the prompt conveys you to the text editing level from which you may save the text via F10 as usual. 

 Ctrl-F5  Activate text editor with record file Assuming that one has a database with a field entitled FILE_NAME and that one fills it with contents which represent a DOS file name (or a potential file) then on pressing Ctrl-F5 you move to the text editing level with the file loaded whose name has been extracted from the record field FILE_NAME. 

 Notes The file you specify in the relevant field can consist of a bare name or of a full file path (with drive and directory). 
	If you press Ctrl-F5 with a file already in the text editor (which you have altered in some way) then you are prompted to save this before the file from the current record is loaded (or created if not already existent). 

 1.18.1.	Text editing 

 The descriptions below are intentionally cursory as the commands are the same as those to be found in Lexa Text which are dealt with in detail in Vol.1 of the present documentation. Indeed the text editor in DbStat is in essence the editing core from Lexa Text presented in a deliberately simplified form. One facility in which the internal text editor of DbStat has the edge over Lexa Text is its ability to print texts directly (see below for details). 

 Notes The limit on the size of a text which you can load and process in DbStat is determined by the amount of system memory still available. Check on this by pressing the F9 key (for Environment). 
	If you export a database to text and there is not enough memory still free to accomodate the entire contents of the database then DbStat will issue an error message and break off the export operation when system memory is exhausted. In such cases you should re-set the target for export to a disk file. It is then irrelevant how large the output file is. 

 1.18.2.	Function key settings 

 F1  Help screen Gives a summary of the legal keystrokes in the text editor. 

 F3  Store/Retrieve Line Allows you to store the line the cursor is currently positioned on and to retrieve this later (at another point in the text). The contents of the line buffer remain unaltered even if you have switched to the database editor and back again. 

 Ctrl-F3  Formatting Shows spaces, tab characters and line ends. 

 F4  Mark/Copy Block Allows you to mark a block of text. Use the UpArrow, DownArrow, PageUp, PageDown keys to determine the size of the block (this is displayed in inverse video) and press F4 again to copy this into the block buffer (retrieval of the latter’s contents is via Shift-F10). 

 Ctrl-F4  Move Block If you terminate block marking with this key combination then the marked section is copied into the block buffer and deleted from the text as well. 

 Alt-F4  Show Block Buffer Displays the first few lines of the current buffer contents in a window on screen. Press any key to hide the window again. 

 F5  New File Calls the file manager in DbStat to allow you to load a new file. As always by pressing Escape when in a directory listing you may start a new file. 

 Shift-F5  Insert File Permits the insertion of one file into another (at the current cursor position). 

 F6  Undo Delete Allows you to retrieve the last piece of text which was deleted since you moved the cursor. 

 Shift-F6  Copy Previous Line Copies part or all of the previous line into the current one going on the position of the cursor (from there to the end of the line). 

 F7, Alt-Q  Exit Switches back to the database editor. Use Alt-T to enter the text editor again. 

 F9  Show Environment Offers a window with essential information on how much memory and disk space you have left, size of disk, current date and time, etc. 

 F10  Save Text/Block Stores the current text or block on disk under a user-specified name. You can determine the full path (drive, directory and file name) for the file before it is stored. 

 Shift-F10  Retrieve block Inserts the contents of the block buffer into the text at the current cursor position. You can check on the block buffer before copying it with Alt-F4. 

 1.18.3.	Navigation keys 

UpArrow, DownArrow		Up, down a line at a time 
PageUp, PageDown  			Up, down a windowful at a time 
Ctrl-PgUp, Ctrl-PgDn		Beginning, end of text 
Ctrl-RightArrow, -LeftArrow	Move Right, Left a word at a time 

Home, End		Beginning, End of line 
Ctrl-Home		Go to Line # 
Grey Minus,Plus	Up, down a half a screenful 
Ctrl-T			Set Tab width 

 1.18.4.	Deletion procedures 

Ctrl-R 	Delete word to right 
Ctrl-End	Delete to end of line 
Ctrl-L  	Delete current line 
Delete  	Delete character at cursor position 
Escape  	Cancel any initiated operation 

 1.18.5.	Find and exchange 

Ctrl-F 		Find string 
Ctrl-N 	Next find 
Ctrl-E  	Exchange strings 

 Note In the text editor in DbStat (as opposed to Lexa Text) you must specify if the search is to be case sensitive before entering the search string. If you wish to exchange strings then you must state whether the exchange is to be with user confirmation or not. You cannot search backwards in the DbStat text editor. 

 1.18.6.	Printing text from DbStat 

 F8  Print Menu DbStat allows for relatively flexible printing of texts. To achieve this you are presented with a screen on which various picklists are displayed. To set up printer features either use these menus or specify the necessary parameters in an initialization file and call this on starting DbStat. Most of the features on the following screen print-out are self-explanatory. However, a few require further comment. 

 1)  Print current page Page breaks can be entered during text editing by pressing Ctrl-Return (or entering $12 via the Alt key and a number on the pad to the right of the keyboard). In either case a row of double lines appears on the screen to mark the break. On printing via the present option, DbStat sends all text between two such page breaks to the printer. Note that if you have not entered any page break the entire text will be printed. 

 2)  Select printer If you choose either the laser or dot matrix printers then these are initialized with commands typical for each type. The "Standard" printer is distinguished by the previous two in that no initialization sequence is sent to the printer; use this type if you have some kind of printer not catered for in DbStat. 

 Printer drivers used by DbStat 

 When beginning to print DbStat searches its home directory for one of two files: (i) LASER.PCF for laser printers or (ii) DMP.PCF for dot matrix printers (these printer drivers are supplied with DbStat). These are printer drivers (the extension .pcf stands for printer command file) which contain the command necessary to realize such features as the font choice which a user may make in the picklists on the file printing level of DbStat. Note The Hewlett Packard Deskjet printer can be used with the laser.pcf printer driver. If you wish you may specify the driver inkjet.pcf which is supplied with DbStat. This operates with the internal fonts of the Deskjet printer. 

 3)  Set line width This parameter is only used when justifying text while it is being outputted to the printer (see relevant option below). For it to operate correctly you must use a fixed width font and the value for line width should be greater than the longest line in the text to be printed. 

 4)  Set left margin The number entered here refers to the number of spaces in the currently chosen pitch which are issued before the actual line is printed. A margin of 6 with a pitch Courier 12 (with 12 characters printed per inch) will result in a left margin of exactly half an inch. 

 5)  Set page length The value entered here refers to the total number of lines printed per page including any possible header and footer. Do not forget to consider the latter to work out how many lines of actual text will be printed on each page. When the value for page length is reached DbStat sends a form feed (ASCII $12) to the printer. 

 Note If the value you enter here is greater than the longest possible page for your printer then what will happen is that a full page is printed and a part of a second page. The number of lines on this latter page is the value here for "Page Length" less the maximum number of lines per page as dictated by the hardware of your printer. 
	To have page breaking done by the printer alone set this variable to its maximum value, i.e. 9999. 

 6)  Set line spacing Line spacing is measured in the conventional as "lines per inch". When you choose the present option you can toggle with the SpaceBar the values in the middle window; the legal range is from 1 to 12 with steps of 2 from 4 upwards. 

 7)  Print page header / Print page footer To print a header or footer DbStat checks to see if there is a file with the extension .hdr or .ftr respectively in the current directory. The default names for the header and footer files are dbstat.hdr and dbstat.ftr respectively; these can be overridden by specifying the name for header and footer file. Note that, if user-specified, both header and footer file must have the same name; the extensions just outlined are provided by DbStat automatically. 
	At the beginning of each page DbStat now prints the contents of each of these files (if you specify that both a header and a footer file are required). What each file contains is irrelevant to the printing process. The only restriction is that header and footer together not be greater in length that the number of lines to be printed on each page. 
	Both the header and the footer files can contain certain combinations of characters which are interpreted in a specific manner by DbStat. These are so-called command sequences which are used to encode instructions to the programme. 

 Command sequences in header and footer files: 
 
	$4 1 :   Name of current text 
	$4 2 :   Size of current file 
	$4 3 :   Current date 
	$4 4 :   Current time 
	$4 5 :   Current page number (calculated by DbStat) 
	$4 6 :   Total number of pages to print 
	$4 7 :   Current page number as defined in text 

 To enter these sequences in a header or footer file, press the Alt key and type the number "4" on the numeric block on the right of the keyboard; then enter the appropriate number immediately after it, the latter must be typed from the number row at the top of the alphanumeric block of the keyboard (needless to say, without pressing the Alt key). The ASCII $4 character is a diamond shape; if you edit the header and footer files with DbStat itself you will see this form on pressing Alt + "4". Should you use a different editor you may find that instead the programme displays "D" which is a shorthand for "Control-D", another manner of referring to the character with the numerical value 4 in the ASCII character set. For examples of a header and footer file, take a look at the supplied files on the DbStat distribution diskettes. 

 8)  Block justify text By activating this option you can ensure that text is block justified when it is printed. Note that the justification is done during the actual printing process and has no effect on the appearence of the text as you edit it. A few points in this connection should be noted by users. 

 a)	You must specify a line width to which each line is stretched during 
	justification (unless you accept the default value of 72 characters per line. 
	This must be below the maximum line width of 256 characters. 

 b)	Any text line longer than the line width will jut out on the right beyond the 
	justified block; if the particular text line is longer than the maximum line 
	length allowed by your printer, then it is truncated (this is done by the 
	printer). 

 c)	Only those lines whose length is at least 80% of the specified line width are 
	block justified. Assuming the default line length of 80, only those text lines 
	which are 64 characters and over in length will be justified on printing. 

 d)	If a text line contains one or more tab characters then it is not justified. The 
	reason for this is to avoid block justifying text which has been deliberately 
	positioned somewhere on a line via tabs (e.g. right justifying your address 
	in the head of a letter). 

 To test the block justify function you should print a text to file, load the file dbstat.prt into an empty text area and see what the effect of justification is like by comparing this output with the original text file. 

 9)  Use character map This is an advanced option which enables you to have any of the characters in a file translated to any other values on printing. In addition you can specify what command sequence is to be sent to the printer before and after each character which is translated. The primary use for such a feature is to activate a download font in a printer and deactivate it again, thus allowing you to switch between a standard and a customized font when printing. 
	The following are the command sequences for download on and off (this applies to dot matrix printers complying with the Epson/Nec standard): 

	On:   27 38 01  (hex: 1B 26 01) 
	Off:  27 38 00  (hex: 1B 26 00) 

 Character map file 

 The default name for the character map file is dbstat.tbl. A different name for the character map file and different sequences from the default values can be specified in an initialization file (see below). 
	The map file contains a set of substitutions which are observed when DbStat prints a text. A sample contents of character map file might be: 

		230	102 
		228	101 
		233	105 

 In this simple case all instances of ASCII $230 are replaced by ASCII $102, all those of $228 by $101 and those of $233 by $105. Technically this works as follows. 
	The file character map file is read into memory into a character translation table. This can hold up to 256 entries at any one time. On printing DbStat compares each outgoing character with the substitutions which it has read into the character translation table. If there is a match then the particular byte to be printed is translated into the substitution byte in the character translation table and sent to the printer flanked by the command sequence for download on and download off if these sequences have been specified. 
	The character map file must have a definite format. It is an ASCII file with one substitution per line. First comes the number (in decimal!) of an input byte value then comes a tab or at least a space to separate the input byte from the output byte which now follows, it also being given in decimal form. The file should contain as many lines as desired substitutions. 

 10)  Number of first page This option is useful if you have split up a file into two parts but wish to have a continuous print out: specify the number after the last page of the first text as the number of the first page of the second text. 

 11)  Print text to file With this option you can choose to have the result of the print operation redirected to a file. On choosing this item DbStat offers you the opportunity of altering the default name for the output file dbstat.prt. By simply pressing Return you accept this; to change it, edit the input line on the top of the screen. Bear in mind that there is no confirmation of overwriting an existing file when printer output is redirected to disk. 

 Notes When an option is chosen, a tick appears to the left of the text line referring to it in the leftmost window. Options with only two possible values are toggles, i.e. pressing Return either turns the option on or off depending on its previous state. 
	If you wish to use a certain combination of printer options repeatedly then specify the values in an initialization and load this on starting DbStat. 

 Troubleshooting when printing 

 Printer prints erratically You selected the wrong type of printer (e.g. a dot matrix printer when you have a laser printer). The printer you are using is neither (i) a dot matrix printer according to the Epson/NEC standard nor (ii) a laser printer which is, or can emulate, a Hewlett Packard Laserjet. In such a case choose the option Standard printer which sends text to the printer without any printer command sequences. 

 Font changes made in text do not appear on paper In order to convert font markers in a text into the relevant printer command strings, DbStat must have access to the printer command file which matches the currently chosen printer (either laser.pcf or dmp.pcf). If the file is not found then no commands are sent to the printer, i.e. there are no font changes made during printing. 
	The fonts which are available in the window on the right of the screen are dependent on the selected printer. To avail of Timer Roman and Helvetica typefaces on laser beam printers, the necessary soft fonts may need to be loaded into the printer (particularly with older models). You can do this without leaving DbStat by either issuing a DOS command via Shift-F1 or exiting temporarily to DOS via Ctrl-F1. 
	DbStat does not reset the printer before outputting text, so download fonts already present in your printer’s RAM are not endangered. 

 1.18.7.	Using picklists on the text editing level 

 Similar to the position on the database editing level, there are two means of activating commands within the text editor module of DbStat. The first is the direct method of pressing a function key or combination of keys. The second involved a system of menus which can be activated during database editing by pressing Alt-Return or Shift-Tab. 

 To select an option you move the highlight bar and press Return; to cancel the operation and hide the menus, strike Escape. 

 

 1.19.	Using an initialization file with DbStat 

 The essential items of information for DbStat can be specified in an initialization file. The latter is a normal ASCII text file with the extension .ini which is consulted by DbStat when the latter is loaded. An initialization file can have any name, i.e. any letters can precede the extension. The default is dbstat.ini; any other name must be specified on the command line (see programme call syntax at the beginning of this section). 
	Notes DbStat only reads information from those lines of an initialization file which do not begin with a semi-colon. 
	To indicate a positive value for a parameter you may type either the word "yes" or the number "1" (without inverted commas). A negative value is symbolised by either "no" or "0". 
	If you change any parameters then be very careful to keep to the pre-determined format as outlined in the comments below. DbStat only reads the setup file on starting. To operate the programme with altered parameters you must exit and start DbStat again. 

; This is the initialization file for DbStat. It is a normal ASCII text 
; file which you can edit with DbStat or a normal text editor.
; Note that the programme only reads information from those
; lines which do NOT begin with a semi-colon.
;
; If you change any parameters then be very careful to keep
; to the pre-determined format as outlined in the comments below.
;
;----------------------------------------------------------------------------;
; Item 1: Name of Standard Directory to be used
; (Leave this line empty if you do not want to change directory on starting;
;  You may change this directory from the desktop if you like):
;

;
;----------------------------------------------------------------------------;
; Item 2: Name of first database to be loaded
; (Leave this line empty if you do not want automatic loading):
;

;
;----------------------------------------------------------------------------;
; Item 3: Name of second database to be loaded
; (If Item 2 is empty and not Item 3 then the latter is assumed to be
; the first database to load):
;

;
;----------------------------------------------------------------------------;
; Item 4: Name of third database to be loaded
; (Leave this line empty if you do not want automatic loading):
;

;
;----------------------------------------------------------------------------;
; Item 5: Name of fourth database to be loaded
; (Leave this line empty if you do not want automatic loading):
;

;
;----------------------------------------------------------------------------;
; Item 6: Use index when processing database?
; 1 = Yes; 0 = No
;
0
;
;----------------------------------------------------------------------------;
; Item 7: Select index to use when processing database?
; 1 = Yes; 0 = No
;
0
;
;----------------------------------------------------------------------------;
; Item 8: Re-index database on loading?
; 1 = Yes; 0 = No
;
0
;
;----------------------------------------------------------------------------;
; Item 9: Number of field in database for index
;
1
;
;----------------------------------------------------------------------------;
; Item 10: Required national format for sorting
;
; Key:
; 	0  =  Ascii
; 	1  =  German
; 	2  =  French
; 	3  =  Italian
; 	4  =  Spanish
; 	5  =  Swedish
; 	6  =  Danish
; 	7  =  Norwegian (same order as Danish)
;
1
;
;----------------------------------------------------------------------------;
; Item 11: Required date format for directory listings
;
; Key:
; 	0  =  Ansi  	(MM/DD/YYY)
; 	1  =  American  (MM/DD/YYY)
; 	2  =  British   (DD/MM/YYY)
; 	3  =  French    (DD/MM/YYY)
; 	4  =  German    (DD.MM.YYY)
;
4
;
;----------------------------------------------------------------------------;
; Item 12: Required date format for text insertion
;
; Key:
; 	0  =  Ansi  	(MM/DD/YYY)
; 	1  =  American  (MM/DD/YYY)
; 	2  =  British   (DD/MM/YYY)
; 	3  =  French    (DD/MM/YYY)
; 	4  =  German    (DD.MM.YYY)
;       5  =  AlphaMonth (1 January 1995)
;
5
;
;----------------------------------------------------------------------------;
; Item 13: Number of spaces per tab
;
4
;
;----------------------------------------------------------------------------;
; Item 14: Show formatting automatically (tabs and line ends)
; 1 = Yes; 0 = No
;
0
;
;----------------------------------------------------------------------------;
; Item 15: First row for text in editor (number must be a multiple of 2 
;          between 2 and 18)
;
2
;
;----------------------------------------------------------------------------;
; Item 16: No. for user font activation. This parameter has to do with VGA
; adapters which differ in certain respects. There are some which require
; 8 for the activation of a user font in an internal register and some which
; demand the figure 32. Try these two out. I'm afraid that if neither of these
; works, there is not much you can do. There may be the odd VGA adapter which
; is not 100% compatible with the industry standard and which does not support
; user defined fonts.
;
;32
8
;
;----------------------------------------------------------------------------;
; Item 17: Name of User Font (leave line empty if none is desired)
;
LTXT_CHR.VGA
;
;----------------------------------------------------------------------------;
; Item 18: For VGA 50-line 80 column display mode, type 1
;          For VGA 30-line 90 column display mode, type 2
;          For default 25 lines by 80 columns, type 0
2
;
;----------------------------------------------------------------------------;
; Item 19: Use split screen during database editing
;yes
no
;
;----------------------------------------------------------------------------;
; Item 20: First column for field display in full screen mode. The default
; is 18; the other legal values are 11 and 0.
;
11
;
;----------------------------------------------------------------------------;
; Item 21: Use grey instead of blue for background in text editor
; 1 = Yes; 0 = No
;
1
;
;----------------------------------------------------------------------------;
; Item 22: Use grey instead of blue for background in browse mode
; 1 = Yes; 0 = No
;
1
;
;----------------------------------------------------------------------------;
; Item 23: Colour combination for full screen editing of databases
;
;        1 = Blue background, field displayed in inverse
;        2 = Grey background, field displayed in black
;        3 = Grey background and field display
;
3
;
;----------------------------------------------------------------------------;
; Item 24: Use Word Wrap in text editor?
; 1 = Yes; 0 = No
;
1
;
;----------------------------------------------------------------------------;
;
;          ->   Information concerning file printing   <-
;
;----------------------------------------------------------------------------;
;
; Item 25: Which port to be used.
; 1 = 1st. parallel port; 2 = 2nd. parallel port
;
; Enter 0 to allow choice at beginning of print job!
;
0
;
;----------------------------------------------------------------------------;
; Item 26: Which printer to be used.
; 0 = Laser beam printer; 1 = Dot matrix printer; 2: Standard printer
;
0
;
;----------------------------------------------------------------------------;
; Item 27: Name of printer command file
; (Leave this line empty if you do not want to change the default, i.e.
; LAS_GOTH.PCF for Laser Printers and DMP.PCF for Dot Matrix Printers)
;  
LAS_GOTH.PCF
;
;
;----------------------------------------------------------------------------;
; Item 28: Which font is to be used (depends on printer).
;
;     Laser Beam Printers:
;
;          0 = Courier 10 cpi
;          1 = Courier 12 cpi
;          2 = Courier 16.6 cpi
;          3 = Times Roman Prop.
;          4 = Helvetica Prop.
;
;     Dot Matrix Printers:
;
;          0 = Letter Quality 10
;          1 = Letter Quality 12
;          2 = Letter Quality 15
;          3 = Draft Quality 10
;          4 = Proportional Font
;
1
;
;----------------------------------------------------------------------------;
; Item 29: Print line numbers on left of page?
; 0 = No, 1 = Yes
;
0
;
;----------------------------------------------------------------------------;
; Item 30: Print header on top of page?
; 0 = No, 1 = Yes
;
0
;
;----------------------------------------------------------------------------;
; Item 31: Print header on first page?
; 0 = No, 1 = Yes
;
0
;
;----------------------------------------------------------------------------;
; Item 32: Print footer on bottom of page?
; 0 = No, 1 = Yes
;
0
;
;----------------------------------------------------------------------------;
; Item 33: Name of header/footer file
; N.B. Only enter the name (without extension!) which is to apply to both
; header and footer file; DbStat automatically supplies the extensions 
; ".hdr" and ".ftr" for headers and footers respectively; the appropriate
; files should be located in the Auxiliary File Directory.
;

;
;----------------------------------------------------------------------------;
; Item 34: Length of printed text page in lines
; # = no. of lines
;
58
;
;----------------------------------------------------------------------------;
; Item 35: Number of printed lines per inch on page
; # = no. of lines (default = 6)
;
6
;
;----------------------------------------------------------------------------;
; Item 36: Block justify text on printing?
; 0 = No, 1 = Yes
;
0
;
;----------------------------------------------------------------------------;
; Item 37: Width of printed line (also the value used for Word Wrap)
; # = no. of columns
;
78
;
;----------------------------------------------------------------------------;
; Item 38: Width of left margin
; # = no. of columns
;
8
;
;----------------------------------------------------------------------------;
; Item 39: String for selecting download font in printer:
;
; (N.B. String must be entered as ASCII numbers, each separated a single blank,
;  Maximum number of encoded bytes: 24!)
;
; 27 38 01
;

;
;----------------------------------------------------------------------------;
; Item 40: String for de-selecting download font in printer:
;
; (N.B. String must be entered as ASCII numbers, each separated a single blank,
;  Maximum number of encoded bytes: 24!)
;
; 27 38 00
;

;
;----------------------------------------------------------------------------;
; Item 41: Initial string to be sent to printer before print job
;
; (N.B. String must be entered as ASCII numbers, each separated a single blank,
;  Maximum number of encoded bytes: 24!)
;
;
05 49
;
;----------------------------------------------------------------------------;
; Item 42: Initial page number (default is 1)
;
1
;
;----------------------------------------------------------------------------;
; Item 43: Redirect printer output ? (enter name of disk file!)
;
; (Leave this line empty if you do not want such redirection):
;

;
;----------------------------------------------------------------------------;
; Item 44: Load batch file on starting? (leave line empty for none)
;
;GER_KEYB.BAT

;
;----------------------------------------------------------------------------;
; Item 45: File to load directly on pressing Ctrl-Tab
;
DBPAGE.$$$
;
;----------------------------------------------------------------------------;
; Item 46: Programme to load on pressing Alt-Tab
;
LTEXT
;
;----------------------------------------------------------------------------;
; Item 47: Name of sorting and search file (.CEF file)
;
;HELSINKI.CEF

;
;----------------------------------------------------------------------------;
; Item 48: Name of default Lines Clipboard file
;
MY_LINES.LCL
;
;----------------------------------------------------------------------------;
; Item 49: Name of default Alt Macro file
;
MY_LINES.ALT
;
;----------------------------------------------------------------------------;
; Item 50: Use monochrome display irrespective of video hardware?
;
no
;
;----------------------------------------------------------------------------;
; Item 51: Use single codes for formatting attributes?
;
yes
;
;----------------------------------------------------------------------------;
; Item 52: Name of user font chart (activated with Alt-Space)
;
LTXT_CHR.CHT
;
;----------------------------------------------------------------------------;
; Item 53: Use screen saver when computer is idling?
;
; Note: A value of 0 means 'no'; a number represents the time interval after
; which the screen saver is to be activated
;
15
;
;----------------------------------------------------------------------------;
; Item 54: Name of programme used as screen saver
;
_SCR_SAV.EXE
;
;----------------------------------------------------------------------------;
; Item 55: Accept colour values from configuration file?
;
;yes
no
;
;----------------------------------------------------------------------------;
; Item 56: Display clock in bottom left corner? (default = yes)
;
yes
;
;----------------------------------------------------------------------------;
; Item 57: Automatically load standard font for normal display?
;
yes
;
;----------------------------------------------------------------------------;
; Item 58: Name of standard font for 25-line display
;
SANSERIF.VGA
;
;----------------------------------------------------------------------------;
; Item 59: Name of standard font for 50-line display
;
SANS_8X8.VGA
;
;----------------------------------------------------------------------------;
; Item 60: Use Shift + Vertical Arrows to mark text (rather than lines)
;
yes
;
;----------------------------------------------------------------------------;
; Item 61: Use SpaceBar to flip between databases (normally letter search)?
;
yes
;
;----------------------------------------------------------------------------;
; Item 62: Display file bar on bottom of screen in text editor?
;
yes
;
;----------------------------------------------------------------------------;
; Item 63: Use ASCII symbol as mouse cursor, enter number of symbol
;   	   0 = just reverse colour block
27
;
;----------------------------------------------------------------------------;
; Item 64: Use inverse colour for mouse cursor?
;
no
;
;----------------------------------------------------------------------------;
; Item 65: File extension for text files (SDF or Delimited). Note that you
;          do not specify either an asterisk or a dot.
;          Default: TXT
;
DTX
;
;----------------------------------------------------------------------------;
; Item 66: Name of repository file for automatic storage of a text block
;          Do not enter directory or drive here but with next parameter
;
LEXA.HLD
;
;----------------------------------------------------------------------------;
; Item 67: Name of directory where repository file is stored
;
C:\
;
;----------------------------------------------------------------------------;
; Item 68: Sound a short click with each keystroke?
;
yes
;
;----------------------------------------------------------------------------;
; Items 69,70,71: There follow now three entries which refer to what fields
; are entered into a .DBD text when you press Alt-A. Up to three fields are
; possible. These are preceded by comment character `;' so that they will not
; be entered into a Database Document File when this is generated during
; report form export of database data to text.
;
1
5
9
;
;----------------------------------------------------------------------------;
; Item 72:  Use Ramdrive as repository for screen fonts and charts?
;           If you enter a letter here, it is taken as that of the Ramdrive
;           and Database Text will look for Items 17, 52, 58, 59
;           in the root directory of this drive.
H
;
;----------------------------------------------------------------------------;
; Item 73: Name of second user font file
;
EXT_FONT.VGA
;
;----------------------------------------------------------------------------;
; Item 74: Name of second user font chart (activated with Alt-Tilde)
;
EXT_FONT.CHT
;
;----------------------------------------------------------------------------;
; Item 75: Display file column on right edge of screen in text editor?
;
yes
;
;----------------------------------------------------------------------------;
; P.S. Remember that the default name for the initialization file is
; DBSTAT.INI. If you edit the present file and save it under a different
; name then you must specify this name on the command line when starting
; DBSTAT with initialization as in:
;
;			dbstat /i-special.ini
;
; This loads DbStat and initializes it with the values contained in the
; file "special.ini".
;
; Do not worry if you forget to enter the extension ".ini"; DbStat will
; supply it if it is not present.
;
; P.S. If you want to speed up the initialization procedure in DbStat, then
; remove all the comments (or at least reduce them) in the current file. 
; This will save DbStat from reading these lines and then discarding them 
; as they only represent comment.
;
; End of File
;

 

 2.	DbTrans 

 Syntax:  dbtrans [ini_file] 

 2.0.	Introduction 

 The idea behind DbTrans has been to provide users of the Lexa set with a utility for exchanging words/strings in any set of input texts going on definitions in a database which has been generated by and maintained with DbStat. With DbTrans the adage that the usefulness of a programme is determined by the imagination of the user is as true as anywhere else. To give linguists an idea of what one can realize with such a programme allow me to mention two typical areas of linguistic data processing where DbTrans might come in useful. 

	(1)	Normalization of variant historical texts 
	(2)	Terminological pre-translation of foreign language texts 

 The first instance can be illustrated easily with the the supplied database NORM.DBF. It is intended for use with the three sample texts TRANS.001, TRANS.002, TRANS.003 which are also supplied on the Lexa distribution diskettes. The database NORM.DBF contains a small set of Middle English verb forms and their Modern English equivalents. When DbTrans is run with the given text files the occurrences of the Middle English verb haue (= have) are replaced by their latter-day forms. Remember that there is no limit to the number of records which an input database for DbTrans can have so that you could specify hundreds of correspondences between historical and present-day word forms and so normalize a text or texts to a considerable extent if you wished. 
	The second example of a task carried out by DbTrans can be seen with the sample database TRANS.DBF again in conjunction with the supplied text files. When the programme is executed with this database then a couple of words in the input files are translated from their (Middle) English forms to their (Modern) German equivalents. This simple task just illustrates a principle. A sensible real-life example might be represented by a set of input texts which are to be translated and where the accuracy of terminology in the translation is of the utmost importance. In such a case you would create a database with at least two fields, one with the terms of the source language and one with those of the target language. By pre-translating texts with DbTrans you could rest assured that the specialized vocabulary of the source texts is correctly rendered in the target language. 
	When DbTrans is loaded you enter at a level where you can choose a database which is to act as the source for the terms to be replaced in the text files subsequently specified. On this level you can also determine the values for search parameters and the mode of operation (more on this below). 
	Note that the programme branches in two basically distinct directions at this level. By striking F3 you can commence translation, but by pressing F5 you can activate the database viewer which is identical to that described for DbLook (see relevant section below). 
 
 Input file type 

 DbTrans assumes by default that the text files to be effected by the action of the programme are all ASCII texts. You can use WordPerfect files as input if you wish. Press F9 to switch to this type. 
	Input text files are either ASCII texts or WordPerfect files. A mixture of both on a single run of DbTrans is not allowed. 
	If you choose WordPerfect files then the replace strings to be taken from the second field of the database may not include characters below $32 or above $126. Furthermore, no replacement is done with text within graphic boxes in a WordPerfect file. The maximum length of a line in a WordPerfect text which DbTrans can handle is 8192 characters, i.e. 8K. The reasons for these restrictions lie in the internal structure of WordPerfect files. 

 2.1.	Search parameters 

 The parameters which are specifiable on the entry level of DbTrans refer to searching for matches to the terms in the input field of the database chosen for a run with DbTrans. You will be familiar with most of these switches from such information retrieval programmes as Lexa Pat, Lexa Search or Lexa Context (see Vol.1 of the present documentation). Once a string/word is found by DbTrans it is automatically replaced by the term in the output field of the database, unless you have chosen manual operation in which case you must confirm each replacement. 

 Shift-F8 Ignore case. If you turn this parameter to ‘on’ then DbTrans will ignore differences between uppercase and lowercase lettering when combing through input files. Should the input field of the selected database contain a term like when then both when and When in an input file will be regarded as successful matches. 

 Ctrl-F8 Only words. Refers to whether entire words or just strings (sections of words) can be returned as matches during text searching. To see what relevance this parameter can have consider a hypothetical case where you are normalizing an historical English text and wish to replace all instances of thy by your. In such a situation you will need to set the current parameter to ‘on’ otherwise DbTrans would change a word like worthy to woryour. 

 Alt-F8 Open ended. This parameter has been included to deal with a special instance of pre-translation. Consider the following example. You are editing a text in an inflecting language like German and are specifying what English words match what German ones. You state that historical is the translation of historisch by including both words in the same record of a terminology database in the output and input fields respectively. Now the difficulty which arise here is that the word historisch in German can occur in a whole series of inflected forms. 

		English	German 
		historical	historisch, historische, historischen 
		historischer, historisches, historischem 

 If you now toggle the value for the present parameter to ‘on’ DbTrans will substitute historical for historisch and further remove any remaining letters up to the next word boundary, i.e. the programme deletes the inflection from the particular word form. 

 2.2.	Field choice and file specification 

 After you have selected a database which is to function as the source of input and output terms you must specify what fields of this database are to act as the relevant fields for a run with DbTrans. Note here that the fields do not have to be the first and the second of the chosen database respectively. Once you select a database a window appears on the right of the screen and displays the fields of this database. You are now prompted to select a field for input and output. By moving the highlight bar and pressing Return you convey your choices to DbTrans 
	The third item of information which DbTrans requires refers to the text files which are to be examined during the execution of the programme. A prompt appears in the centre of the screen and you enter (i) the name of a single file or (ii) a file template which the files you wish to use as input should match. If you wish to replace more than one word by some string (itself a series of words) then you are advised to do this by calling DbTrans twice, first with a special database with multiple word strings and second with a simple database with single word strings. 
	Consider an example to see why this is recommended. A translation is to be done from English into German of some computer text(s). You wish to have DbTrans translate the term system memory as well as the single words system and memory. Now in German system is ‘System’ and memory is ‘Speicher’ but the phrase system memory is ‘Arbeitsspeicher’ (and not ‘Systemspeicher’). If you include system, memory and system memory in the same database then DbTrans will generate ‘System’ and ‘Speicher’ from the two single words. What you need is a database with phrases like system memory which in the target language are not translated by composing the equivalents of their individual parts. Such a run will translate system memory as ‘Arbeitspeicher’, leaving the single words system and memory to be translated on a second run using a database of simple words. 
	The two runs for DbTrans can be put in a DOS batch file using different initialization files for both types of database, for instance: 

	File: 	do_trans.bat 
	Line 1:	dbtrans phrase.ini 
	Line 2:	dbtrans word.ini 

 where phrase.ini is an initialization file using a database with phrases to find and replace and word.ini a setup file with a word-based database as the source of find and replace strings. 

 2.3.	Manual operation 

 If you have opted for manual operation, then DbTrans stops each time if strikes on a find for the input field of a record in the selected terminology database, displays the current line in the centre of the screen and asks the user to confirm replacement of the find which is enclosed in square brackets. 

 Should you press ‘e’ at this point, an input window opens and the current line is deposited in it. You may now edit the line with the usual commands of the User Input Editor (see relevant appendix below). By pressing F10 you cause the changes to be retained and by striking F5 for these to be rejected. In both cases DbTrans proceeds to the line with the next find. 

 Note Pressing Escape at any prompt will cause DbTrans to abort and you are returned to DOS. 
	If the input files for DbTrans are WordPerfect files and there is an internal function call within a particular occurrence of the string/word which DbTrans is to replace (e.g. a change in font, or an index marker) then this is removed as it would be incongruent in the string/word which is inserted into the WordPerfect file. 

 2.4.	Batch mode and initialization 

 A further important aspect of DbTrans should be borne in mind by users: it can be executed in a batch mode, i.e. it can start, execute and terminate without any user input being necessary, deriving the values for its internal parameters from an initialization file. The batch mode presupposes initialization as there is no user specification of information required for the execution of the programme. 
	You can activate the batch mode in a similar fashion to many of the other major programmes of the Lexa set: by entering the name of a valid setup file for DbTrans from the DOS command line you can force the programme to execute in the current mode. Taking the supplied initialization file dbtrans.ini as an example, you would enter the following line from DOS: dbtrans dbtrans.ini 
	You may maintain as many initialization files as you like by editing dbtrans.ini (it is a normal ASCII text) and then storing this to a different file name. When loading DbTrans you would then enter the name of a different initialization file on the DOS command line as in: dbtrans special.ini 
	Bear in mind that this assumes special.ini is a valid initialization file for DbTrans derived from the supplied dbtrans.ini. 

 Sample initialization file for DbTrans 

; This is the initialization file for the programme DbTrans. It is a 
; normal ASCII text file which you can edit with any text editor (such 
; as Lexa Text).
;
; Note that the programme only reads information from those
; lines which do NOT begin with a semi-colon.
;
; To indicate a positive value for a parameter you may type either
; the word "yes" or the number "1" (without inverted commas). A
; negative value is symbolised by either "no" or "0".
;
; If you change any parameters then be very careful to keep
; to the pre-determined format as outlined in the comments below.
;
; DbTrans only reads the setup file on starting. To operate the programme
; with altered parameters you must exit, edit this initialisation file
; and start DbTrans again.
;
; If you pass the name of this file to DbTrans from the DOS command line
; then the programme starts in the Batch Mode. Normally in this mode there
; is no call for user input as the values for all parameters are specified
; in advance. However, if you set the value for Manual Operation to "yes"
; then user input will be required, namely to confirm replacement of finds.
;
;---------------------------------------------------------------------------;
; 1: Name of database with terms to find and replace
; Note: you may enter a full path (with drive and directory) if you wish
;
NORMAL.DBF
;
; 2: Number of field with terms to FIND (count from 1 upwards)
;
1
;
; 3: Number of field with terms to REPLACE (count from 1 upwards)
;
2
;
; 4: File template for text(s) to be altered by DbTrans
;
TRANS.*
;
;
; 5: File or file template for output text(s) to be created by DbTrans
;
;    (Note: leave this line empty if DbTrans is to overwrite files, 
;     i.e. alter existing files and not create new ones; an output file
;     template MUST be different from an input file template otherwise
;     the programme will abort)
;
TRANS_OUT.*
;
;    Take Care! For DbTrans to create a new output file from each input
;    file it examines, the input and output file templates must contain
;    a different name up to the dot and after this a single asterisk as
;    in the examples above, i.e. input and output files can only differ
;    in their names.
;
;
; 6: Automatically overwrite any new files to be created?
;
no
;
; 7: Ignore case during search for terms?
;
no
;
; 8: Only accept whole words as finds?
;
yes
;
; 9: Can words be open ended?
;
no
;
; 10: Are the input files WordPerfect (1) or ASCII (0) texts
;
0
;
; 11: Should DbTrans be executed in manual mode?
;
no
;
; 12: Ignore COCOA header?
;
yes
;
; 13: User-defined comment line (1 char.)
;
\
;
;
;
; End of DbTrans setup file
;
; 

 

 3.	DbPage 

 Syntax:  dbpage 

 Essentially Database Page is a utility which converts database records into pages of text and vice versa. To understand why this should be necessary consider a typical situation. When editing a text with one’s word processor one wishes to enter some information into a database, say a bibliographical reference. In the DOS environment this means exiting one’s word processor and loading a database manager. In a multi-tasking environment such as that of Microsoft Windows, you will at least have to switch to the database manager. What Database Page offers you is a much simpler solution to the problem by allowing you to enter information destined for processing in a database manager into a structured text file, itself created by Database Page. 

 Generate Text Records This option generates a text file from a database by examining the structure of the database and transferring information on the name, type and size of each field to a text file. This information is repeated for as many times as you specify when asked how many blank text records to create. Each text record occupies precisely one page of text. After using the text file, i.e. entering information into it, it can be transferred into a database, the information specified by the users being deposited in the records of the receiving database. 
	A single page of a text file generated by Database Page, going on the supplied sample database BIBLIO.DBF, would look something like the following (the print-out shows a screen from Lexa Text with a Database Page text file loaded, but without any information entered by the user as yet). 

 To enter information simply move to the end of the line and enter text. Note that a ‘#’ is placed after the closing inverted comma to indicate that the particular field in the source database is numerical in type. Do not erase this symbol! 
	In order to ensure that the database page text file can be correctly handled by Database Page when importing records into a database afterwards you must pay attention to two very important facts. 

 1)	Set the values of left and right margins to the maximum in your word 
	processor. It is essential that any line of text you may enter not be wrapped 
	around to a following line. 

 2)	Always save the database page text file as an ASCII (i.e. DOS) text file 
	without any formatting information from your word processor. Do not use 
	character attributes (such as bold or italics) or add any page layout 
	information when processing this text file. If you are using a text editor 
	such as Lexa Text then just save the text in the normal fashion (text editors 
	always generate ASCII text files). 

 Database to Page Text While the previous option generates a blank database page text file, the current one will convert an existing database to a text file which has as many pages as there are records in the database. 

 Import into Database Transfers the user-specified contents of a database page text file to a database, appending a new record to the database for every page in the source text file. Ensure that the database page text file is identical in structure to the database to which the data is to be appended and be careful that the text file is an ASCII text file in which there are no wrapped lines. 

 Note After selecting this option you are asked to specify whether the text to serve as input is a Database Page file or just a plain ASCII text, i.e. whether the input text has field information on the beginning of each line as shown in the above screen or not. You must also specify this for the following option. 

 Convert to Delimited Text Basically the same function as the above with the exception that a delimited text (with the extension *.txt) is created, from which the data can be transferred to an actual database at a later stage. 

 Sort Pages in a Text Sorts a database page text file alphabetically going on the contents of the first field of each "page" record. No other change is made to the text file. 

 F1  Online help Offers you a windowful of information on the purpose of Database Page. 

 Shift-F1  DOS Command Opens an input line in a window in which you can enter any valid command for DOS which is then carried out. An automatic return to Database Page is made on conclusion of the command. 

 Ctrl-F1  Load DOS temporarily Shells down to DOS and allows you to execute any programme or DOS command. Type "exit" to return to Database Page. 

 

 

 4.	DbLook 

 Syntax:  dblook [file_name] 

 The present utility is essentially a much reduced version of the previous programme. It simply allows viewing of databases. There is no desktop, the name of a database being passed to DbLook as a command line parameter or chosen via the internal directory lister which is activated if no parameter is passed on loading. After the programme loads a particular database, you can navigate in it with the following keys: PageUp/Down (move a record at a time in the database, Ctrl-PageUp/ Down (jump to the beginning or end of the database); to go to a particular record, use Ctrl-G. 

 In addition to the navigation keys there are also a number further key combinations dedicated to the task of finding record contents. 

 Ctrl-F  Find string in a given field (chosen by the user from a picklist of the fields of a record). 

 Ctrl-R  Repeat search for string from the current position. 

 SpaceBar  Use letter search to locate a particular record (see description of this in the section on DbStat above). 

 Ctrl-L  Determine field used for letter search. 

 Function key settings 

 F5  Allows loading a new file via the directory lister. 

 F7, Alt-F4  Exits DbLook to DOS; alternatively you can press Escape. 

 F9  Offers you some statistics on the current database. 

 F10  This activates the same browse view mode as described for DbStat above; you may move to a new record by pressing Ctrl-Return with the highlight bar resting on a certain record. 

 DbLook is furthermore called by the file manager Lexa File and other programmes when the user presses F2 to view a file. The file manager determines if the currently highlighted file in the directory listing is a dBASE database and if so calls DbLook rather than the default programme Lexa View (see Vol.3 for details). 

 

 

 5.	ReportDb 

 Syntax:  repdb [rep_file] 

 5.0.	Introduction 

 The purpose of ReportDb is to offer users of DbStat a utility with which they can generate customized report forms from the databases they create/process with the latter programme; indeed ReportDb will operate with any dBASE compatible database. 
	To start with the newcomers to database management should understand what a report form is. It is a plain ASCII file which consists of (a) normal text and (b) place holders for the contents of database fields. The report form is used to transfer data from a database to an output text. The data from certain fields of the database, i.e. those for which there are place holders in the report form, is shunted through the form during the export operation. In principle the output of a report form can be to the printer or to a disk file. 
	A report form is used recursively. For each record of a database, or at least for each marked record, the report form is examined by the report form generator and the text it contains along with the data of the fields for which there are markers in the report form are written to file (or sent to printer). 
	The simplest example of a report form is a standard letter which is generated once for each (marked) record of an address database. After the export operation one is left with as many customized letters as there are addressees in the (marked) records of the input database. 
	With ReportDb all output goes to file (from where you can send data to the printer via your word processor). Reporting is then the process of extracting information from a database and storing it in a text file. The form one uses for this operation can be determined by the user. Most importantly, the user can design this form him/herself. Here one includes text of one’s own in the form and can specify where on the form the fields of the database are to be placed. Not all fields must appear on the form and a field can occur more than once if you want. 

 5.1.	Description of commands 

 Select Report Form.  On choosing this option a window is opened in which all the files in the current directory are listed which have the extension .rep. This is the extension which ReportDb uses for the report form files which it stores (via the appropriate option, see below). If you have chosen a different extension when saving a report form file then this will not appear in the directory listing and thus not be accessible to ReportDb. 

 Notes Bear in mind that dBASE report form files, which have the extension .fmt, cannot be processed by ReportDb. 

 Define/Alter Form This option allows you to specify the name of the output text file which is generated by ReportDb when you run the last option in the desktop menu. Furthermore it allows you to determine five parameters which apply to the report form as a whole. 

	(1)	Page Width		(2)	Left Margin 
	(3)	Word Wrap		(4)	Tab after CR 
	(5)	Page Length 

 Page Width The width of the page is given in columns. The default value is 80. This can be changed here by moving the arrowhead to the option and pressing the RightArrow key. You may now enter the new value for Page Width. Note that the value can be greater than the width of a screen. This might be necessary if printing long fields on a single line of the report form. While the report form is not wider than a page, when the fields are inserted during export a line can easily exceed 80 columns. 

 Word Wrap This is the feature which you know from word processing. Here the function is somewhat simpler. It merely starts a new line when the column value specified in Page Width is reached, assuming that a word boundary occurs at or after this position. Toggle the value for this parameter with the SpaceBar. 

 Tab after CR The present feature is essentially of interest if you are using ReportDb for generating report forms from bibliographical databases. Setting this parameter to "yes" will cause a tab character (ASCII $9, realised in a text editor later as an indentation of a certain number of spaces, e.g. 6 or 8) to be inserted at the beginning of each new line which is created by the word wrap mechanism. This fact should be noted carefully: a tab is only inserted at the beginning of a line if word wrap has broken off the previous line due to its exceeding the setting for line length. With the export of bibliographical databases to text this ensures that names of authors (which would be the first item in a record) are set off from the rest of the remaining information in the record by extending out somewhat on the left, in effect providing a hanging indent. 
	The abbreviation CR in the title of this switch stands for Carriage Return which for the computer is the mark of a new line. Page Length This has a default value of 66 and is a reference in lines to the length of a page. You can set this to any value (it can be greater than 62 if you like). ReportDb inserts a page break (ASCII $12) when the current line number reaches Page Length and resets the line counter to zero. 

 Note If you do not want to have a page break at any point in the output file of ReportDb then set Page Length to its maximum value of 9,999 lines. 

 Left Margin.  You can either set the left margin for the output text file here or do this later when editing the text within your word processor. The value here is the number of spaces which ReportDb indents each line before starting to print the report form. 

 Date Field Format.  The contents of date fields in dBASE compatible databases are deposited in the so-called ANSI form (YYYYMMDD) in the actual database file. The advantage here is that dates in this form are put in correct order when a straightforward ASCII sorting algorithm is used. 
	For display purposes the particular database manager will change the form to conform to the conventions used in a given country. For ReportDb the same principle holds: date fields must be converted to a national date format on export to text. 

 You have five options (the first simply leaves the date field unchanged) which differ in the order in which the contents of the Month and the Day sections of the field occur and in the type of delimiter used to separate field sections ("/" or "."). 

 Show Form Settings The window which opens here presents you with the report form settings (but not the report form layout) as read from the report form file which you selected via the first option. If you have not chosen a report form file yet then the settings have default values. You could use these as a starting point for designing a new group of report form settings which you could then save to disk under a name of your own specification (see relevant option below). 

 Input Text to Report If you intend to design a report form with a considerable amount of text you may wish to do this with a text editor, which offers you better editing facilities, and then position the field markers in the text already created afterwards. This is quite simple to realise. You create your text as you require and then select the current option when you wish to use an external text as the basis for a report form. Then choose the option Design Report Layout to position the fields within the freshly imported text. Save the configuration to disk with the appropriate option to have it at your disposal later. 

 Notes. Any text imported into ReportDb must keep to the size limits of a report form, i.e. not be wider than 96 columns or longer than 72 rows. 
	The directory listing which appears when you wish to select an external text only shows those files which have the extension *.txt. You should thus rename any text you wish to import into ReportDb if it does not already have the necessary extension. 

 Choose a Database.  Strictly speaking this option is only necessary when you are designing a new group of report form settings. The name of the chosen database is then stored in the report form file with the extension .rep. However you might want to specify a different database for printing after you have loaded a report form file. This is perfectly legitimate. However, bear in mind that the layout information may not suit the database which you select (as the latter may well be different in structure to that referred to in the report form file). 

 Design Report Layout.  While the Define/Alter Form option allows you to determine the parameters for report forms as a whole, the present option is concerned with how the fields of each record of the chosen database and how accompanying text are to appear on the report form. 

 Without doubt, this is the most important aspect of record layout. The procedure is, however, quite simple. To begin with you will have noticed that, on selecting this option, the screen changes and on the right a list of the fields of the currently chosen database are to be found. Their Type, Size and Decimal Places are also indicated. Move the highlight bar within the window to the field you wish to position in the report form and press Return. 

 Trimming fields (removing blank padding) 

 After choosing a field you are immediately asked by ReportDb whether the chosen field is to be trimmed on export or not. By this is meant that trailing blanks are removed from a field. 
	If you specify that a field is to be trimmed then its number will be enclosed in horizontally aligned triangles in the report form. If you state that the field should not be trimmed then vertically aligned triangles are used. 

 Flanking fields with characters 

 A further question is put to the user after choosing a field, namely whether he/she wishes to flank the chosen field with any characters. The idea behind this is the following. With some records of a database it may be the case that a field which is to be exported is empty. In such a case any extraneous text in the report form which refers to this field is unnecessary. To output such text only when the field is non-empty one can enter it at this point. Consider a practical example. The contents of a field in a bibliographical database is to be placed in inverted commas in the text file which results from an export operation. The inverted commas are not part of the field contents in the database so that on export any field which is empty should not be flanked by inverted commas (this would result in "" instead of, say, "On the history of linguistics" (from a field with contents) being outputted in the text file). You could avoid such a situation by designating the inverted commas as flanking characters (one left and one right) which are only inserted in the text file when the field in question is not empty. Note You may use one or more blanks as flanking characters. To indicate that this is the case ReportDb will display flanking blanks (and only this type) as a series of ASCII $250 characters (small dots) which are converted to real blanks on export. 

 Display control codes 

 Flanking characters are enclosed by two ASCII characters: $1 for a left flanking set of characters and ASCII $2 for a right set. These delimiters are normally invisible and the flanking characters appear in bright lettering. By pressing Alt-F3 you can reveal these codes. This is a toggle: to hide the codes press Alt-F3 again. 

 The field place holders only occupy a single place in the report form line although they are four characters in size. You can confirm this for yourself by moving the cursor to a place holder. The column counter is set to 0 while you move it through the place holder and resumes its correct value afterwards. 

 Setting end of form F2 

 When ReportDb exports a database to a text file via a report form it removes any empty lines at the end of the form. However, there are many instances in which one wishes to have a certain number of empty lines between records in the resulting text file. To achieve this the present option has been included. It allows you to position an End of Form marker in the report form. When you press F2 you are prompted to enter a number for the last line in the report form on database export. The message [end of form] now appears in the line corresponding to the number you entered. Needless to say you cannot enter a value which is greater than the maximum length of a page (72 lines). 
	It is not possible to enter text on the line which marks the end of a form. Furthermore, if you enter text and/or field references after it then these will be ignored on database exporting. Position the end of form marker on the line after the last line of the form as you wish to have it. ReportDb will conclude the report form for the current record at this line and continue then with the next record in the database. 

 Record number and time/date in report form 

 The place holder for the number of the current record being exported is ASCII $11, those for the current (system) date and time are ASCII $23 and ASCII $18 respectively. These place holders can be inserted anywhere in a report form just as with field markers. 

 Joining lines of report form 

 When editing a report form you will notice that you cannot scroll beyond the right edge of the screen. However, you may well wish to design a report form in which the lines are longer than one visible screen line. This is achieved quite simply in ReportDb by inserting the character ASCII $25 (_) at the end of a line. This ensures that the following line will be regarded by ReportDb during export as a continuation of the preceding one. 

 Store/retrieve line  F3 

 This command functions in exactly the same manner as that in DbStat. It is a means of storing the contents of a line for later retrieval. The ruler in the second row of the screen is replaced by two options: store or retrieve. The latter option is only valid if the contents of a line have been stored previously. 

 Insert line  F4,  Remove line  Shift-F4  

 These commands push two lines apart to make space for a new empty line at the current cursor row or delete the line on the current row to compress the form by a line. 
	You can exit the report form design level by pressing Alt-F7. Changes which you might have made are always retained (in memory) when you return to the desktop, i.e. you do not have the option of rejecting them. To save these to disk, use the Save Configuration option in the main menu. 
	An on-line help text is available when designing a report form as usual via F1. 

 View Database Fields This option simply serves the function of showing you the fields of the presently chosen database. If the number of fields is too large to be shown at one go in the window which opens for this purpose then pressing any key will cause the remainder to be displayed and so on until all fields have been shown. 

 View Statistics. Here you are shown some statistics relevant to the currently chosen database along with the name of the current report form file. This is one of the means of checking on the name of report form and database file. If you have selected a different database from that named in the report form file then this is shown here. 

 Save Configuration. This is the option to save all the features which you have specified with the various options above to a disk file. When you press Return here you are presented with an input line which you can edit if you wish. It is filled with the name of the report form file which you last loaded via the first option in the desktop menu or is empty if you are creating a new form file. 
	There is no confirmation of overwriting a file on disk. The report form file is saved in the current directory, i.e. in that which is echoed at the bottom of the screen. 

 Export the Database. On choosing the present option you are prompted to confirm overwriting the output text file, should this already exist in the currently logged in directory. Answering negatively leads to the entire command being cancelled. You cannot change the name of the output file at this point (use the Define/Alter Form option to achieve this). If you respond affirmatively to the prompt the desktop screen disappears and the selected database is opened. The first eight fields of the database are displayed. You can now navigate in the database with the following keystrokes: 

	PageUp		Previous record 
	PageDown		Next record 
	Ctrl-PageUp		Beginning of database 
	Ctrl-PageDown	End of database 
	Ctrl-F			Find a particular record 
	Ctrl-G			Go to a particular record 

 The last two options require that you (i) enter the contents of the first field of the record you wish to find or (ii) enter the number of the record to jump to. 

 The remaining commands refer to exporting. You can either (i) export the entire database via Ctrl-F8 or (ii) just export the current record via F8. After exporting is completed you are returned to the desktop. You can repeat the operation as often as you wish from the desktop, but you must confirm overwriting the text output file or alter its name between export sessions. You can interrupt the exporting operation by pressing Escape. You are then returned to the desktop. 

 5.2.	Function key settings 

 F1  On-line help This offers you a small help text on the desktop with a couple of general hints. As ReportDb has many details, there is no way of indicating all of these by means of a help screen; instead read through the above programme description carefully. 

 Shift-F1  Execute DOS command  An option which is only available from the desktop. For this purpose a window opens on the left and you can enter the name of a valid DOS command. If you have already done this before then the input line is filled with the last entered command. 

 F7  Exit ReportDb Unloads ReportDb and returns you to DOS. Bear in mind that the setup information is not automatically saved to disk. However, you are reminded if you have processed a report form file but have not saved it to disk before issuing the command to exit ReportDb. 

 Shift-F7  Exit ReportDb with directory change The same as the previous command but with a change to the current directory if this is different from that from which one started ReportDb. 

 5.3.	Using ReportDb in the batch mode 

 Apart from using ReportDb interactively it is possible to call it from the command line with the name of an existing report form file (with the extension .rep) and thus force it to operate in the batch mode. 
	By this is meant that ReportDb starts, carries out its work and ends automatically. There is no desktop presented during the batch mode and the programme does not stop for user input at any point. 
	Here is a typical situation where one would use ReportDb in the batch mode: You edit a database, say with DbStat. When you are finished you then send the database through the report form generator ReportDb to convert it to a text file of your specification. The net result of this is that the steps just outlined can be carried out from a DOS batch file without user intervention. 
	To give you an idea of how this would work consider the following hypothetical DOS batch file: 

		dbstat %1.dbf 
		repdb %1.rep 

 The first line calls DbStat with a certain database which is determined by the user entering a name after the name of the batch file. Say you call the batch file process.bat and you have a database called my_stat.dbf then you could call the batch file as follows: 

		process my_stat 

 This DOS command line entry starts the batch file, i.e. it loads DbStat and passes to it the name my_stat in place of the replaceable parameter %1 so that DbStat is actually called with dbstat my_stat.dbf. For the above batch file to work properly you must also have a further file with the name my_stat, namely a report form file my_stat.rep. ReportDb is then called with the name of the report form file (i.e. as repdb my_stat.rep) and the text file is automatically generated according to the information contained in the report form file. Needless to say you must exercise care in the batch mode as the report form must suit the incoming data (from the database) exactly. However, once you are assured of this the batch mode can result in considerable time saving. A text file which has been generated by ReportDb can be processed by any word processor or text editor afterwards. 

 5.4.	Exporting data from DbStat/ReportDb to a word processor 

 The text files generated both by DbStat and ReportDb from databases by the use of report forms are always ASCII text files. Recall that such files do not allow for formatting information such as character attributes, page layout, etc. However it often occurs that the user of a database would like to have the data contained in it transferred to a word processing environment and to have characteristic items of information set with some particular item of formatting. Take as an example the bibliographical database, BIBLIO.DBF. This can be maintained and manipulated with DbStat. When you require data from it for output with your word processor you can export the contents of the records you require to an ASCII text file via an appropriate report form. 
	Now with bibliographies which appear in printed form it is usual to have the titles of books, collections, series and journals set in italics. However, the specification of the attribute ‘italic’ is something which is specific to a particular word processor and as such cannot be determined by a report form used to convey data from a database environment to an ASCII text file. The solution to this is to use the report form WORD_PRO.REP instead of the regular BIBLIO.REP. This form works as follows. Before the contents of the fields TITLE, COLLECTION, JOURNAL it places a marker ‘“’ (ASCII $244) and at the end of the field the matching marker ‘”’ (ASCII $245). Now when you load the text file generated by ReportDb or DbStat into the word processor WordPerfect you can run the two supplied macros CLEAN.WPM and ITAL.WPM (in that order). The first macro removes instances of ‘“’ and ‘”’ which enclose a title which is an article (this is set in inverted commas and not italics). The second macro replaces the remaining markers by the internal WordPerfect markers for ‘begin italics’ and ‘end italics’. By these means the contents of the relevant fields of the source database will turn up formatted for italic within WordPerfect. 
	The supplied macros can be edited with WordPerfect. Equivalent macros are possible for Microsoft Word and other popular word processors. 

 

 6.	DbList 

 Syntax:  dblist 

 6.0.	Introduction 

 The idea behind DbList is to provide a convenient environment for designing forms with which one can generate lists from a dBASE compatible database. A list can be outputted to a disk file (and then processed with Lexa Text for example) or it can be sent to a dot matrix printer (i.e. to any 24 needle printer which uses the Epson ESC P printer control language, this comprising the vast majority of dot matrix printers today). Users should grasp this fact to begin with: DbList can print lists directly or deposit the data to be exported in an ASCII text file. To specify which mode you wish, use the option Output Destination. The lists which the programme generates are similar to the output of ReportDb. The latter programme caters for larger forms, the layout covering an entire page. With DbList the form is quite small and is thus suitable for the printing of address labels for instance. Another significant purpose of the programme is to generate columnar lists. Assume you have a database with word forms (perhaps created by Lexa from corpus texts) then you can export these to a text file with several columns per line with DbList, thus obtaining a table of the forms from the database. 
	As usual with the major programmes of the Lexa group you control DbList from a desktop which is presented to the user on starting the programme. 

 6.1.	Description of commands 

 Select Configuration On choosing this option a window is opened in which all the files in the current directory are listed which have the extension .cfg (for configuration file). This is the extension which DbList avails of for the files in which it stores information about form design determined by the user (via the appropriate option, see below). If you have chosen a different extension when saving a configuration file to disk then this will not appear in the current directory listing and thus not be accessible to DbList. 

 To help you on your way, a test configuration file, dblist.cfg, is included with the sample data provided with Lexa as is a test database, db_test.dbf. This configuration will generate a two column list of the individuals in the database with only the surname and firstname deposited in the output text file. 

 Define/Alter Form. If you either want to alter an existing form or define a new one you will need to go through the points gathered together under the present option. You are offered a series of picklists where you must specify the values for various parameters which DbList needs when generating a list from a database. 
	The number of information items which DbList requires at this point depends crucially on whether you are printing a list or sending one to a disk file. For the discussion below it is assumed that you are printing as in this case you require to enter a maximum amount of information. When outputting to file only the section Form Frame is of relevance. 
	 Label Type There are a variety of label types, the most common of which are offered here. Move the highlight bar to the type you require and press Return. If the types suggested here do not correspond to the type of labels you are using then choose the nearest match and alter the values for Form Width and Form Height as described below. The label types listed in this window have the following dimensions: 

	Standard	=	3 1/2"   x   15/16" 
	European	=	3 1/2"   x   1 7/16" 
	Extra Large	=	4        x   15/16" 
	Diskettes	=	2 3/4"   x   1 3/16" 

 The above dimensions are given in inches. Assuming a print pitch of 10 cpi (Pica) and line spacing of 6 lines per inch the dimensions can be translated into horizontal and vertical print head increments as follows: 

				Width in Spaces	Height in Lines 
 
	Standard		35				5 
	European		35				8 
	Extra Large		40				5 
	Diskettes		26				7 

 Typeface. Three different typefaces can be chosen for the labels you print. The first two of these have a fixed distance between each character printed and so are to be recommended when you are printing more than one label horizontally. The difference between Draft and Letter Quality is one of fineness of printed characters and thus indirectly one of printing speed. Proportional lettering is always with maximum character resolution. 

		(1)	Draft 
		(2)	Letter Quality 
		(3)	Proportional 

 Pitch. The question of typeface is independent of pitch with the exception of proportional typeface for which the pitch cannot be specified (as this varies from letter to letter). Thus the present picklist refers to the first two typefaces which you can choose via the previous picklist. 

		(1)	10 cpi 
		(2)	12 cpi 
		(3)	15 cpi 

 Style. If you are printing address labels then the question of printing style will hardly arise. However, it is conceivable that you might want to print your labels in, say, italic or bold. To enable this the present picklist has been included. 

		(1)	Normal 
		(2)	Bold 
		(3)	Italic 
		(4)	Underlined 

 Note What is more frequent is that users want to specify a change of style for a particular field. You can do this via the Determine Form Layout option. 

	Form Frame 

 Forms per Line Labels are available on different kinds of fanfold paper. The simplest form is where there is one label across the paper carrier (usually about 41/2" wide). The next most frequent is fanfold paper which is of standard width (i.e. 8.5" or 21 cm. [A4] wide) carrying two labels horizontally. Far less usual are paper formats with three or more labels horizontally. 
	With DbList you can print lists in columnar form. This is done by specifying the value which applies in your case. If you choose more than one column across and are printing a database then DbList prints consecutive records horizontally, assuming that you wish to print an entire database. If you are printing the same record several times then obviously each label, irrespective of its position on the paper carrier, is a duplicate of this one record. 

 Form Width A default value for this parameter is derived from the type of label which you choose, i.e. if you select the Standard label type then the label width is 35 spaces wide (going on a pitch of 10 characters per inch). The purpose of including this parameter at all is to allow you to specify an irregular value should this be necessary for some reason or other. 
	Note.  While DbList is printing labels it keeps track of the number of characters printed per line. Should this reach the value of Form Width then the line is terminated irrespective of whether the field being currently printed still contains characters or not. This is necessary to prevent printing beyond the right-hand margin of a label. 

 Form Height This feature refers to the height of the label seen as a number of printed lines. As a Standard label is 15/16" high there are 5 lines in the label going on a line spacing of 6 lines per inch; with a European label the height is 1 7/16" which is 8 lines (at 6 lines per inch). 
	Note While DbList is printing labels it keeps track of the number of lines printed per label. Should this reach the value for Record Height then the label print is terminated irrespective of whether there are still lines to be printed or not. This is necessary to prevent printing beyond the bottom margin of a label. 
	By the same token if the label height is greater than the six lines which may accodomate fields then the difference is sent to the printer as a series of line feeds to ensure that the print head is advanced vertically by the amount specified in the value for Form Height. 

 Left Margin Here the value entered is the number of spaces which the print head will move to the right before it starts printing a line. Note that this value is a number of characters which must be divided by 10 to give the number of inches with Pica, by 12 with Elite and by 15 with condensed. Using enlarged print does not affect this as the enlargement only sets in when printing actually starts. 

 Lines Between This value is nearly always 1. Do not change it unless you are definite that another applies to your labels. When you choose a particular type of label, DbList automatically changes the label height. You should accept the value decided on by the programme unless you know exactly what other value you should specify. 

 Spaces Between If your label paper has more than one label horizontally you will need to convey to DbList just how many spaces it is to jump between labels on the horizontal axis. Specify the value here as you require, bearing in mind that it refers to Pica (10 cpi). If you have chosen a different pitch for printing then you will have to compensate for this accordingly. 

 Line Spacing Two values are possible here. The default value is 6 lines per inch; the second value is 8 lines per inch. Change to this by using the SpaceBar. This toggles the values; press Return to conclude and have your choice accepted by DbList. 

 Note If you select 8 lines per inch then the vertical increments of the print head are smaller than with the standard of 6. Bear this in mind when working out how much the print head must advance vertically to start printing each label at exactly the right position. 
	With a line spacing of 8 you will need to increase the label height by 33%. Say you are printing with labels which are 1 7/16" high with a line between each label. This results in exactly 11/2" from each top of label to the next. In lines per inch this is 9 at 6 lines per inch. However with 8 lines per inch it is 12, so add 3 to the default label height of 9. 

 Show Current Settings. The window which opens here presents you with the form settings (but not the form layout) as read from the configuration file which you selected via the first option. If you have not chosen a label file yet then the settings have default values. You could use these as a starting point for designing a new group of form settings which you could then save to disk under a name of your own specification (see relevant option below). 

 Choose a Database. Strictly speaking this option is only necessary when you are designing a new group of form settings. The name of the chosen database is then stored in the label file with the extension .cfg. However, you might want to specify a different database for list generation after you have loaded a configuration file. This is perfectly legitimate. However, bear in mind that the form layout information may not suit the database which you select (as the latter may well be different in structure to that referred to in the configuration file). 

 Determine Form Layout While the Define/Alter Form option allows you to determine the parameters for labels as a whole, the present option is concerned with how the fields of each record of the chosen database are to appear on a form. Here you can specify three aspects of form layout: 

	(1)	The position of each field on a form 
	(2)	The formatting features for each field (if output is to printer) 
	(3)	The extra text, if any, which is to be included on a form 

 Positioning record fields. Without doubt, this is the most important aspect of form layout. The procedure is, however, quite simple. To begin with you will have noticed that, on selecting this option, the screen changes and on the left a list of the fields of the currently chosen database are to be found. To the right of this is a box which represents the form of a single label. Below this is a help window prompting you on what moves you can make. 

 Pressing either DownArrow or UpArrow will move the highlight bar within the field window. Move the bar to the field you wish to position in the form. Now press Return and you notice that within the form the number of the field chosen is echoed. If you now use any of the arrow keys, the number is shifted in one of four directions. Move the field number to the position at which you wish to have the particular field outputted in the form and press Return. You are returned to the field window and can repeat the procedure for another field. In this connection note the following points: 

	1)	Fields do not have to appear in numerical order in a form 
	2)	You can have as many fields on one line as you wish 
	3)	You can place one field more than once in a form 

 Formatting individual fields. There are two further commands available on this level which you should be conscious of. The first of these is the present one with which you can specify formatting information for a particular field. 
	Move the highlight bar to the field you wish and press Alt-F (for formatting). You are now lead through a series of three windows in which you can specify (i) pitch, (ii) pitch enlargement and (iii) style for the field in question. These values always override those chosen for the form as a whole when defining / altering a form. Pitch is a relatively simple matter; you can chose between 10, 12 and 15 characters per inch. Pitch enlargement is somewhat more unusual but nonetheless useful. Assume you are printing address labels (with the supplied database db_text.dbf, for example) and wish to emphasize the country of each addressee. You could specify here that the country field be printed in enlarged print. This will half the pitch, i.e. Pica would be printed with 5 cpi; Elite with 6 and Condensed with 7.5. If you had chosen Pica as the base font for the entire label then you might like to print the country field in 6 cpi; in this case you would chose 12 cpi as pitch and set pitch enlargement to ‘on’ by toggling the value with the SpaceBar. This would result in 6 cpi for the field in question. 
	Via the style window you could also have a field printed in, say, bold or italic. Try out the various possibilities offered here until you are satisfied with the appearence of the form. Note The field formatting option is only available if you have chosen a printer as the destination of DbList output. 

 Including text on label. When the field window is active (to be seen by the highlight bar appearing in it) you can press Alt-T for entering extra text into the form. 
	The idea behind this feature is the frequent desire to add some characters extraneous to the field of the database to be outputted, e.g. an item of punctuation, such as a comma or a full stop or bracketing after or around the contents of a particular field. 
	On pressing Alt-T a cursor appears in the form. You can move this with the usual arrow keys. When you shift to a position at which you want to enter text simply enter this from the keyboard. The key you press is echoed at the current cursor position in the form. Note that you cannot enter anything if the cursor is resting on a field number. 
	Say you enter a full stop after a certain field then on printing this appears after the contents of the particular field. The absolute position of the full stop will vary according to the length of the contents of the field after which it is to be placed and whether fields are to be trimmed on output. 
	Note. The extra text you may enter into a form is not affected by the formatting features specified for an individual field but is dependent on the formatting for the form as a whole (specified via the Define/Alter Form option on the desktop). 

 F10  Save form layout parameters.  You can conclude form layout editing affirmatively by pressing F10. All the features you specified (field number and position, formatting information and extra text) are saved internally. To store these on disk you must choose the relevant option below. 

 Escape  Reject form layout parameters.  This causes all the features which you have specified to be rejected. The values which parameters had before entering form layout editing are retained. 

 Display Form Layout. To confirm what values various features have you can choose this option. It displays the current form with the fields positioned and extra text placed as specified. This information may be obtained (i) as a result of your having just edited the record layout or (ii) by being read from a configuration file. 

 As prompted in the last line of the screen you can remove the entire formatting information for individual fields by pressing the Del key. This or any other key causes an exit to the desktop. It is important to grasp that field formatting information can only be deleted here; during form layout editing you can add formatting information but not retract it. 

 View Database Fields. This option simply serves the function of showing you the fields of the presently chosen database. If the number of fields is too large to be shown in the window which opens for this purpose then pressing any key will cause the remainder to be displayed and so on until all fields have been shown. 

 View Statistics. Here you are shown some statistics relevant to the currently chosen database along with the name of the current configuration file. This is the only means of checking on the name of configuration and database file. If you have selected a different database from that specified in the configuration file then you can check on its title via the present option. 

 Change Current Directory. A window opens here and allows you to enter the name of a new directory. The window is filled with the name of the current directory. Use the Backspace key to delete as much of the name as is necessary to enter the that of the new directory. Assuming that the name you type is a valid directory a change is made and the name of the new current directory is echoed in the penultimate line of the desktop screen. A different drive from the current one can be specified at the beginning of the directory name. 
	The directory specified here is that used for a directory window when you are selecting (i) a configuration file or (ii) a database for list generation. 

 Save Configuration. This is the option to save all the features which you have specified for a form to a disk file. When you press Return you are presented with an input line which you can edit if you wish. It is filled either with the default form file name dblist.cfg or the name of the form file which you last loaded via the Select Configuration option. 
	There is no confirmation of overwriting a file on disk. The configuration file is saved in the current directory, i.e. in that which is echoed at the bottom of the screen. 

 Output Destination. At this point you can specify whether the output of list generation is to go to a printer or to a text file. Depending on what you choose here some further options of DbList (such as form layout) are affected. 

 Make List from Database. The desktop screen disappears on choosing the present option and the selected database is opened. The first eight fields are displayed. You can now navigate in the database with the following keystrokes: 

	PageUp	Previous record 
	PageDown	Next record 
	Ctrl-PgUp	Beginning of database 
	Ctrl-PgDn	End of database 
	Ctrl-F		Find a particular record 
	Ctrl-G		Go to a particular record 

 The last two options require that you (i) enter the contents of the first field of the record you wish to find or (ii) enter the number of the record to jump to. 

 The remaining commands refer to exporting. You can either (i) export the entire database via Ctrl-F8, (ii) export just the current record via F8 or (iii) export the current record a specified number of times via Alt-F8. For the last option you must say how often the current record is to be exported. 
	After an export session you remain on this level of the programme. This is obviously desirable if you wish to print individual records from a database. You do not want to be returned to the desktop after each record printing. To terminate the present printing session (and return to the desktop), press Escape. 

 6.2.	Function key settings 

 F1  Online help.  This offers you a small help text on the desktop with a couple of general hints. As DbList has a lot of intricate details, there is no possible way of indicating all of these via a help screen; instead read through the present section carefully. 

 Shift-F1  Execute DOS command.  An option which is only available from the desktop. For this purpose a window opens on the left and you can enter the name of a valid DOS command. If you have already done this before then the input line is filled with the last entered command. 

 F7  Exit DbList.  Unloads DbList and returns you to DOS. Bear in mind that the setup information is not saved to disk but that you are reminded to do so yourself if DbList notices that you have altered some values from a configuration file. 

 Shift-F7  Exit DbList with directory change.  The same as the previous command but with a change to the current directory if this is different from that from which one started DbList. 

 

 7.	CompDb 

 Syntax:  compdb 

 When one is involved in database management it is quite normal to have data spread out over several databases. If the data varies then the structure of the databases will normally vary also. However, there are many instances in which one maintains databases with identical structures but different data. Take the example of bilbiographical database management. One will probably have decided on a typical structure for such a database soon after beginning with the collection of data. After amassing a certain amount of bibliographical information the danger increases that one will enter the same item more than once. Within the same database this can be ascertained quickly, but if the data is contained in various databases then difficulties arise. One solution to the problem is to use MergeDb which will create a new database of unique records from two input databases. The difficulty with this method is that this programme works on formal criteria. Two records are only regarded as identical if every byte is exactly the same. Should you have entered the same bibliographical item in two different databases but in the one case used a single comma more or, even less perceptible, a single space more (or less) then MergeDb will not treat the records as identical. 

 The solution to the difficulty of extracting duplicates is to use the current programme. CompDb displays the records of two databases on the screen and allows the user to decide if duplicates are present. The method is quite simple. You load two databases and page in both (note that if the second database is not structurally identical to the first then CompDb just issues an error message). Three options are now open to you. 

	(i)	Transfer a record from left to right 
	(ii)	Replace a record on right by one on left 
	(iii)	Mark record for deletion 

 It is obvious from options (i) and (ii) that CompDb can be used not only to delete duplicate records but also to create new record combinations. Deletion is done in the usual manner for databases. Records are tagged for deletion and later on you physically remove them from the database, in this case with the appropriate option on the desktop of DbStat. 
	A number of additional commands round off the options presented to the user. These include browsing through a database, full-screen viewing as well as a number of search commands which users will be familiar with from DbStat 

 

 

 8.	MergeDb 

 Syntax:  mergedb file1 file2 [/e] 

 The present utility fulfills a need which users of database managers will certainly have developed while working with databases: that of filtering out duplicates out of a database. The latter creep in quite easily with large databases as these are not files which one builds in a day so to speak so that one can quickly forget what data one had already entered and thus unwittingly give rise to duplicates. MergeDb works as follows. It takes a receiver database file1 and a donor database file2 and examines the latter to see what records it contains which are not in the receiver database. If you do not use the /e switch to specify comparison of all fields of each record (which is more time-consuming but frequently necessary) then a field picklist appears in a window on the right of the screen and you must choose a field which is to be used when comparing the records of receiver and donor databases. 
	You can break off the operation by pressing Escape at any point. Both databases are closed; the receiver database will be enlarged by as many records as were imported up to aborting the operation. 

 Notes It stands to reason that both receiver and donor database must have the same structure for MergeDb to work correctly. If not, an error message is issued. 
	Bear in mind that records which differ in just a dot, a comma, a blank or what ever are still different for MergeDb and will both occur in the receiver database after the merge operation. 
	If you just wish to filter duplicate records out of a single database then the procedure is quite simple. Create a shell database from the particular database (you can do this with DbStat) and use this as receiver database. As none of the records in the receiver are in the donor database (your original database), as this is obviously empty, all non-duplicates will be imported into the shell database. The net result is that you are left with a database cleared of any duplicates. Now delete the donor database and rename the receiver with the name of your original database. 

 

 9.	ClassFld 

 Syntax:  classfld input_file classify_file 

 This is a utility which is designed to perform a database manipulation function which is not always available in database management but nonetheless one the need for which arises quite often. ClassFld examines a field in each record of a database and counts the number of times a particular item occurs in the database. Say you have a lexical database with, among others, a field for WORD_CLASS. You would like to know (i) how many word classes occur in this field in the database and (ii) how often each word class is to be found. With ClassFld this task is completed quickly and easily. You load the programme, passing to it the name of a database (input_file) and the name of a text file (classify_file above) which ClassFld is to create with the information it gleans from the database. Immediately you are presented with a field picklist from which you choose the field WORD_CLASS for classification. ClassFld now makes one pass on the database to determine how many terms occur in this field, i.e. how many word classes are to be found in this field in the records of the database. Then it takes each term and counts the number of times it occurs in the database. Because ClassFld is written directly in C (and not in a high-level database manipulation language) it executes swiftly and your classification list is generated in no time although the programme combs through the entire database for each item in the chosen field. 

 Note The classification file is a pure ASCII text file and is deposited in the current directory. You can process the file with any text editor (such as Lexa Text) or your own word processor. 

 

 10.	PackMemo 

 Syntax:  packmemo input_file 

 This programme packs (reduces in size) the file which belongs to a memo field of a database, assuming that the file conforms to the dBASE format for such files. This kind of memo file always has the extension .dbt and the same name as the database it is associated with. The reason why packing is necessary is that .dbt files grow enormously due to the method of storing text from memo fields. The principle is as follows: 
	A memo field is a string of text (with CR’s and LF’s) located at offsets which are a multiple of 512 in the corresponding .dbt file. In the ten-byte long memo field of the database a number is contained which when multiplied by 512 gives the offset of the beginning of that memo field text in the .dbt file. Thus if a memo field contains the number 7 the offset in the .dbt file at which the text of this field begins is 7 * 512 = 3584. 
	The problem which arises is that during memo field editing, the text of the field may grow beyond the next 512 byte boundary in the .dbt file. If this occurs, the entire memo field contents are moved to the end of the .dbt file and written there; the number in the memo field place holder is updated to reflect the new offset (= No. * 512) at which the beginning of the text is now to be found. The old text of the memo field (before the current editing session) is left at its old position. This means that text is doubled and tripled and quadrupled and ... every time new text entered in a memo field window goes beyond the next 512 byte boundary. 

 PackMemo takes a database and examines its .dbt file, writes it afresh with only the latest text for each field included. Thus old remnants of text are removed and the size of the resulting .dbt file is much less than it was before. The programme updates the number in the memo field place holder so that DbStat has no difficulty in locating the text of a memo field after packing the memo text file. 

 

 

 Direct Calculation 

 1.	CalcStat 

 Syntax:	1)	cstat [file_name] 
		2)	cstat [/c] 

 1.0.	Introduction 

 For a variety of calculation purposes it is not necessary to import the data into a database. When the computation either involves a single expression or a single list of numerical data the present desktop calculator will satisfy most basic needs. Statistical measures of central tendency can be carried out with CalcStat as these only require a single numerical list. 

 When examining the ability of calculators one notices that they fall into two broad categories: those in which you can store the results of a calculation and those in which you cannot. Before one loads a calculator one will probably know whether one needs storage of calculations or not. For this reason when you start CalcStat you are given the opportunity to change the input mode from the default value Single Expression to List Processing. The mode is always visible on the top righthand corner of the screen. In the Single Expression mode whatever you enter on the input line is immediately calculated when you press Return. In the List Processing mode, pressing Return stores the value on the present input line in an array and you are prompted to enter another value. Up to 2048 such values can be stored. When you are finished entering values and wish to carry out a calculation on them, you press F5. 

 1.1.	Description of input modes 

 Remember that you can switch between the two input modes by pressing the F3 key which acts as a toggle; it can only be used when you are not actually entering data. When CalcStat starts, data cannot be typed in immediately. Instead you must press a key which leads to the data prompt line appearing. Before this occurs you can determine the input mode with the F3 key. 
	Two exceptions to this exist: (i) you specify a file on the command line as follows: 

	cstat my_nos.lst 

 In this case CalcStat automatically enters the List Processing mode and opens a window on the right for editing or (ii) you use the /c switch to force CalcStat to enter the List Processing mode, however without loading a data file. 
	Whichever of the above cases applies you must still press a key to begin entering (or altering) data. 

 1.1.1.	Single Expressions 

 By this is meant that you enter the data for a calculation on a single line (technically called an expression). An example would be the following line: 

	(234 + 56.78) / (4.77 * 1.39) - 604 

 After entering this line you press the Return key and the expression is evaluated. Expressions can be formed at will, bearing in mind that brackets are necessary in many cases to make sure that operator precedence does not cross with your intentions for a particular calculation. After a calculation has been carried out the data prompt line is empty and you can enter a new line. You may of course retrieve a previous line by using the UpArrow, DownArrow keys and pressing Return. This is convenient if you wish to carry out a calculation similar to a former one: just make the changes and evaluate the line again. Bear in mind that CalcStat can store up to 32 lines of data. If you exceed this the DownArrow key will lead you to the first line, i.e. entries are kept in a circular queue. 
	The expression line can be edited in a flexible manner by using the various keys of the User Input Editor, see the relevant appendix. 
	 Expressions are only possible with operators which take more than one operand. These are the basic four functions +, - , *, / along with % (percent), (power) and m (modulo). Unary operators such as l (natural logarithm) are placed after a single constant (number) and then evaluated as in: 34 l Return. 

	The set of possible operators is CalcStat is: 

 	1)	+	Addition 
	2)	-	Substraction 
	3)	*	Multiplication 
	4)	/	Division 
	5)	%	Percentage 
	6)		Power 
	7)    	e	Exponent 
	8)    	\tab Square root 
	9)    	m	Modulo 
	10)   	f	Fibonacci number 
	11)   	!	Factorial 
	12)   	l	Natural logarithm 
	13)   	l10	Logarithm base 10 
	14)   	s	Sine 
	15)   	c	Cosine 
	16)   	t	Tangent 
	17)   	h	Hypotenuse 
	18)   	as	Arc sine 
	19)   	ac	Arc cosine 
	20)   	at	Arc tangent 
	21)   	sh	Hyperbolic sine 
	22)   	ch	Hyperbolic cosine 
	23)   	th	Hyperbolic tangent 

 Note the following points in connection with the use of any of the above: 

 	1) Operands and operators must be separated by a blank (this does not apply to bracketing used to indicate operator precedence). 
	2) An operand can be up to 12 digits long in the single expression mode and 8 in the collect values mode. 
	3) An illegal expression is recognized by the system and the computer beeps. By means of the UpArrow key you can retrieve the defective expression and correct it. 
	4) Calculations are made to 16 places before and 4 after a decimal point. If you try to calculate a number beyond 16 digits some or all of the decimal points are lost. If the number calculated has more than 21 places before the decimal point then the left-most of these are lost. 
	5) A factorial can only be calculated for a value up to 20, a Fibonacci number with one of up to 25. 
	6) You must be careful with extreme calculations. In some rare cases the value calculated may be out of range and the result box simply displays a row of 9’s. 
	7) To save the results of the current calculation and of all previous ones, press the F10 key. The expressions and results of up to 32 calculated single expressions are stored in the file cstat.fil. If this is already present in the current directory, the information is appended to the existent file. 

 1.1.2.	List Processing 

 This mode in CalcStat works as follows. A window opens to the right of the screen. The cursor is placed on the beginning of a short line in inverse video and you can enter a number. Press Shift-DownArrow and the cursor jumps to the next line (which is empty) and you can enter another number. These values are collected in an array; up to 2048 such values can be entered. Terminate editing a list of numbers by pressing Escape. 

 You return to the position you were at before you started editing the List Processing list. With F3 you can change the input mode, with F5 you can perform statistical calculations, with Shift-F10 you can load a data file into the numeric array or by pressing Return you can resume editing the List Processing list. There follows a description of some of these individual options. 

 Shift-F10  Load data file into numeric array To facilitate carryover from one work session to another, CalcStat allows you to load a file with numerical data in it which can then be edited (change existing numbers or add new ones). Such a file must carry the extension .lst (this is automatically supplied by CalcStat when you store data from within the programme). 

 If you wish to load data from a file after you have started CalcStat or if you just want to change the data file, then press Shift-F10 and you can choose a file from the internal directory lister which is activated. Be careful at this point as CalcStat lists all the files with the extension .lst in the current directory irrespective of whether these are files which it created itself or not. 

 Shift-F9  Show full details of file in listing.  Saving data to disk When you leave CalcStat and data has been accumulated during the work session you are asked if you wish to save this to disk. F4 Equally during a work session you may press F4 to save the contents to a .lst file which only contains data from the List Processing mode (and thus is suitable for re-loading). 

 F10 If you press F10 then all numeric data is saved (including single expressions which may have been evaluated during a work session, up to 32 such expressions can be calculated; going beyond this causes CalcStat to wind around to the beginning of the queue and the initial expressions are then overwritten with those beyond 32); the latter type of file has the extension .fil and is not suitable for re-loading into CalcStat as it does not contain merely "collect values" data. 

 Once in a list of numbers you can scroll vertically (just as in any other list in a Lexa programme) by using the UpArrow, DownArrow keys; Page Up or Page Down; Ctrl-PageUp or Ctrl-PageDown or by placing the mouse cursor on an arrow and clicking the LeftButton. To edit a particular number, press the Return key. 
	To add a new value to the list press Shift-DownArrow. By this means a new entry is added to the list and you can fill it with a number. 
	It is possible to search through a collect values list of numbers. Press F2. You are prompted to enter a number for the search. If found, the number is highlighted; if not, the number pointer is not repositioned. A search can be continued from the present location by pressing Shift-F2. No entry is requested from the user as the previous input is used. If the list is exhausted, the highlight bar remains positioned on the last find. 

 1.1.2.1.	Statistical calculations 

 F5  Statistical calculations When you have typed in all the values you wish, press the F5 key for Calculate. A window appears on the right and you are presented with 11 options from which you may choose by moving the highlight bar with the arrow keys and pressing Return. 

 Typical for a series of collected values, the options available here are of a statistical nature. Their functions are obvious from the names given in the pick list window. If you choose a single option it is calculated and displayed in the result box. 

 Note To have the mode for the current list calculated as well you must press Alt-F5 (instead of Calc-F5) for all calculations. 

 After this, you are given the choice of saving it to disk. However, if you wish to carry out all the statistical calculations, then simply press Ctrl-F5 when the pick list window appears. CalcStat now generates a bar chart for the values you entered and saves this to disk. The intention of a bar chart is to offer a visual representation of relationships between numbers. Depending on the maximum of the values you entered, one block represents 0.01, 0.1, 1, 10, 100, 1000 or 10,000. This can be seen from the top line of the bar chart where the scaling and some other information is given. Both the calculated statistical values and the bar chart are saved to disk, the former in a file with the extension .cal and the latter in one with the extension .bar. The two files are pure ASCII texts which can be further processed with any word processor or text editor. 

 Note If you only carry out a single calculation on pressing F5 you are still offered the option of saving the result to a file with the same name as the data file (but with the extension .cal) offered as default name. If you have already saved a file with this name then use another as the file is created afresh on disk and overwrites any previously existing file with the same name. 

 1.2.	Function key settings 

 F1  On-line help system  As per usual an on-line help facility is available. As all the information would not fit onto one screen, a help file was created which is loaded dynamically by CalcStat when the user presses F1, resulting in the following screen: 

 You may now choose a topic on which you want help or press Escape to hide the help texts again. 

 Note For the help system to function CalcStat must be able to find (via the DOS path variable) the data file cstat.hlp and the index file cstat.ind otherwise an error message is issued. 

 Shift-F1  DOS command This is the usual means, available in most of the other programmes of the Lexa group, of executing a DOS command directly without exiting from CalcStat. An automatic return is made. 

 Ctrl-F1  DOS call Again a familiar command with which one can load DOS temporarily. The prompt on the DOS level reminds you that you have only temporarily exited CalcStat 

 F2  Number search A search facility available in the List Processing mode. 

 Shift-F2  Continue number search Repeats the search started with the above command. 

 F3  Switch input modes Toggles between the Single Expression and List Processing mode. 

 F4  Save collect values list (.lst file) Stores the numbers in the List Processing number array to disk to allow these to be re-loaded again at a future date. 

 Shift-F4  Save numeric data in list to .dbf file  A command to save the items in a possible List Processing list in the form of a dBASE compatible database which can then be read by DbStat. The database contains as many records as there are numbers in the list. Each record has a single field entitled Number with a length of 16, consisting of 11 digits, a decimal point and 4 digits after this. 

 Ctrl-F4  Clear collect values list from memory Simply empties the array for numbers in the List Processing mode. 

 F5  Perform calculation on list Opens window of options for statistical calculations on a List Processing list. 

 Ctrl-F5  Perform entire set of calculations Carries out all possible calculations on a List Processing list and generates a bar chart of the numbers of the array. 

 Alt-F5  Calculate the mode for a list as well In statistics the mode refers the value with the greatest frequency in a list. In order to calculate it one must examine the members of a list not just once, i.e. comb through the list, but the list total to the power of 2, i.e. (total x total) times. With long lists this can take considerable time; in order to avoid undue delay, the mode is not normally calculated unless the user explicitly presses Alt-F5 instead of Ctrl-F5 for All calculations 

 F7  Exit CalcStat Returns you to DOS. If you have altered any list or performed any calculation in either mode, you are prompted to save the data. 

 F8  View previous expressions On pressing this key the above screen appears and shows you the expressions which have been previously calculated. Naturally this only works in the Single Expression mode. Bear in mind that previous expressions can be retrieved by using the arrow keys. This is useful if you wish to carry out a calculation similar to one you have already made. 

 F9  Environment Offers you the usual window with some items of information relevant to your system environment. Note that the value for Free memory refers to the amount of memory left for list manipulation within CalcStat and not to the amount of system memory still free outside of the current programme. 

 F10  Save entire numeric data (.fil file)  A command to save both the items in a possible List Processing list and any expressions which may have been calculated in the Single Expression mode. 

 Shift-F10  Load numeric data from file into list.  Loads a data file from disk into the internal number array in the List Processing mode. 
 
1.3.	File types created by CalcStat 

1)	.lst	List of collected values (can serve as input again if re-loaded) 
2)	.dbf	List of collected values stored on disk as a dBASE compatible             
database 
3)	.fil	Single expressions calculated and any collected values present in 
memory 
4)	.cal	Collected values and statistical calculations performed 
5)	.bar 	Bar chart of collected values (only generated after Ctrl-F5 being 
pressed and user writing calculation results to file) 

 Note file types (4) and (5) are written when you force all calculations to be made on a value list (with Ctrl-F5). If you perform a single calculation with F5 you have the option of storing (or appending) it to a .cal file, but without a bar chart being generated and saved. 

 1.4.	Command execution via picklists 

 There are two basic means of activating commands within CalcStat. The first is that which has been discussed so far: the user presses a function key or combination of keys to start a command. The advantage of this method is one of speed, the disadvantage should be equally obvious: it is necessary to learn a large number of key combinations by heart. 
	What the beginner needs is a means of activating commands without knowing what keys are required. The solution to this dilemma is provided by a set of inbuilt picklists which are activated by a single keystroke. The user does not even have to remember what this is as it is continually prompted in the bottom righthand corner of the screen in the currently active window. Indeed any of a series of keystrokes will do here. Picklist activation keystrokes: Alt-Return, Shift-Tab. 
	Either of these will do. Once pressed a window will appear; this is one of three which can be selected by using the LeftArrow and RightArrow keys. To move within a window use _ or _ (or PgUp, PgDn for the beginning or end of a list). 

 Each window contains the text of a command and before this the key combination which has the same effect. 

 

 Corpus Management 

 1.	Corpus Manager 

 Syntax:  cm [ini_file] 

 1.0.	Introduction 

 Corpus Manager is a text database manager which takes a previously structured text and displays it record by record. The division of a text into records is achieved by placing markers at strategic points in the text. In addition to viewing a text you can search a text either directly or by means of a keyword index. 
	In order to facilitate quick extraction of information from this documentation it has been arranged according to the options in the menus on the desktop. This is the level at which you arrive when you type cm on the DOS command line and press Return. 
	The desktop is divided into several areas. First of all you notice the large shaded surface in the centre of the screen. This is normally empty but can be occupied by a window of information or an input line into which the user is to enter some item or other. 
	The top of the screen contains the names of the three menus which are available. On starting the first of these will be open. To move to the left or right use the LeftArrow and RightArrow keys respectively. Move the highlight bar with the UpArrow, DownArrow keys (or PageUp, PageDown for the first or last item in a menu). An option is chosen by pressing Return. 
	At the bottom of the screen you see the current directory (on the left of the penultimate line) and on the right a prompt as to what keys can be pressed. The last line of the screen contains a prompt as to what you can do. 
	Note If you are using a mouse (and this is active) then you can activate an option by simply moving the mouse cursor to the text of an option and clicking the LeftButton. The RightButton of the mouse is programmed to have the same effect as the Escape key on the keyboard, i.e. it cancels a command or hides a menu. 

 File checking on start-up When Corpus Manager starts the first thing it does is to check to see whether the initialization file cm.ini is present in the current directory. If so it is loaded and the initializable parameters are set to the values contained in the initialization file. For further details about this and a sample initialization file, see section 1.7. below. 

 1.1.	Consultation 

 This is the main menu on the Corpus Manager desktop and the one you will be concerned with most. All viewing and querying of the text database and any indexing and re-selection is done from here. For this reason the menu is opened automatically when Corpus Manager is loaded. 

 1.1.1.	Consult via record 

 Choosing this option causes Corpus Manager to open the currently chosen text database and present you with the headings for the first level. Before proceeding an explanation of levels is caused for. 
	Each text database can have up to three levels each below the other. For each level (if present) a set of headings will exist. After choosing the present option you are presented with those of the first level. Any heading which has subheadings on the next level down will have an arrowhead (_) to the right of it in the headings picklist which appears at this point. 

 You can activate the next level from a certain heading (again assuming that it has at least one subheading) by pressing the RightArrow key. Another picklist opens up to the right of the screen. The caption Level 2 is to be seen and the headings are listed. Again if there is a heading with yet another subheading then by moving the highlight bar to this and pressing RightArrow again you can open this further picklist. On Level 3 there are no arrowheads on the right as this is the deepest level in a database. 

           If you have moved down a level more than you wish then you can backtrack by pressing Escape. This brings you up a level and when you are on Level 1 returns you to the desktop. To exit to the desktop in one step press F7.
    	Note To navigate in the list for any level use the Up/Down Arrow keys to move an item at a time or PageUp, PageDown to jump to the beginning or end of the current list respectively.
    	F9 offers you a window with information on the current database (its size, the number of levels, etc.). 
	Pressing the Return key at any point leads to the record belonging to the heading the highlight bar is resting on being loaded and displayed. 

 You now have a number of options. To view the record use one of the following navigation keys: 

	Up/DownArrow  	Up, down a line at a time 
	PageUp/Down 	Up, down a screenful of text 
	Ctrl-PgUp/PgDn	Beginning, end of record 
	Escape		Exit record viewing 

 Information 

 F9 Show information In addition to navigation you may obtain information on the record in relation to the database. Press F9 and a window appears with statistics on the current record and database. 

 F1 On-line help Presents you with a brief help screen. 

 Searching 

 Ctrl-F  Find string in current record.  After entering a string for the pending search, Corpus Manager moves down in the current record and displays the first instance of the search string (or moves to the end directly if there is no find). You are now prompted to either (i) press any key for further occurrences or (ii) press Escape to interrupt the search operation. 

 Ctrl-N  Find next occurrence of string. Continues searching for a string entered at an earlier stage. If no search string is available to Corpus Manager then this command is the same as the previous one. Notes Search strings are retained while you change records so that there is no necessity to enter a string a second time just because you have changed record in the meantime. An alternative keystroke to Ctrl-N is F2. 

 Ctrl-D  Display current search string. Shows you the current search string on the last line of the screen. Press any key to continue. 

 Saving 

 F10 Save record to text file The current record can be saved to a text file of your choice. To realize this press F10. A prompt and an input line appear. 
	Enter a name for the file to which the record is to be saved (you can use the keystrokes of the User Input Editor (see the relevant appendix) to edit the input line). The text is stored and can be viewed / edited with any text editor or word processor. 

 Display 

 Ctrl-Q  This key combination toggles between the two sets of colours used for record display. Normally text is displayed as white lettering on a blue background. This can be changed to black lettering on a light grey background with Ctrl-Q. 

 Ctrl-F3  A command with which you can have spaces, tabs and line-ends displayed as dots and a special end-of-line symbol. Useful for checking on the optical layout of a text. 

 Note The reference to keywords in the lower right of the screen is of no relevance when consulting a text database via record (see following section on keyword consultation). 

 1.1.2.	Consult via keyword 

 Assuming that a valid and current keyword index exists for the presently selected database (it must have the same name as this and be in the current directory), the screen changes and you are offered the keywords from the index in the form of a picklist. 

 Move the highlight bar to the keyword you wish and press Return. Now another window opens with a list of those records from the current database which contain this particular keyword. As with consultation via record, you move the highlight bar to the record you want and press Return. The screen changes and the record is displayed. 
	Note in this connection that in the bottom righthand corner of the screen a reference to keywords is to be found. When you first choose a record the display of keywords will be on and these will appear in inverse video on the screen. This can be turned off with F3 (and back on again with the same key if desired). 
	When a record is displayed by Corpus Manager you see the first 23 lines on screen. Although the keywords switch might be turned to "on" it may be that you do not see any word in inverse video. In this case move down the record with either the DownArrow or the PageDown key. Somewhere in the text of the record there must be an instance of the keyword otherwise the record would not have appeared in the list of occurrences on the previous screen. 

 The navigation keys and the action associated with the Escape key are exactly the same here as for consultation via record. 

 1.1.3.	Choose text database 

 Should you wish to use any database name other than that specified in the initialization file then you must choose your database from a directory listing with the present option. The directory lister (see relevant appendix) is activated and you select a database. Only those files which have the extension .tdb (= Text DataBase) are listed as this is a requirement for all databases used in conjunction with Corpus Manager. 

 A file check is done after you have chosen a database to see whether (i) a database index and (ii) a keyword index of the same name are present in the current directory. Say you choose a database called special.tdb then Corpus Manager searches the current directory for special.ind (the database index) and special.key (the keyword index). If either is missing you are notified. 

 1.1.4.	Re-index text database 

 This is a necessary step if you (i) edit an existing database or (ii) create a new one. No user input is required as the name for the index is automatically derived from the currently selected text database. 

 The index is always created afresh. A line counter shows you that Corpus Manager is working. When completed you press a key; the newly generated index is used with the database the next time there is call for this. 

 1.1.5.	Generate keyword index 

 On choosing this option the first thing the user must do is specify the name of a keyword input file (a prompt and a user input line to this effect appear in the centre of the screen). The reason for this is that while Corpus Manager generates a keyword index with an automatic name and extension it does not know in advance what the input file (i.e. the list of keywords to be located in the text database) is called. 
	Assuming that you enter a valid file name, that it is found and that Corpus Manager is satisfied that it is suitable, the indexing begins. At this point you notice that each keyword from the input file is listed in a window in the centre of the screen. Below this a count of the occurrences is to be seen. If the search is unsuccessful then the counter remains at 0. When the keyword list from the input file is exhausted the procedure is completed and you may continue with other options. 

 1.1.6.	Parameters for search 

 There are various routines for searching through a text database in Corpus Manager. You may select an option from the desktop window Direct Search or may query the current record online when viewing it. In either case the search algorithm uses information stored in three variables the values for which can be altered with the present option. 
	The search parameters indicated in the window presented here should be self-explanatory. Try them with different values to see what effects they result in. Note that the third parameter only applies to wild card searches (see below) as only with these is a return with spaces in lieu of a wild card possible. 

 1.1.7.	Show current settings 

 Here you are simply offered a window with the name of the current text database, the record index belonging to this and a keyword index if one has been generated for the current text database along with information on record structure. 

 1.2.	Direct search 

 Text consultation is one main aspect of Corpus Manager; the second is searching through the text database for user-specified contents. While searching is in fact realized indirectly by keyword indexing, the second menu on the desktop is concerned with the possibilities of online searching through a text database. 

 1.2.1.	Simple text search 

 The easiest type of search is the simple text search. You are prompted to enter a search string. Having done so and terminated with Return Corpus Manager begins examining each record for occurrences of the search string. Once the search is completed the system returns you to the second desktop menu. It is up to you to select the second option to view the finds reached during the search. 

 Note A simple search can be case sensitive (lowercase and uppercase letters are not treated as the same) or insensitive. To change press F5 as prompted during user input and alter the relevant search parameter accordingly. You can interrupt and cancel a search at any point by pressing the Escape key. 
	The output of a search is kept in memory by Corpus Manager and can be consulted at any time from the desktop. It is furthermore stored to disk in a file which has the same name as the current text database but with the extension .sch (= search). If this file is found by Corpus Manager when started again then it is automatically loaded into memory and can be consulted without the necessity of repeating the search. The .sch-file contains the names and locations of the records with the search string and a reference as to what database level these are on. 

 1.2.2.	Examine search output 

 To look at the output of a search (done during the present session or a previous one) you choose this option. The screen changes and you are presented with a picklist as with a keyword index. However, there is only one item listed here, namely the search string. Pressing Return presents you with the list of available records with this string. The rest of the procedure is identical with consultation via keyword. With F3 you can toggle keywords on and off during record display. 

 1.2.3.	Wild card text search 

 When you choose the present search option the DOS wildcards ? and * (with the same meanings, one or more than one unspecified character respectively) are valid in a search string. The input line is similar to that for a simple search. Search parameters can be specified via a pop-up window activated with F5. 

 Note The search parameter allow spaces works as follows. Say you enter com*e as a search string with wild card. Possible returns would be compute, combine, etc. If you allow spaces then Corpus Manager may include blanks in the returns for a string which begins with "com" and ends in "e", e.g. "commit those". 
	Once a wild card search has been carried out you are presented with a list of the matches. This appears on the desktop in the form of a list of words (or phrases or fractions of words). From this list you can now choose one and a simple search is carried out on it. The procedure from here on is identical with that for the simple search option. 

 The output of a wild card search is kept in memory by Corpus Manager and can be consulted at any time from the desktop. It is furthermore stored to disk in a file which has the same name as current text database and the extension .wcs (= wildcard search). If this file is found by Corpus Manager when started again then it is automatically loaded into memory and can be consulted without the necessity of repeating the search. The .wcs-file contains the list of the matches for the last wild card search carried out from the desktop in Corpus Manager. 

 1.2.4.	Show wild card finds 

 This option offers you the picklist with the finds for a wild card search assuming that one has been carried out or Corpus Manager has loaded the results of a wild card search (from a previous session) from a .wcs-file. From here on the option is identical with the previous one, i.e. you choose a match and a simple search is done on it. The results are retained as output of a simple search and can be examined with records displayed in the usual manner. 

 1.2.5.	Run pattern matcher 

 By default the pattern matcher from the Lexa package, Lexa Pat, is called when you choose this option. From here you can carry out a whole host of search types on any text or group of texts. The results can be written to file or viewed online. Lexa Pat is controlled from a desktop which is quite similar to that of Corpus Manager. 

 1.2.6.	External string search 

 Calls by default the string searcher Lexa Search, again from the Lexa package. It offers a neat way of finding strings quickly and easily in any files in any group of directories (without wildcards, these are handled by Lexa Pat). The matches can be viewed on screen as they are found if you like or you can write the outcome of a run to a text file for later examination. Note You may specify other programmes than the default ones to be loaded for these options by entering their names in an initialization file, see 4. below. 

 1.3.	DOS services 

 A number of frequently required options have been collected together to form this third and last menu on the Corpus Manager desktop. 

 1.3.1.	Load text editor 

 The first option calls the text editor Lexa Text (part of the Lexa set, see Vol.1 for details) by default with which you can edit the text which is to form a text database. Four texts can be edited at once; block processing, find and replace, undo deletion are all available along with a file manager. Recommended practice would be to edit stretches of text with Lexa Text, link these together to a large text with Lexa Chain (see Vol.3 of present documentation for details) and then use the resulting file as a text database from within Corpus Manager. 

 1.3.2.	Run database manager 

 Here the database manager of the Lexa package, DbStat, is loaded by default. A different programme can be called here (as with the user text editor, see previous option) by specifying this in an initialization file. 
	Note DbStat processes databases which are structured according to the so-called dBASE format (see above section for relevant details). These files are quite different from the text databases which Corpus Manager generates and processes. 

 1.3.3.	Execute DOS command 

 Presents you with an input line. You can enter any programme or batch file name or operating system command. This is then passed on to DOS which attempts to execute it. An automatic return to Corpus Manager is made. 

 1.3.4.	Load DOS temporarily 

 It is frequently opportune to load the operating system temporarily rather than unloading Corpus Manager to go to DOS. The present option does this, forcing Corpus Manager to recede into the background. The prompt on the DOS level indicates that you have left Corpus Manager temporarily; by typing exit and pressing Return you re-enter Corpus Manager as if nothing had happened. 
	Note If you intend to load a large programme from the DOS level then bear in mind that Corpus Manager occupies about 150K of system memory which is naturally not available to any further programme which might be loaded. DOS can also be loaded by pressing the key combination Ctrl-F1. 

 1.3.5.	Display environment 
	 A windowful of information relevant to the system environment in which you are working is offered. You can check on the current and original path name on the amount of disk space which is available and importantly on the amount of system memory which is still free. 

 1.3.6.	Show directory list 

 Activates the directory lister. This is useful if you wish to check on what files are currently located in a directory. Bear in mind that you can view files on the directory level with the programmes set to the F2, Shift-F2, Ctrl-F2 keys, namely Lexa View, Lexa Text and Lexa Hex respectively. 

 1.3.7.	Set current directory 

 The current directory is always to be seen on the desktop on the left of the penultimate line of the screen. This can be changed with the present option. There may be a good reason for doing this, e.g. if you wish to access text databases in another directory and/or drive. An input line appears in which the current directory is inserted by default. Change this to the value you wish and press Return. Assuming that the entry corresponds to a valid directory a change is made otherwise an error message is issued. Note When you exit Corpus Manager you are always returned in the directory from which you started the programme. Bear this fact in mind in case this is different from the directory you were working with while processing a text database. 

 1.4.	Function and special key settings 

 F1  Online help Here you are offered a screenful of information on the intention of Corpus Manager and on its basic operation. The help screen is merely intended as an initial orientation and does not replace the current manual in any way. 

 Shift-F1  DOS command On pressing this key combination an input line appears in the centre of the desktop screen and you can enter any valid command which is then passed on to the operating system for execution. If a programme corresponding to your input can be found then it is executed; if not, nothing happens and you are left on the desktop. 

 Ctrl-F1  Load DOS This key combination has the effect of loading DOS temporarily while retaining Corpus Manager in the background. 

 F7  Exit Corpus Manager Returns you, after confirmation, to DOS. 

 F9  Show environment.  This command is the same as the corresponding option in the rightmost window on the desktop. 

 1.5.	Structuring text files 

 Before you can use a text you have already created as a text database for Corpus Manager you must store it as an ASCII text. This probably involves loading the file with your word processor (e.g. WordPerfect or Microsoft Word) and then saving it to disk without any formatting information (see glossary for definitions of these terms). When saving the file ensure that you use the extension .tdb (text database) so that Corpus Manager can recognize it formally as a text database. 
	Once you have created a text file with the correct extension you must now edit it with an ASCII text editor; for this purpose the editor Lexa Text with some special processing features has been included in the Lexa package. The structuring of the text is done by planting markers at strategic points in the text as explained below. 
	In order to understand the matter at hand the user is advised to load the supplied text database sample.tdb and to read the text and check the text on the screen of the computer at the same time. 
	You will have noticed that when you consult the supplied text database that a window with headings appears. Not only that but there are two further windows with more headings which are available with some records (depending on whether a right arrowhead (_) is to be seen after the heading in the current window or not). The first window which appears is the first level, the second window the second level, etc. Up to three levels are permissible. There can be up to 1,000 headings per window on any level. 
	The text of the headings is gained from the index file of the current text database by Corpus Manager when it enters the record selection level. The index file in its turn has obtained the headings from the text database itself. If you now look at the text of sample.tdb on the screen of your computer then you will notice that at the very beginning there is a line with a shaded block symbol followed by blank and then by the word "Introduction". The word forms a heading and the shaded block determines the level (i.e. window) on which the heading is to be found within Corpus Manager. 
	There are 3 possible types of shaded block symbol which are used to signal levels as follows (their ASCII values are offered in brackets): 

	$176	Identifier for Level 1 record 
	$177	Identifier for Level 2 record 
	$178	Identifier for Level 3 record 

 Level identifiers (as the shaded block symbols are referred to) can be nested but for each identifier there must be a terminal identifier. The latter is composed of the shaded block symbol followed by ASCII $27 (= Escape). 
	You cannot have two identical level identifiers in a text without a terminal identifier between them, i.e. each level identifier must be followed by a terminal identifier at a later point in the text before it can be used again. However, different level identifiers may be nested, indeed frequently are, to indicate that a heading on one level has one or more subheadings. 
	Bear in mind here that if a series of headings are subordinate to another heading then they must come at the end of the text of this higher heading and before the terminal identifier so that Corpus Manager can recognize that the subheadings belong to the higher heading. 
	To see how this works in practice take a close look at the printout of the sample database on the following pages. Pay particular attention to the level identifiers and their corresponding terminal identifiers. 

 Introduction 

 Introduction 

 The bicycle is one of the more sensible inventions of Western industrialized society. It combines the practical need of getting from A to B with a welcome amount of physical exertion which contributes to the maintenance of good health, both of body and soul. 

 History of bicycles 

 History of bicycles 

 The bicycle as we know it today with two equally large wheels, pedals between them which are linked via a chain to a cog on the hub of the back wheel was developed by H.J.Lawson in 1879. 

 [ 

 (These lines form a comment embedded in the text database. As it occurs between a terminal record identifier and a following initial record identifier it is ignored by Corpus Manager.) 

 Present status 

 Present status 

 In a time of heightened awareness of the environment the bicycle as a fuelless vehicle has increased immemsely in importance for short distance travel. 

 [ [ Kinds of bicycle 

 Kinds of bicycle 

 Basically one can divide bicycles into two types, those used for everyday purposes and those which are intended for use in sport. 

 Bike as work horse 

 Bike as work horse 

 A bicycle is an allround, general-purpose means of transport. You can attach a basket to either the front or rear or both. Considerable loads can be managed this way (your week’s shopping for instance). Mountable seats are available for carrying children so that you can and should leave your car at home. 

 [ Cycling as sport 

 Cycling as sport 

 From a medical point of view cycling is an ideal form of sport. It trains your general condition without any one-sided strain being put on any part of the body. There is no burden placed on the joints, as in jogging; in brief cycling is second only to swimming. 

 Racing bike 

 Racing bike 

 Racing bikes are constructed with a view to maximizing speed. They are very light, have narrow tyres, a curved handlebars (to enable you to bend over them and thus reduce wind resistance). Speeds of between 30 and 50 mph can be reached easily, depending on slope and direction of wind. 

 [ Mountain bike 

 Mountain bike 

 A recent development in which certain qualities have received special emphasis. Mountain bikes have a large number of gears (18 or 21 are typical values) which allow one to overcome the steepest hills with ease. The broad tyres with good grip make them suitable for off-the-road touring. The wide handlebars are useful for balancing in tricky situations. 

 [ [ [ Buying a bicycle 

 Buying a bicycle 

 Don’t be stingy when it comes to investing in a good bicycle. Make sure that the frame is forged from good material and check to ensure that the gears are solid and reliable. To avoid continually repairing punctures, insist on having reinforced tyres. 

 [ Looking after your bike 

 Looking after your bike 

 A good bike can stand being left in the rain. However, be careful to oil the joints at regular intervals and clear the wheels and pedals of any dirt which might accumulate. Have your brakes seen to and check on the precision of the gears at least every six months. 

 [ 

 Note You may include comments in a text database between a terminal and a following initial identifier. This is then ignored by Corpus Manager (see instance above). 

 1.5.1.	Limits on text structures 

 In order to manage text databases effectively some practical limits have had to be set to size and structure. Users should note the following points. 

(i)	All identifiers must be the first symbol on a line (otherwise they are ignored). 
(ii)	The ASCII characters $14 and $15 can be used to enclose a word or stretch of   text to be displayed as bold lettering on screen. 
(iii)	A line in a text database should not be longer than 160 characters as the rest would be invisible, i.e. not displayed on the screen; a line of up to 160       characters is split up into two screen lines if it exceeds 80 characters. 
(iv)	A level within a text database and a keyword list can be up to 1,000 items long. 
(v)	A single record in a text database can have a max. length of 8,000 lines. 

 1.6.	File types used and generated by Corpus Manager 

 Users should develop an awareness of characteristic extensions used by Corpus Manager for various files which it may create or process. The most important of these is the first, .tdb, which is used for the actual text database. This is the only file which is essential. All other types can be generated from the desktop when required. Each file is an ASCII text file and can be edited with any text editor, e.g. Lexa Text However, you are explicitly advised not to tamper with the output files from searches or index files which are created by Corpus Manager. The information these contain is arranged in a precise order. Altering a single byte in an index file will mean that it no longer functions correctly. 
	 .TDB   Text database  The actual text file which you designate as database        and which is used for consultation. 
.IND   Index (for text database)  An auxiliary file which is used by Corpus Manager to instantaneously locate records in a text database. 
.KEY Keyword index  Another index, this time to indicate the offsets for        records which contain occurrences of certain keywords. Note that you require a keyword list in file form as input for the option on the desktop which generates a keyword index as Corpus Manager must know what words to search for in the text database. 
.SCH Results of simple searchA text file generated during a search        through a text database. Contains offsets for records with instances of the        search string.	 
.WCS Results of wild card searchAnother text file with references        concerning matches for a search string with a wild card. This file is in turn        used as input for a simple search which then leads to the display of records with matches. 

 Note The name of a file (the letters or digits, up to 8, which may be in front of the dot) is irrelevant to Corpus Manager. It is only concerned with the extension. However bear in mind that once you have declared a file a text database then Corpus Manager uses its name when generating any files connected with it. For instance, if you have a text database sample.tdb then the index file for this will be sample.ind, a keyword index file would be sample.key, a simple search file sample.sch, etc. 

 1.7.	Using initialization files with Corpus Manager 

 To obviate the necessity of specifying standard information each time you load Corpus Manager the programme has been designed to cater for initialization on starting. This is achieved by loading a file at the beginning and gleaning information for parameters from this ASCII text file. There are twelve items of information which can be seen from the print-out of the supplied initialization file cm.ini offered below. 
	If you load Corpus Manager by simply entering cm from DOS then the programme automatically looks for an initialization file called cm.ini. Should you wish to use a file with a different name then you must enter this on the DOS command line after the programme, e.g. cm special.ini would load Corpus Manager with standard information taken from an initialization file called special.ini which is presumed to be in the current directory. 
	The extension .ini is not strictly speaking necessary as Corpus Manager will supply it if it is missing. 
	A drive and directory can be entered before the name of an initialization file if it is anywhere other than the current directory, e.g. cm d:\my_files\special.ini 

 Sample initialization file: cm.ini 

; This is the initialization file for Corpus Manager. It is a normal ASCII
; text file which you can edit with any text editor (such as Lexa Text).
;
; Note that the programme only reads information from those lines which do
; NOT begin with a semi-colon.
;
; To indicate a positive value for a parameter you may type either
; the word "yes" or the number "1" (without inverted commas). A
; negative value is symbolised by either "no" or "0".
;
; If you change any parameters then be very careful to keep
; to the pre-determined format as outlined in the comments below.
;
; Corpus Manager only reads the setup file on starting. To operate the
; programme with altered parameters you must exit, edit this initialisation
; file and start Corpus Manager again.
;
;
; 1: Name of text database file
;    (Leave empty if you wish to use the current DOS directory)
;
EME_CORR
;
; 2: Name of keyword input file
;    
;
PRONOUNS.LST
;
; 3: Name of your text editor, max. 30 chars. (name and path)
;    (Leave empty if you wish to use Lexa Text as default)
;
CME
;
; 4: Name of your database manager, max. 30 chars. (name and path)
;    (Leave empty if you wish to use DbStat as default)
;
DBLOOK
;
; 5: Name of your pattern manager, max. 30 chars. (name and path)
;    (Leave empty if you wish to use Lexa Pat as default)
;
LPAT
;
; 6: Name of your external search programme, max. 30 chars. (name and path)
;    (Leave empty if you wish to use Lexa Search as default)
;
LSEARCH
;
; 7: Name of the directory to be used, max. 30 chars. (name and path)
;    (Leave empty if you wish to use the current DOS directory)
;    (Enter CM.EXE to use the home directory of the programme)
;
CM.EXE
;
; 8: Use black on white display when viewing records?
;
;
yes
;
; 9: Distinguish case when generating keyword index file
;    
no
;
; 10: Only register whole words when generating keyword index file
;
no
;
; 11: Allow spaces with wild card searches through text database
;
no
;
; 12: Search string used when querying text record online (max. 34 chars.)
;
letter
;
; 13: Name of batch file to execute on start of programme
;
GER_KEYB.BAT
;
; 14: Name of sorting and search file (.CEF file)
;
helsinki.cef
;
; 15: Width of tab to be used for text display
;
4
;
; 16: No. for user font activation. This parameter has to do with VGA
; adapters which differ in certain respects. There are some which require
; 8 for the activation of a user font in an internal register and some which
; demand the figure 32. Try these two out. I'm afraid that if neither of these
; works, there is not much you can do. There may be the odd VGA adapter which
; is not 100% compatible with the industry standard and which does not support
; user defined fonts.
;
;32
8
;
; 17: Database to load on pressing Tab when viewing text
;
BIBLIO.DBF
;
; 18: Text file containing terms for online dictionary (must have the
; extension ".DIC").
;
LINGUA.DIC
;
; 19: Use computer bell? (not in libraries for instance!)
;
no
; 

 1.8.	Supplied databases 

 There are three text databases supplied with Corpus Manager. The simplest and smallest is SAMPLE.TDB which is just intended to show users how a typical database is structured by placing level identifiers at strategic points in the text. 
	The second text database is a complete book on computing for beginners, PC_KNOW.TDB, which the present author has used over the past few years in university courses on computing. It contains the basic facts about personal computers arranged into chapters on typical areas. A dictionary of terms in also included. 
	The third database is a section of the Helsinki corpus of diachronic English, EME_CORR.TDB. It consists of a selection of Middle English and Early Modern English letters which have been arranged in such a manner that the user (here: the linguist) can orient himself easily in this body of data. 
	All the databases have been pre-indexed so that you can start working with them immediately. Remember that searches through a text database can be made online, from the desktop or while viewing a text record, or by writing a keyword file and then having Corpus Manager comb through the current database for finds (see relevant section(s) above). 

 

 2.	Character Index 

 Syntax:  charind file1 file2 $ (/c) (/a) 

 The purpose of the present programme is to generate a word list from the file1 specified on the DOS command line, storing it as file2. The word list consists of a list of all the words (but only registered once) which are preceded by the character which is passed to the programme at the position of $. 
	CharInd begins by combing through the input file for occurrences of the symbol passed to it (say an asterisk *). On each find it then stores the word following this assuming that this word has not already been deposited in its internal word list. When it has finished combing through file1 it saves its word list to disk as file2. This is then a list of all unique words occurring in file1 and preceded by the symbol passed at $ in the command line. 
	The use of this is obvious: you mark words in a text with a specific unambiguous character (an asterisk, a tilde, or whatever) and then run it through CharInd to obtain a list of the words so marked. This list can then serve as an input file for the Generate keyword index option on the desktop within Corpus Manager. 
	Up to 10,000 different words can be registered by CharInd. 
	Two switches are provided for with the current utility. The first, /c, forces CharInd to ignore case differences when examining a text file so that instances like The and the would be regarded as the same and only deposited once in the word list subsequently generated. The second switch, /a, causes Corpus Manager to only process those characters which lie between $32 and $126, i.e. normal (English language) text. 

 

 3.	DosDemo 

 Syntax:  dosdemo 

 This utility is aimed at conveying to beginners in computing a feeling for the operating system MS-DOS. The experience of the present author is that beginners have difficulty in grasping how the operating system works and neglect it as they fail to see its relevance (after all one wants to proceed to word processing or database management or whatever as quickly as possible). Nonetheless a thorough understanding of the operating system is the surest guarantee against the type of disasters which beginners are beset by, e.g. overwriting files, losing them in directories, failing to save data in system memory before exiting from a programme, formatting disks with data, etc. 

 No further explanation is required for DosDemo. All the user has to do is to read the text on the screens he/she is presented with and press the keys as prompted by the programme. 

 Note The file dosdemo.txt must be accessible (via the DOS path variable) for the last menu item (Dictionary of Terms) to operate successfully. 

 

 4.	DosDict 

 Syntax:  dosdict [input_file] 

 The present programme is an example of a small database manager. This time the structure of the database is radically different from those used by DbStat and more flexible in a way in the uses to which it can be put. Consider to start with the screen which one is presented with on loading DosDict (assuming one has loaded it with a database file containing data). 

 The database in this case consists of only two fields. The first is labelled Heading and is 30 spaces long, the second is labelled Entry and is 480 spaces long. From this one can see that the intention of DosDict is to provide the user with a text database which is based on a label called Heading and a stretch of text called Entry. The entries in this text database are sorted according to the contents of the Heading field. It is completely irrelevant to DosDict what information you store in the Entry field. You can vary it as much as you like. The principle is the same as that of a dictionary. A set of records is alphabetically sorted based on a keyword; one can then retrieve the text of a record easily by searching for a specific keyword. You can experiment with DosDict and by using your imagination create your own customized dictionaries for your specific purposes. 

 5.1.	Description of commands 

 F1  Help  A help window can be displayed at any point in DosDict. Press any key to return to where you left off. 

 Ctrl-F1  DOS Call  This is the method of loading DOS temporarily which you are acquainted with from the other programmes of the Lexa group. When you have finished what you want to do in DOS type exit as suggested by the temporary DOS prompt and you are returned to DosDict as if nothing had happened. 

 F3  Search  It is obvious that searching is a central function in any database management system. In DosDict this is realized quite simply. You press F3. A picklist opens on the left of the screen and you are prompted to choose one of the two fields from the database which is to be searched through for user-specified contents. A cursor now appears in the input line below the record counter and you are prompted via a message at the bottom of the screen to enter the contents of the record field you wish to search for. In this connection a few points should be borne in mind. 
	Firstly, searching is case-sensitive. Say you are looking for the entry for DOS type dos then no match will be found. 
	Secondly, searching is non-exact. By this is meant that you do not have to enter the full form of the strings you are looking for but only as much of it as is necessary to delimit it from other potential strings. For instance entering comp as a search string will lead to DosDict finding computer, but maybe another string such as compile as well. 
	Thirdly, a search always starts at the current position in a database and stops at the first entry which matches the string or at the end of the database (no find!). If your search string is not precise enough DosDict may return a match which does not correspond to the record you wish to locate. A correlate of the search procedure is that you must be alphabetically positioned before the record to find it. Say you are presently positioned in the middle of a database (at a record with an entry beginning in "L") and now start a search for a string beginning with "C" then DosDict will not find it, if it exists, as it always starts searching at the current position in the database. 

 Ctrl-G  Goto record  To retrieve a record onto the screen within DosDict you can either search for it (as described above) or if you know the number of the record you can use the present option. You are prompted to enter a number and the system jumps to that record. If the number entered is beyond the range of the database then the last record is displayed. 

 F4  Delete  With this command you are prompted to decide if you wish to delete the current record or not. Only pressing the y key explicitly will lead to the record being deleted. A message to this effect is issued and the record counter is decremented. The deletion has of course merely taken place in memory. Only if you save the database to disk will the record also be deleted from disk. 

 F5  Load new file Activates the directory lister to allow the user to load a new data file. Before this happens, however, you are prompted to save the current file. Only after taking a decision on this is it possible to load a new file. Pressing Escape in the directory lister leads to the load command being aborted and you are returned to the file you were editing. 

 F6  New Record  This simply adds a new record and enters the edit mode. The new record is then located at the alphabetically correct position in the database going on the field Heading. 

 F7  Exit  The usual means of exiting a Lexa programme with internal commands. You are reminded by DosDict to save the current database to disk as otherwise all changes made in the present work session are lost. Remember that when prompted to save data to disk you must explicitly press the n key to not save the memory file. Any other keypress will lead to a save to disk. 

 F10  Save current database This command will store the database on disk allowing you to specify the name for the file to be created for saving the database presently in memory. If there is already a file on disk corresponding to the name you enter then you must confirm overwriting it. 
	The files which DosDict generates are SDF files (see section on DbStat above). They can be read into almost any database management system. Each record is 510 + 2 bytes long, i.e. 2 records fit into 1K of memory (the 2 extra bytes consist of a carriage return and line feed at the end of each line which contains a single record). It has been tested with 800 records (400K) and worked effortlessly. The limiting factor is the system memory of your computer. 

 A note on editing text.  Record editing in DosDict is realised as follows: you press Return and the cursor appears in the first field. When you have finished editing the Heading field you press Return. This repositions the cursor at the beginning of the Entry field. You can now edit the text in this window. As you enter text it is word-wrapped around to a new line if it gets too long for a single line. This applies irrespective of whether you are currently at the end of the text or somewhere in the middle. You can locate the cursor at a certain position by pressing the LeftArrow or RightArrow keys to move horizontally or the UpArrow or DownArrow keys to move vertically. 
	There is a total of 9 lines in the Entry window. On entering this window you will notice that a counter appears after the words Field Size: at the bottom righthand corner of the record window. This indicates the number of characters contained presently in the field. If you delete characters the counter is decremented, if you add characters it is incremented. Furthermore if you reach the figure of 480 then you cannot enter any more characters as this is the size limit of the Entry field. If you attempted to fill up the nine lines of the Entry window completely then this limit would be reached somewhere in the ninth line. But in practice it is hardly ever reached because DosDict word wraps text in the Entry window and so each line is never maximally filled. The word wrap can be forced at any time when editing the Entry field by pressing F2 for "Reformat"; this leads to the cursor being repositioned at the top left of the Entry field. You may exit from the editing mode by pressing Return and continue paging in the database. As always, Escape leads to possible changes being abandoned. 

 Note A sample dictionary database, dosdict.lex, with over 120 entries, is included as illustrative material. 

 

 5.	DosHelp 

 Syntax:  doshelp 

 Although the present author is the last person to start spoonfeeding computer users, one must recognize the fact that most users simply do not read reference manuals (the computer user who is reading these lines is a laudable exception, of course). Because of this I have taken the step of providing a set of on-line help texts for MS-DOS in the hope that users will thus improve their acquaintance of the operating system and thus avoid the disasters which invariably result from ignorance of the latter. 

 The left column of the screen contains a list of the more common commands of MS-DOS. In the main part of the screen is an explanatory text on the command which is highlighted in the lefthand column. You can safely assume that those DOS commands which are not included here are only of peripheral interest. 
	You can move the highlight bar by using the UpArrow, DownArrow, PageUp, PageDown and Ctrl-PageUp, Ctrl-PageDown keys. As you do so the text in the main window changes continually. You have no control over the display of the text and cannot edit it. Escape returns you to DOS. 

 

 Bibliography, Glossaries, Appendices 
 
 Bibliography on Statistics 

 Note Users of DbStat will require a textbook on statistics to accrue maximum benefit from its inbuilt statistical functions and to have access to the statistical tables which are necessary when interpreting the results of many operations. The present bibliography is intended as a brief orientation for those who wish to use such a textbook and so gain more insight into the purposes to which statistics can be applied in linguistic analysis. 

 Brookes, B., W.Dick (1951) Introduction to statistical methods. (London: 
	Heinemann). 

 Butler, Ch. (1985) Statistics in linguistics. (Oxford: Basil Blackwell). 

 Coxon, A. (1982) The user’s guide to multidimensional scaling. (London: 
	Heinemann). 

 Croxton, F., D.Crowden (1960) Applied general statistics. (London: Pitman). 

 Downie, N., R.Heath (1965) Basic statistical methods. 2nd. edition. (New York: 
	Harper and Row). 

 Edwards, A. (1964) Statistical methods for the behavioural sciences. (New York: 
	Holt, Rinehart and Winston). 

 Erricker, B. (1971) Advanced general statistics. (London: Hodder and 
	Stoughton). 

 Fisher, R., F.Yeates (1974) Statistical tables. 6th. edition. (London: Longman). 

 Fleiss, J. (1981) Statistics for rates and proportions. (New York: Wiley). 

 Hoel, P. (1960) Elementary statistics. (New York: John Wiley). 

 Kendall, M. (1970) Rank correlation methods. 4th. edition. (London: Griffin). 

 Lindley, D., J.Miller (1953) Cambridge elementary statistics tables. (Cambridge: 
	University Press). 

 Marriot, F. (1974) The interpretation of multiple observations. (New York: 
	Academic Press). 

 Maxwell, A. (1977) Multivariate analysis in behavioural research. (London: 
	Chapman and Hall). 

 Meddis, R. (1984) Statistics using ranks: a unified approach. (Oxford: Basil 
	Blackwell). 

 Morrison, D. (1976) Multivariate statistical methods. 2nd. edition. (New York: 
	McGraw-Hill). 

 Neave, H. (1981) Elementary statistics tables. (London: Allen and Unwin). 

 Overall, J., C.Klett (1972) Applied multivariate analysis. (New York: 
	McGraw-Hill). 

 Porkess, R. (1988) Dictionary of statistics. (London: Collins). 

 Quenouille, M. (1950) Introductory statistics. (Oxford: Pergamon). 

 Richards, J., J.Platt, H.Weber (1985) Longman dictionary of applied linguistics. 
	(London: Longman). 

 Siegel, S. (1956) Nonparametric statistics for the behavioral sciences. (New 
York: McGraw-Hill). 

 Spearman, C. (1904) "The proof and measurement of association between two 
things". American Journal of Psychology 15, 88-103. 

 Wetherhill, G. (1972) Elementary statistical methods. (London: Chapman and 
	Hall). 

 Winer, B. (1971) Statistical principles in experimental design. (New York: 
	McGraw-Hill).  

 Woods, A., P.Fletcher, A.Hughes (1986) Statistics in language studies. 
	(Cambridge: University Press). 

 Yule, G., M.Kendall (1950) An introduction to the theory of statistics. (London: 
	Griffin). 

 

 Glossary of Statistical Terms 
 
 25th. Percentile With a sorted series of values, the value which is quarter of the distance from the lowest value. 

 75th. Percentile With a sorted series of values, the value which is three quarters of the distance from the lowest value. 

 alpha An error in statistics in which the null hypothesis is rejected even though it is true. Also called a Type I error. 

 Mu A symbol used to reference the true population mean. 

 Sigma A symbol used to refer to the sum of an expression. 

 sigma A symbol representing the standard deviation of a sample. sigma2 represents the variance. 

 alternative hypothesis An assumption in statistics that two variables are different. Often used as a basis for showing that a dependency exists between two parameters in a population. Symbolized as H1. 

 analysis of variance (ANOVA) Refers to those techniques used to determine to what extent the variability in a set of observations is due to different causes. 

 association A tendency for two events to occur together. Used also with reference to variables where the term correlation is more appropriate when saying whether the values of one variable depend on those of the other. 

 average A measure of central tendency, more accurately called the arithmethic mean. It is attained by summing the scores and dividing the result by the number of scores. 

 bar A diacritic placed above a symbol to indicate that it is a mean, e.g. d-bar is a symbol for the mean difference, x-bar is the mean value of a set. 

 biased A calculation of the standard deviation in which the total number of values is taken as it is; an unbiased calculation is one where 1 is subtracted from the total (i.e. N-1 is used). 

 bimodal distribution Any distribution which has two peak values, i.e. two modes. 

 block sampling Any sample which starts at a certain value (which may be randomly determined) and continues for a specified distance. 

 cell With any table, a cell is the intersection of a row and a column. Rows are usually labelled using Roman letters and columns using Arabic numerals. This gives cell labels like B6, D12, F8, etc. 

 central tendency The extent to which the frequencies for variable values tend to cluster around the mean (or median or mode). 

 central limit theorem The assumption that the distribution of a sample is roughly normal if the sample size is sufficiently large, irrespective of what the distribution is like in the population from which the sample is taken. 

 chi-square test A type of non-parametric test which expresses the deviation of an observed set of frequencies from an expected set (going on some hypothesis or model of data). 

 class interval The number of units in a set of values which are taken as forming a single discrete group, e.g. 3 in the series 1-3, 4-6, 7-9. Grouping into classes is commonly used with variables which can assume a very large number of values to reduce this number for later statistical purposes (e.g. when determining the frequency distribution). 

 confidence limits A percentage figure which covers a certain section of a distribution curve, e.g. to have a reliable estimate for a population going on a sample then confidence limits of more than 90% would be required. For instance, to calculate the size of 95% confidence limits for a sample one would use the formula ‘sample mean (1.96 x standard error)’, where 1.96 is the required critical value for z; if 99% was required this value would be 2.58. Bear in mind that for large samples which are normally distributed values for z are taken; for estimates with smaller samples (typically under 30 variable values) t values must be used. Values for both z and t are available in tables for normal distribution and t distribution respectively. 

 contingency table An arrangement of data in tabular form with rows and columns where these represent different categories and their intersections the values obtained in an investigation. 

 continuous variable Any variable which can adopt values which are not separated from each other by gaps; a non-discrete variable. 

 correlated samples Two sets of variable scores which are interdependent. 

 correlation coefficient A measure of the independence of two random variables. Various means of determining this are available depending on whether the variables are of the interval type or not (see Pearson and Spearman tests). 

 correlation The extent to which two (or more) random variables are interdependent. 

 critical value The value of a test statistic which delimits a critical region within which the value of the statistic must fall if the observed differences are to be regarded as significant at that level. 

 cut-off value With a graphical distribution the point on the X axis to the left or right of which a section of a certain size is "cut off", e.g. the 0.025 cut-off value is 1.96 for z with a significance level of p = 0.05. 

 d A symbol standing for "difference". 

 degree of freedom The value of a variable which is free to vary. With N values only N-1 are free to vary which means that the total minus one is the number used to determine the (unbiased) standard deviation. 

 dependent variable A type of variable which can only be measured but not varied by the investigator. 

 descriptive statistics That area of statistics concerned with demonstrating relationships between values of a variable or sets of variables. Programmes for descriptive statistics use the term presentation graphics as the emphasis is on graphical display. 

 df An abbreviation for degrees of freedom 

 directional test See one-tailed test. 

 discrete variable Any variable which can only adopt values which are predefined on a scale. 

 estimate Another term for statistic (refers to the property of a sample as opposed to that of a population, i.e. a parameter). 

 experimental study A kind of study in which the investigator can influence how the data is collected, typically by designing the study himself/herself. 

 expression In the technical sense an expression is the result of computing any mathematical operation(s) placed in parentheses. For instance in x = (y / (z + 4)) everything which is right of the equals sign is an expression. An expression may consist of variables (here indicated by letters) and/or constants (usually shown as numbers). Sets of parentheses may be used in expressions to ensure the desired precedence, i.e. to have one part of the expression computed before the other, e.g. z + 4 before dividing the result by y. 

 F-test A test of the null hypothesis that two samples have been drawn from the same population. The variances of the two samples are used in the computation. 

 f A symbol used to refer to frequency. 

 F-distribution A table of values used for the F-test. 

 frequency distribution A table representing the frequency values for scores in a particular sample or population. Note that in a frequency table the numbers are not the scores in the sample/population but refer to how often these scores occur. 

 frequency polygon A graphical representation of numerical data from two sets of values (usually frequency and variable, e.g. sales for the months of a year). One set is plotted along the X axis and the other along the Y axis. A line is then drawn to join up each occupied point in the matrix. More than one distribution can be displayed simultaneously in a frequency polygon (this is not usual with histograms) thus rendering visual comparison of sets of data quite easy. 

 goodness of fit The extent to which a certain set of observed data match a theoretical or expected distribution. 

 H0 A symbol representing the null hypothesis. 

 H1 A symbol representing the alternative hypothesis. 

 histogram A graphical representation of numerical data from two sets of values (usually frequency and variable, e.g. sales for the months of a year). One set is plotted along the X axis and the other along the Y axis. The histogram then consists of a number of vertical bars which drop down from each occupied point in the matrix to the horizontal axis. 

 hypothesis testing One of the major reasons for engaging in statistical studies. It is normally contrasted with inferential statistics where the results of an investigation are interpreted with a view to inferring certain facts. 

 independent variable Any variable for which the conditions can be varied by the investigator. 

 inferential statistics A type of statistics characterized by estimating samples and testing hypotheses to infer the relationships postulated for a whole population. 

 interquartile range The set of values between the first and the third quartile, i.e. from 25% to 75%. 

 interval variable A kind of variable which can vary by discrete amounts and where the zero point is variable. 

 kurtosis The degree of peaking of a distribution. If the peak is high (like a wave with a high amplitude) then it is leptokurtic. If the distribution is rather flat then it is platykurtic. 

 Mann-Whitney U-test A non-parametric test of the null hypothesis that two samples are drawn from the same parent population. The test is based on summing the rank orders of the parent population. 

 matched subjects Sets of subjects which are grouped for similarity before investigation of one set, the other set being used as a control group. 

 mean deviation The average deviation of values from the mean (irrespective of sign). 

 mean A kind of average arrived at by adding up all values for a variable and then dividing the result by the number of values. Suitable for ratio and interval data. 

 mean deviation The sum of the difference between each value and the mean divided by the total number of values. 

 median The value in a series which has an equal number of observations above and below it. Suitable for ordinal data. 

 mode This is simply the value with the highest frequency. If ranking is not possible for the data being considered this is often the only type of average which is of any use. 

 N A symbol for the number of values which a variable has in any population or sample. 

 nominal variable Any variable which can only assume binary values, i.e. which is of the "yes or no" type. This is a subtype of discrete variables. They can be compared to non-graded antonyms in linguistics, e.g. dead or alive. 

 non-directional test See two-tailed test. 

 non-parametric test Any type of significance test in which no assumption is made about the frequency distribution (neither the shape nor the variance). Often called distribution-free for this reason. These are the kind usually resorted to when parametric tests are not possible (due to the types of variable in the population under investigation). They are mostly based on ranking and are thus most suitable for ordinal variable data. No non-parametric tests take the absolute magnitude of each observation into account (contrast parametric tests in this respect). 

 normal distribution Symmetrical bell-shaped curve arrived at with (large) sets of regular data. The normal curve is defined solely by the mean and the standard deviation. The mean divides the curve in two equal parts (unless the distribution is skewed); this can be shown by dropping a vertical line from the highest point of the curve to the horizontal axis. If you draw similar lines to the right (positively) or to the left (negatively) of the mean then you create sections of the distribution area which are expressed in terms of multiples of the standard deviation. These latter are termed z-scores and tables are available which define the proportion of the total curve area which lies beyond (to the right or left) for a given value for z. E.g. if z is equal to 1.5 standard deviations then 0.0668 of the curve area will lie beyond this (on either side), for z = 2.0 the area is 0.0228 and so on. 

 null hypothesis An assumption in statistics that two variables are not different. Often used as a basis for showing that there is no association between two parameters in a population. 

 observational study The data is already present and the investigator has little or no influence over the variables which he/she is studying. 

 one-tailed (directional) A test in which only one side (left or right) of a distribution curve is of significance. It assumes that one population mean is greater than the other, i.e. A  B or A  B. In such cases only one tail of a distribution is of relevance (the left for negative values and the right for positive ones). 

 ordinal variable Any variable which is gradual in the values it can assume, i.e. of the "more or less" type. See continuous variable. 

 p A symbol for a proportion of a population. 

 parameter A property of a population. (Greek letters are used to symbolize them, e.g. Mu for the mean of a population). 

 parametric test A type of significance test which takes the absolute magnitude of each observation into account and so makes optimal use of the information in the sample or population being investigated. Such tests assume that the frequency of populations are normal. However, even for populations where this assumption is not automatically true, if the sample taken is large enough then the distribution is approximately normal (due to the central limit theorem) and parametric tests may be used after all. Certain parametric tests furthermore assume that the populations examined have equal variances (homogeneity of variance principle). 

 Pearson product-moment correlation coefficient A type of correlation coefficient which takes the exact magnitude into account (and is thus parametric and best suited to interval and ratio variables). It assumes normal distribution. 

 periodicity Regular re-occurrence in a population or sample. 

 phi coefficient A type of correlation coefficient useful with nominal variables. Used in determining the correlation between two variables in a 2 x 2 contingency table. 

 pie chart A graphical representation of numerical data from two sets of values (usually frequency and variable, e.g. sales for the months of a year). The graph is a circular shape in which each variable occupies a "slice", the size of the slice representing the frequency of this variable. Slices are usually represented in different colours or with different types of shading to allow them to be recognized easily. This type of representation is only suitable with a limited number of variables, typically not more than a dozen. 

 population Any set of data. The only requirement of a population is that it be clearly delimited from others though there are populations which are potentially infinite such as the set of well-formed sentences of a language due to syntactic recursiveness and the open-ended nature of the lexicon. 

 population parameter Some feature of a population, e.g. the mean length of sentences spoken by speakers of English. In order to estimate this a sample is taken and then a statistic computed which more or less accurately reflects the population parameter. 

 precedence A property of expressions which determines the order in which sections are computed: the section contained in the innermost set of parentheses is computed first working outwards until the entire expression is completed. Parentheses are important in order to deliberately override precedence. For instance multiplication has a higher natural precedence than subtraction which means that in the expression 2 * 9 - 4 the 2 is multiplied by 9 to begin with and then 4 is subtracted from the result, yielding 14. If parentheses are placed around the two rightmost elements, i.e. 2 * (9 - 4), the result becomes 10 as 4 is subtracted from 9 before being multiplied by 2, i.e. by computing the subtraction before the multiplication. 

 probability A measure of the likelihood that an event will occur. A probability value is derived either from a theoretical distribution or a set of observations. Symbolized by p. 

 quartile The set of values which fall within one quarter of a sample or a population. 

 random Having an equal chance of occurring, being registered, etc. Unbiased. 

 range The difference between the lowest and the highest values in a set. 

 ranking The ordering of values for a variable in a numerically ascending fashion. So-called tied scores are those which share the same values. It is common practice to attribute a value to such scores which is equal to the mean of their ranks. For instance if in a series there are 4 values with 30 and these have the rank values 12,13,14,15 then one sums up the latter and divides the result by 4 yielding 13.5, i.e. 12+13+14+15 / 4. 

 ratio variable Any variable which has an equal difference between any two values which it might assume and where there is a true zero. 

 rounding error A slight computational error which arises by rounding up (or down) numbers to a certain value for the digit left of it (i.e. to reduce the number of decimal places), e.g. 5.457 -> 5.46 but 5.453 -> 5.45. The inaccuracy due to such errors is cumulative so that steps must be taken to minimize the effects of rounding. 

 s A symbol representing the standard deviation of a population. s2 represents the variance. 

 ß An error in statistics in which the null hypothesis is not rejected even though there is evidence against it. Also called a Type II error. 

 sample statistic A computed value which is intended to accurately reflect the actual value for some feature of a popluation which for practical reasons is not ascertainable (e.g. because the population is too large). 

 sample A selection from a population arrived at by some pre-defined set of criteria. 

 scattergram A graphical representation of numerical data from two sets of values (usually frequency and variable, e.g. sales for the months of a year). One set is plotted along the X axis and the other along the Y axis. Each occupied point in the matrix is indicated but without being joined (cf. frequency polygon) or linked with the horizontal axis by a bar (cf. histogram). Scattergrams are used where there is great fluctuation or where values cluster, in which cases the other two main types of graph are unsuitable. They assume that variables occur at equal intervals on a scale. 

 sign test A non-parametric test of the null-hypothesis that two matched samples are drawn from the same population; basically a test for a median difference of zero. 

 significance test A type of statistic test to determine whether differences between populations (usually arrived at by examining samples) are of significance or not. There are two basic types, parametric and non-parametric. If the variables used in the test are not of the interval or ratio type (as is so often the case in linguistic studies) then non-parametric tests must be used. 

 significance level The probability level below which observed differences are treated as significant, e.g. p = 0.05 (the so-called 5% level). Put another way, it is the maximum postulated probability that results of tests are due to sampling errors. 

 skew A tilt in a distribution. If it is to the left the distribution is positively skewed, if to the right, then it is negatively skewed. 

 Spearman rank correlation coefficient A type of correlation coefficient which is based solely on the ranking of observations (non-parametric and thus suitable for ordinal variables).  standard error The standard deviation of a sample divided by the square root of the total number of values. Example: If one has a sample of 500 words with a mean length of 7.4 and the standard deviation is 3.1 then the standard error would be: 7.4 / 00 = 2.9 which means than the range of error is 7.4 +/- 2.9. The standard error can be used to determine the size a sample must have in order to estimate a population parameter with a certain degree of accuracy. 

 standard deviation The square root of the variance. Represented as s (sample standard deviation) or sigma (population standard deviation). This is the most common computation used to express the extent to which a set of values cluster around the mean of a sample. It is if you like an index of variability. 

 standardisation The computation of a value for a variable on the assumption that the distribution of the set from which the latter is taken is normal. This yields a so-called z-value which is the value of the particular variable minus the mean then divided by the standard deviation. 

 statistic (estimate) A property of a sample of a population. (Roman letters are used to symbolize them, e.g. s for the standard deviation of a sample as opposed to sigma for the standard deviation of a population). 

 sum of squares The total arrived at by adding the square of each value in a series. Usually this value is a deviation from the mean. 

 t distribution A type of distribution used instead of the z-distribution with small populations (typically under 30) which are not normally distributed. Its shape depends on the degrees of freedom involved in the calculation of the standard deviation. t distribution is usually given in the form of tables for ascending degrees of freedom so that one can determine the critical value for a particular significance level. For instance if one has 10 degrees of freedom and a significance level of 0.10 (10% of the distribution, one-tailed) then t must have a value of 1.372, i.e. the area beyond this value (to the right or left) will contain 10% of the whole distribution. 

 tie For a certain variable, the same value for two or more members of the sample. 

 two-tailed (non-directional) A test in which both sides (left and right) of a distribution curve are of significance. Symbolized as A # B. 

 variability The clustering of data around the most typical value in a series. 

 variance This is the result of summing the square of the difference between each value and the mean and then dividing this by the total number of values. Represented as s2 (sample variance) or sigma2 (population variance) as it is equal to the square of the standard deviation. 

 Wilcoxon matched-pairs signed-rank test A non-parametric test of the null hypothesis that two matched samples are derived from the same parent population. 

 Yates’s correction A continuity correction which is often used with the Chi-square test for data which are discretely distributed. Normally only used with tests on 2 x 2 tables with small frequencies; it consists of substracting 0.5 from those values of O which are greater than E and adding 0.5 to those value of O which are less than E (where O = observed frequency and E = expected frequency). 

 z-value A standardised score which for large samples (over 30) is distributed normally. It is the deviation of any given value from the mean expressed as a multiple of the standard deviation (see normal distribution). Thus is specifies how much of a curve area will lie to the right or left of it and by implication how much of the curve area a span from a negative z-score to a positive z-score will enclose, e.g. taking values in a range from -1.96 to +1.96 will result in 95% of the area of a normal curve being enclosed. With a normally distributed curve one can calculate what area will lie to the right (or left or both) of a given z value by consulting a table of z values. If the distribution is not normal (with small samples below about 30) then a t-distribution table must be consulted to obtain equivalent information. 

 

 Appendix A	Text files generated by DbStat 

 All text files generated by DbStat are so-called ASCII text files and can be processed with any text editor. Furthermore they can serve as renewed input into a database. Those lines in a text file which begin with a semi-colon are treated as comment by DbStat and ignored. This leaves those lines which have numbers on them and which can thus be imported into a numerical field. The numbers in text files appear as 11 digit figures with 4 decimal places, giving a total field length of 16 (15 plus 1 for the decimal point!). The databases which are supplied in the StatData directory of the distribution diskette all have numeric fields of just this size so that importation from text files is unproblematic. 

 FREQ_LST.TXT 

 This file contains the contents of the chosen numeric field of the current database and the frequencies of occurrence of values from that field. In addition the relative frequency, cumulative frequency and relative cumulative frequency are included. 

 INTERVAL.TXT 

 The first column of this text file contains the values from the chosen field in the current database arranged according to the frequency which the user specified after activating the relevant option from within DbStat. Frequencies for the intervals are also given (see previous entry). 

 RANK_LST.TXT 

 Here the values from the chosen field of the current database are listed in the first column with the ranking of the values in the second column. The values will be sorted or not depending on the option you chose from within DbStat. Note that any values which have the same rank value (so-called tied scores) are given the mean of the value going on the number of ties (e.g. 4 values with 120 and rank positions 6,7,8,9 would each be given the rank value 7.5, i.e. 6+7+8+9 / 4). This procedure is required when such a list is used as input to a rank-based test such as the Mann-Whitney U test or the Spearman test. 

 SORT_LST.TXT 

 The values of the chosen field are here stored in a sorted form in a text file. Note that you can import the contents of a text file into a numeric field without leaving a database (i.e. going to the desktop) when inside DbStat. The latter option would allow you to re-import sorted values into a numerical field after generating such a sorted file. 

 SPEARMAN.TXT 

 Contains the values from the two chosen fields for the Spearman rank correla-tion coefficient test and the rank orders for both these fields and of course the coefficient which was calculated by DbStat. 

 WILCOXON.TXT 

 This file is similar to the previous one, but this time it contains the columns of values calculated for the Wilcoxon matched-paired signed-rank test (the signed difference for each pair of field values, the absolute difference and the rank value with the sign carried over from the signed difference column but with values of 0 ignored). The value for the test statistic W is included on the last line as a comment (the same procedure as above). 

 SIGN_TST.TXT 

 The columns of field values are to be found in this file with the sign value as required for the sign test in the third column. 

 Z_SCORE.TXT 

 This file contains the values of the chosen field with the standardized score for each value included in a second column. The standardized value is derived by subtracting any given value from the mean for the entire set and dividing this by the standard deviation. Note that standardization is only of relevance if you can assume that the set of values evinces a normal distribution (to be found with samples of more than 30 values). If a normal distribution cannot be assumed then do a t-test and compare the computed result with the critical values for a certain number of degrees of freedom in a statistical table. 

 

 Appendix B	Error messages issued by DbStat 

 These messages may on occasion be issued when carrying out a statistical operation. They have nothing to do with more common and self-explanatory messages which may appear in connection with general database management within DbStat. 
	 No database open in second area You have decided to use fields from two databases for a statistical computation which requires two fields. However, no database is open in the second database area and so the programme cannot proceed. To remedy this simply open another database and start the operation again. 

 Not a numeric field All statistical operations demand that the field which is to serve as input to a computation be of type numeric. If by chance you choose a field of incorrect type this error message is issued. You can check on field type by looking at the column on the left of the screen in front of the field in question, "N" for numeric indicates that the type is correct. 

 Not a numeric/character field When retrieving the contents of the clipboard one can only use a field of type numeric or character. If the chosen field (that which the cursor is resting on) is of neither type then of course nothing can be done and this error message is issued. 

 Fields identical This message is only necessary in the unlikely event of your choosing the same field for a double field computation. 

 Record totals different Attention should be paid to the number of records in each database when two different databases are chosen for a double field statistical computation. The number of records must be the same as otherwise the comparison of field values between databases cannot be carried out for each record. 

 Too many records for calculation The size limit on a database used for a statistical computation is 512 (though a database in general can be of any size). If this limit is exceeded then no calculation is carried out. 

 Cannot find _CALC.EXE When you press Alt-F5 to run the calculator from within DbStat an external programme called _calc.exe is loaded. If DbStat cannot find this, i.e. if this programme is not accessible via the DOS path variable, then this error message is issued and nothing else happens. 

 Out of memory Not enough available system memory to carry out some computation which requires a lot of memory. This message is only likely if (i) you have run DbStat from another programme so that system memory was considerably reduced before loading the programme in the first place or (ii) you have a large text loaded on the text editor level of DbStat; to check on available memory, press F9 for system environment. 

 Error opening disk file For some unusual reason there has been an error when writing to disk. The only conceivable cause of this could be that the disk is full. 

 

 Appendix C	Troubleshooting with Corpus Manager 

 Installing Corpus Manager Before considering causes of difficulties I assume that you have succeeded in copying the Corpus Manager files from the distribution diskettes into a directory of their own on your hard disk by following the instructions of the install programme carefully. 
	At the very least you should succeed in starting Corpus Manager and using the three supplied text databases, eme_corr.tdb, pc_know.tdb and sample.tdb. If you have got this far then you can safely assume that the programmes are in working order. 

 Creating and processing databases of your own After a little experimenting with the supplied databases you will probably want to create some of your own. Here are a number of points which must be borne in mind to avoid difficulties. 

 1)	Any text file intended to be used as a text database must be an ASCII file, 
	i.e. contain no formatting information. 

 2)	A text database must always have the extension .tdb (= text database) and 
	reside in the directory from which Corpus Manager is started unless you 
	move to another directory. 

 3)	A text database must be structured in a very precise manner. This is 
	described in detail in 1.5. Structuring text files above. Be warned here yet 
	once more: if record markers are not placed correctly in your text file then 
	screen display will be erratic. 

 4)	Before actually using a text database it must be indexed. This is done via 
	the option Re-index text database in the Consultation menu on the desktop. 
	Until this has been carried out no consultation is possible. 

 Out-of-date indexes This is a perennial source of difficulty for users. Especially beginners forget to re-index databases after editing a text database. The display with an out-of-date index is always incorrect: a record starts somewhere in the middle or appears to begin somewhere in a previous record (depending on how out-of-date the index is). The solution is simply to re-index the text database from the desktop. 

 Keyword indexes Remember that the input file for a keyword index must be an ASCII text file with precisely one word per line. Anything else will result in garbage. 

 Search output files As these are created by Corpus Manager little can go wrong with them. There is no call for users to edit these. Bear in mind that a file with the extension .wcs serves as input (via a picklist on the desktop) for a simple search. It is the outcome of this (which can be stored to a file with the extension .sch) which one can then examine on screen.