Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Corrected zbase.zip in download

...

Info
titleThis section is currently being written

The main body of the text is here, but links have not been completed.

 


About Wordmongers Limited

...

This application need 32K of either EPROM or Flash space.

Image ModifiedIntroduction

zBASE is a ROM based application package for the Cambridge Computer Z88 portable. It is a database that allows users store information easily.

 

 

 

 

 

 

 

 

 

 











Image ModifiedSelecting zBASE

...

Wordmongers zBASE
Database suite for Z88
Manual zbman1 v0.02 190888
zBASE v1 


Anchor
tof
tof

zBASE 

Foreword96010404

Acknowledgement & Thanks

zBASE Quick start guide

 
Anchor
top_section_1
top_section_1
SECTION A

zBASE Manual

IntroductionCopyright & Trademark noticesDisclaimerHandling, ROM's & installing the software
 Manual conventionsImportant basic conceptsDatabase areasVariables
Interactive versus Command file   


An introduction to databases

FilesRecordsFieldsData types
Index key fields   


How to create a data file

Defining fields, width, typeCreating the file within zBASEOpening and closing database filesChecking structure

Indexing

To create the index fileUsing FINDAdding data to an indexed fileTech note re INDEX file sizes

Retrieving data

Entering data

At curly promptVariables and Top Bit CharactersUsing command (do) file 

Amending data

At curly promptUsing command filesDeleting data 

Selection and control

At curly promptLOCATE FORLIST [FORDISPLAY [FOR
Using command files   


Manipulating data files

COPY TO filename [PD] [FOR <cond>] [DELIMITED] [FOR <cond>]APPEND FROM filenameCOPY TO filename <[STRUC-
TURE] / [PD]>
 
COPY TO <filename> STRUC-
TURE
Using command filesDeleting dataSelection and controlManipulating data files

Moving around a file

SKIPGO (TO RECORD NUMBER ..) <expression>GO TOP, GO BOTTOM 

ENVIRONMENTAL COMMANDS

-ESC- ON/OFF SET ECHO  

Indirect variables

&memvar&numericvar  

zBASE output to printer port

Z88 output facilities

n+ P n+ S  

System Limits

Precedence of operators

Using multiple databases

Importing files from PD

Using Z88 popdowns

 SECTION B

zBASE Commands

conventionskeywordscommandsfunctions

zBASE Functions

 SECTION C

zBASE Programs

Sample programsStock Control System  

 

Image ModifiedForeword

Congratulations on choosing zBASE. The Z88 Portable offers a wide range of built-in facilities. With the addition of zBASE, the Z88 comes of age.

...

Complete application systems can now be written for the Z88 by people other than professional programmers.

Image ModifiedAcknowledgement & Thanks

...

R.Beddard, Ian Braby, Mike Case, Tony Cox, G.C.Denney, John Dobson, R.C.Dorrance, Steve Drain, John Driver, Vic Gerhardi, C.M.Glover, S.P.Gray, F. W. Halliday, Gerald Hughes, B. P. James, Robin Jarvis, Charles Jenkins, N. A. Joseph, Dr Warren Kovach, Chris Lewis, Thomas Malinowski, M. Meijeraan, Francis Musgrave, M. Parker, Dr. L. Ratnasabapathy, C. M. Robinson, S.Fraas, K.G.Woolf, Roy Woodward, Matthew Soar, H.E.Shaw and John Hudson.

Image ModifiedzBASE Quick start guide

Anchor
top_zbase_qg
top_zbase_qg

Getting familiar with a new piece of software is often tedious and sometimes daunting. To provide a Quick demonstration to those who are new to zBASE, this Quick start guide is a short tutorial aimed at providing a rapid introduction to the system.

...

This guide is no substitute for reading the manual. Indeed, this guide will merely scratch the surface of zBASE capabilities. However, since zBASE needs liveware to make use of those capabilities, it is important to the authors that the liveware should feel some early reward for the effort of getting familiar with zBASE. Those rewards are plentiful in this guide.

Image ModifiedQSG1

With the INDEX on display on the Z88, open the clear perspex cover labelled '1 2 3', and insert the zBASE Application ROM in slot 2. Close the perspex cover. (See the Fitting & Using the ROM.)

The menu bar should be moved on the APPLICATIONS INDEX until it is highlighting the zBASE application.

Press to run zBASE.

Image ModifiedQSG2

When the } symbol, known as the curly prompt appears, type the word QUIT followed by . This action ends the use of zBASE. In version 1.2 you need to confirm the return to the APPLICATIONS INDEX, by pressing any key.

This is the only proper way to exit from zBASE. If the  key is used, and the zBASE suspended application is KILLed, open database files will not be properly closed and permanent damage will occur to the data files.

Image ModifiedQSG3

The first real job is to create a data file. To do this, the file structure must be defined. This definition is done in PipeDream. Highlight the PipeDream application and press . This creates a new PipeDream suspended application.

Image ModifiedQSG4

Type in the following lines, exactly as shown.

...

Now press FS, followed by the file name, PHBOOK.DEF. Then move the cursor down 4 lines using the ò, to the question, 'Save plain text'. Enter a Y for YES and hit .

Image ModifiedQSG5

That has created the definition file for a phone book database. Now return to zBASE by pressing W.

...

Database open in 1: is PH.DBF
COMP STRING 15
PHONE STRING 17
NAME STRING 20
KEYFIELD STRING 5
62 bytes/rec

Image ModifiedQSG6

Now create an INDEX file for easy searches.

...

That will establish an index file for use later.

Image ModifiedQSG7

Data input

...

}APPEND BLANK
}LET 1:COMP$=" "
}LET 1:PHONE$="020-7833-1212"
}LET 1:NAME$="Insp Bond"
}LET 1:KEYFIELD$="Bond"
}APPEND BLANK
}LET 1:COMP$="Short Brothers"
}LET 1:PHONE$="01494 885555"
}LET 1:NAME$="Morris Short"
}LET 1:KEYFIELD$="Short"

