home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
watup.zip
/
READ_ME.DOC
< prev
Wrap
Text File
|
1985-06-11
|
2KB
|
41 lines
The procedure 'WATUP' is designed to be incorporated into dBase III
Procedure Files and keeps track of which files are currently open
and in which work area's. It allows a calling program to open and close
files by name, therefore offering work area independance.
It is called with four positional parameters, the first is the action
desired, where 1 = open a file, 2 = close a file and 3 = close all files.
The second is a numeric memory variable in which the subroutine returns
the work area of the file in question. The third is a numeric memory
variable containing the number of files associated with the request
i.e. an indexed file = 2, an indexed file with a memo field = 3.
The fourth is the name of the file to be acted upon (without an extension).
Before calling the routine the first time it is neccessary to initialize
the following memory variables - wanum = 0, wanam = SPACE(80),
wano = '0000000000', files = n where 'n' = number of command files open
during data file processing. Examples of calls to the subroutine
are as follows:
1. To open an indexed file called 'orders'
CALL watup WITH 1,wanum,2,'orders '
USE &wanum
SELECT orders INDEX ordndx
2. To close an index file called 'orders'
CALL watup WITH 2,wanum,2,'orders '
USE &wanum
SELECT
3. To close all database files
CALL watup WITH 3,0,0,''
The memory variable 'files' is available at all times and contains the
total number of files of all types open (including command files).
The subroutine assumes that the calling command files know what they
are doing and therefore does not handle errors gracefully.
John Dobson, Unique Systems Ltd, PO Box 19730, Christchurch, New Zealand.