home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
watup.zip
/
FILES.PRG
next >
Wrap
Text File
|
1985-06-11
|
1KB
|
32 lines
PROCEDURE watup
PARAMETERS action,wano,nof,namf
****************************************************************************
* This procedure, 'Work Area Table UPdate' keeps track of open files *
* and work area's in use - it allows files to be opened and closed by *
* name without the calling command file having to keep track of work area *
* numbers. Written by John Dobson, Unique Systems, PO Box 19730, *
* Christchurch, New Zealand and released into the Public Domain for *
* distribution via RBBS systems. *
****************************************************************************
DO CASE
CASE action = 1
temp = AT('0',watnum)
watnum = SUBSTR(watnum,1,temp-1) + STR(nof,1) + SUBSTR(watnum,temp+1)
watnam = SUBSTR(watnam,1,((temp-1)*8)) + namf + SUBSTR(watnam,(temp*8)+1)
wano = STR(temp)
files = files + nof
CASE action = 2
temp = (AT(namf,watnam) + 7) / 8
watnam = SUBSTR(watnam,1,((temp-1)*8)) + SPACE(8) ;
+ SUBSTR(watnam,(temp*8)+1)
watnum = SUBSTR(watnum,1,temp-1) + '0' + SUBSTR(watnum,temp+1)
wano = STR(temp)
files = files - nof
CASE action = 3
CLOSE DATABASES
watnum = '0000000000'
watnam = SPACE(80)
files = 2
ENDCASE
RETURN