Image ModifiedQSG8

With at least a few records entered, a FIND process is required. This may be done directly at the curly prompt, or as for appending, by means of a command file as described in Indirect variables.

The zBASE command to use on an index file is 'FIND'.

...

Note that only the first FOUR characters of any command need be used.

Image ModifiedQSG9

Looking for matches in an UNINDEXED file.

...

NB. The key used must be the one on the left of the keyboard. (No we don't know why either.)

Image ModifiedQSG10

To close the file, enter
}USE

To re-open the file type
}USE PH.DBF INDEX PH.NDX 

Image ModifiedQSG11

To check whether a file is open, type
}DISP STATUS

To check a file structure, enter
}DISP STRUCTURE

Image ModifiedQSG12

To return to the Z88 APPLICATIONS INDEX, enter
}QUIT.

NB. IT IS IMPORTANT THAT THE QUIT COMMAND IS USED AS THE METHOD OF CLOSING zBASE. If zBASE is KILLed as a suspended application, loss of data will occur because the files will not be properly closed.

Image ModifiedQSG13

zBASE programs - two startup examples.

Image ModifiedQSG13.1

An alternative method of entering data is to write a command file that makes it all a bit easier.

...

Type or load the program labelled PHENT.PRG96010404. Do not use  characters. The lines that start with an ASTERISK (*) are comment lines that are ignored by zBASE. They do not have to be typed in at all.

...

[If zBASE was QUIT rather than left suspended, the database file with its index must be re-opened before running PHENT.PRG. If this is the case, see QSG9 above for guidance on re-opening the file.]

...

A few more records should be entered to give the database something to get its teeth into.

Image ModifiedQSG13.2

FINDing using a command file.

...

This quick start guide has been designed to provide new users with an opportunity to get something out of zBASE quickly. It does not reveal the flexibility available in zBASE nor does it demonstrates the wide potential for this database management program. The rest of the manual does go much further into the commands and functions contained in zBASE. Please take some time to review the rest of the manual and so enjoy the further capabilities of your Z88/zBASE combination.

Image ModifiedzBASE Manual

Anchor
top_zbase_manual
top_zbase_manual

The Quick Start Guide is designed to be a brief exposure to the major facilities of zBASE. Those new to database languages may find this a very useful starting point.

...

Section C - 'Sample Programs and Glossary', contains some sample programs that can be written in the zBASE language with a brief Glossary that explains some of the terms used in the manual. Also shown is a series of zBASE programs that together form a Stock Check system,

Introduction

The Wordmongers zBASE suite is designed to provide general database management opportunities for the expanded Z88. The Z88 must have at least a 128K RAM expansion cartridge in slot 1.

...

Alternately, regularly used sets of commands may be put together into a command file to save repeated entering of the same commands. Those familiar with the dBASE family of programs from Ashton-Tate will find that there are some marked similarities between zBASE and dBASE II. (See trademark notice)

Copyright & Trademark notices

See Copyright & Trademark notices

Disclaimer

See Disclaimer

Handling, ROM's & installing the software

zBASE will only run on an expanded Z88. This means that the Z88 must have at least a 128K RAM cartridge installed. If a single RAM is fitted, it must be in slot 1.

...

To run zBASE, move the cursor to the zBASE application option in the INDEX and hit , or enter W. 


Manual conventions

 

See Manual conventions

Important basic concepts

 

...

Certain elements of the zBASE system need to be explained early on. These elements relate to the use of variables and files.

Database areas

Data files may be opened in either of two areas. These areas are called PRIMARY and SECONDARY. These areas are labelled as 1: and 2: respectively.

...

The following sections describe the building of a database file and its interrogation. It should be read through to the end. However, computer users are notorious for skipping manual pages. In this case, all the available commands with their syntax are explained in Section B and those wishing to learn by their mistakes are invited to use that section of the manual.

...

Most databases contain information which is entered in a random fashion. There is no pattern to the way the data are organised. zBASE uses a system known as INDEXING as a means of holding a file so that it appears to be in a specific sorted order.

This is done by the creation of a second file, used in parallel with the database itself. This parallel file, or INDEX file as it is called here, holds only a small part of the database information. Specifically it contains the data from the selected field to be used as the KEY, plus the position in the database file where the full record is to be found.

e.g. if the VIDEO file were indexed on REF_NUM$, the index file record would hold the code field, say "001", the record number "1", plus a few bytes more used for housekeeping. Since the index file is much smaller than the main database file, searches can be carried much more quickly. When the required record is found in the index, zBASE can go to the full record in the main database very quickly too.

[On a database of 580 records from a phonebook, containing name, company, phone and a 5 character key field, the typical time for a search on that keyfield is 1 second.]

In the Stock control system contained in Section C, the usual method of finding a product is by its code. Therefore, the file will be indexed on the CODE$ field.

...

When used in conjunction with an indexed file, the DISP and LIST commands are very powerful. The FIND command is used to arrive at the first occurrence of the required value, then the DISP or LIST command, with its condition, can be used to show all the records which match, from that point in the file to the end.

Entering data

...


...



At curly prompt

APPEND BLANK

...

At curly prompt

Amending data is the same operation as entering data. The same LET command is used and the new data overwrites the old.

...

One of the prime functions of a database language is not only to facilitate easy input and amending of data, but also easy retrieval of selected bits of the data.

...

These commands position the record pointer to the selected record. If the record number is known, the 'GO record number' command is the fastest method of reaching a record.

...

ENVIRONMENTAL COMMANDS

-ESC- ON/OFF (v1.3 only)

The switch allows programs to ignore attempts to -ESC- and is activated by typing Set Esc=Off (deactivated by Set Esc=On) in interactive mode or by inserting it to a command line.

...

Indirect variables

&memvar

In dBASE II, these are referred to as MACROS. These & characters mean that the variable which follows the & is evaluated before being executed. In any command line from the keyboard or a command file, in which an indirect variable is found, the &variable is first replaced by the value it represents. e.g.

...

Z88 output facilities

n+ P n+ S

 

 



The copy commands explained above provide an opportunity to output to PipeDream. The method described below permits all the screen output to also go to a file or the printer.

...

There will be one record in the VIDSTAR file for each star in the film. So if the film has three stars, the VIDSTAR file will have three records, where the REF_NUM is the same as the REF_NUM of the films record in the VIDEO file, and the STAR field holds the name of one of the three stars. An example will help: 


VIDEO FILE RECORDSTARS FILE RECORDS
REF_NUM$12REF_NUM$STAR$
TITLE$Trading Places12Eddie Murphy
TYPE$COM12Dan Aykroyd
TAPE_NO$312Jamie Lee Curtis
DURATION$112  

RATING$5  

 




The data for the VIDSTAR file must be entered when the other details of the video are being entered. To alter the program VIDINP.PRG to do this, find the line in the program:

...

Each record of this database will contain one line of the report, which will be loading into, and printed from, PipeDream. This means three databases have to be manipulated: 


VIDEOThe main database containing details of the video.
VIDSTAR+ VIDSTAR.NDX. Holds details of the stars, indexed on reference number so they can be found quickly.
REPContains the lines of the report and is built up by the program.

...


The REP file is open from start to finish in area 1, and the other two are opened and closed as necessary in area 2.

...

The phone book from the Quick Start Guide might look like this in PipeDream. It is called PH.DAT and is stored as PLAIN TEXT.

 

...



................A..............B...............C
1Cambridge312216Sir Clive
2Rakewell630617Vic Gerhardi
3UserClub68 Well StRoy
4Scotland Yd877 1212Insp Bond

...


The QSG section has a structure of

...

CONVENTIONS

...


Lowercaseoperator input, usually enclosed in < > brackets.
UPPERCASEspecific zBASE commands or command words.
[....]Optional parts of commands.
<...>Operator specified input.
<exp>...An expression which can result in either a number or a string. e.g. 5+5, "FRED"+"BLOGGS", a$+"MUMMY".
<var> ...A variable, can mean either mvar or fvar.
<mvar>...A memory variable, not stored in a database, but in a large buffer in RAM. An mvar is defined as a string if its name ends with a '$', otherwise, it is defined as a number.
<fvar>...A field variable, permanently stored in a database. Fields must start with either a 1: or 2: label, depending on the database they are to be taken from. If the label is missing the field will be taken as a mvar.
<cond>...

A condition which returns the result either TRUE or FALSE. e.g. 10=10 is TRUE,

10=6 is FALSE,

"FRED"="BLOGGS" is FALSE.

A single number 0 is evaluated as FALSE, any other number is TRUE.

 


KEYWORDS

Only the first 4 characters of a keyword are significant.

zBASE commands

...


*
adds comments to a command file
? [<exp>]
displays the value of an expression.
# [<exp>]
sends the value of <exp> expression through the serial port to the printer.
AT <co-ordinates> SAY <exp>
displays the value of the <exp> expression at the specified co-ordinates.
AT <co-ordinates> GET <var>
formats fields on screen for operator input.
APPEND BLANK
adds a blank record to the database in use
APPEND FROM <filename> [PD]/[DELIMITED] [FOR <exp>] ]
adds new records to the current database from another database or Pipedream file.
CLS
clears the screen.
CONTINUE
extension to LOCATE command to move to next match.
COPY TO <filename> [FOR <cond>]
creates new database from current one with optional conditional selection.
COPY TO <filename> [PD] {DELIMITED] [FOR<cond>]
copies data from current file to new format with optional conditional pull.
COPY TO <filename> STRUCTURE [DELIMITED]
creates a database file with same structure as current file, or a Pipedream file of the structure.
CREATE <file1> FROM <file2>
creates zBASE file called 'file1' from Pipedream file 'file2' of format FIELD_NAME, with $ if a string field COMMA, WIDTH if its string field.
DELETE RECORD
marks current record for deletion.
DELETE FILE
removes selected file from directory.
DISPLAY<[STRUCTURE]/[MEMORY]/[STATUS]>
shows on screen the selected option related to current use of database, memory variables and files respectively.
DISPLAY <[ALL] / [FOR <cond>]> <[FIELDS field,field,field]>
shows data from current file in use
[ALL] - shows seven records before pausing.
DO <command file>
runs a command file.
DO WHILE <cond> - ENDDO
 runs the commands enlosed in loop as long as <cond> is TRUE.
FIND <exp>
searches fo key field match in indexed file.
GO [<exp> / <BOTTOM> / <TOP>]
moves record pointer to <exp>th record or top/bottom.
IF <cond> - ELSE - ENDIF
runs the commands after IF if <cond> is TRUE, otherwise runs commands after ELSE.
INDEX ON <fvar> TO <filename>
creates an index file in order of fvar.
LET <var>=<exp>
establishes a value for a variable.
LIST [ALL]
works as DISPLAY without the pause every 8 lines.
[ALL] - shows all records without pausing.
LOCATE FOR <cond>
moves record pointer to first record in file for which <cond> is TRUE.
QUIT
closes all files and zBASE application.
RECALL RECORD
removes DELETE mark on a record
RELEASE <mvar>
removes specified memory variables.
RENAME <file1> TO <file2>
changes name of file.
RETURN
stops running current command file and returns control to previous command file or curly prompt.
SELECT <[1 or 2]>
opens selected database area.
SKIP [<exp>]
moves record pointer <exp> records along.
USE [<file>]
closes current file and opens <file> if specified.
USE file INDEX file
opens database in current area with index file.
WAIT
pauses operation until a key is pressed.

...


zBASE Functions

 


CHR(<exp>)returns charater with ASCIIcode exp.
CLI (<exp$)sends <exp$> to the OZ CLI function for immediate execution.
DATE()provides current system date.
DELETED()returns 1 or 0 (TRUE / FALSE) to reflect status of current record.
EOF()returns 1 or 0 if end of file has been reached or not respectively.
FILE(<exp$>)responds with TRUE if file defined by exp does exist.
INT(<exp>)returns integer from exp.
LEN(<exp$>)shows length of string variable specified.
LOWER(<exp$>)turns string into lower case.
LTRIM(<exp$>)removes left hand blanks in string exp.
RAM()reveals RAM space available on currently selected device.
RECNO()returns current record number.
SET ECHOtoggles echoing of all commands to screen.
STRTo emulate a STR function use &.
} LET A=2.03
} LET A$="&A"
} ? "-"+a$+"-"
-2.03-
SUBSTR(<exp1$>,
<exp2>,<exp3>)
extracts the sub-string from exp1$ defined as starting at position exp2, of length exp3.
TIME()displays system time.
TRIM(<exp$>)removes trailing blanks.
UPPER(<exp$>)converts string exp$ to upper case.
VAL(<exp$>)converts ASCII string to its numeric equivalnet.
WHERE(<exp1$>,
<exp2$>)
shows the starting character position for where exp1$ occurs in exp2$.

...


zBASE Commands

Most of the zBASE commands may be used both in the interactive mode at the curly prompt, or in program files or command files. The main exceptions to this rule are that related pairs of commands such as IF/ENDIF and DO WHILE/ENDDO may not be used in the interactive mode.

...

The file shown below, having been saved as PLAIN TEXT, will then be appended onto the end of the database.

 

...



................A..............B...............C
1Cambridge312216Sir Clive
2Rakewell630617Vic Gerhardi
3UserClub68 Well StRoy
4Scotland Yd877 1212Insp Bond

 


The DELIMITED clause means the fields are separated by commas and the records by CR (0Dh) LF (0Ah). This is a common format output by dBase and many spreadsheets.

...

The following file would be appended to the database in use.

 

...



................A..............B...............C
1Cambridge,312216,Sir Clive
2Rakewell,630617,Vic Gerhardi
3UserClub,68 Well St,Roy
4Scotland Yd,877 1212,Insp Bond

 


If the PD and DELIMITED instructions are omitted the file is assumed to be a zBASE file.

...

  1. One line per field in database.
  2. No blank lines, and no extra CR at the end of the last field.
  3. All string field names end in $, followed by a comma and a number indicating the length of the field (1-255).
  4. Numeric fields have just the name on the line, nothing else.

e.g. 


NAME$,25NAME is a string field, length 25
AGEAGE is a numeric field
SCORE$,10<END>SCORE is a string field, length 10

...


Any stray CRs, or text in the wrong place may cause strange results.

...

If the MEMORY clause if used, the memory variables and their values are listed on screen. e.g. 


address1$STRING"54 Moor Road"
address2$STRING"Linstanton"

 


If the STATUS clause is used the machines current status is displayed on screen.

...

The programs listed in this manual are designed to be indications only of the potential of zBASE. They are for users to amend to suit their own purposes and are not intended as complete solutions. They have not been exhaustively tested.

...

Wordmongers retains all copyright in them.

 

...

 

...

 




MAIN.PRGA menu program for database management 
NEWUN.PRGCalled by MAIN to enter new records. 
APPEND.PRGA command file to make data entry easier. 
APPEND.DEFA database structure file for use by the APPEND program. 
PACK.PRGTo remove deleted records from a file 
PHENT.PRGPhone book entry program 
FPROGFind program for phone book 
VIDINP.PRGInput routine for VIDEO file 
STARINP.PRGInput for stars in Videos 
VIDREP.PRGReport generator for video system 
VIDREP.DEFUSE REP.DEF FROM STOCK CONTROL SYSTEM 
Stock Check suite.See introduction page for this suite.

 

 

MAIN.PRG

* MAIN.PRG - A menu program for database file * management.
* TITLE.PRG
doøwhileø1=1
øcls
øatø2,10øsayø"TheøWordmongersøzBASEøAddressøbook.øByøCøSalvidge."
øatø3,15øsayø"(c)øWordmongersøLtdø1988."
øatø5,10øsayø"(S)earchøforøanøentry.ø(E)nterønewøperson.ø(Q)uit."ø
øatø7,10øsayø"Yourøchoiceøplease"
øletøchoice$="ø"
ødoøwhileøwhere(choice$,"SEQ")=0
øøatø7,30øgetøchoice$
øøletøchoice$=upper(choice$)
øenddo
øiføchoice$="Q"
øøreturn
øendif
øiføchoice$="S"
øødoøfindum.prg
øendif
øiføchoice$="E"
øødoønewun.prg
øendif
enddo

...

* SCSUPP.DEF
SUPP$,3
NAME$,25
ADD1$,25
ADD2$,25
ADD3$,25
ADD4$,25
PHONE$,15
CONTACT$,25