home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
pssst.zip
/
PSNEWGUY.PRG
< prev
next >
Wrap
Text File
|
1986-08-11
|
5KB
|
135 lines
* PSNEWGUY.PRG
*
* A DBASE II 16BIT COMMAND FILE to allow FILE CREATION
* for SUSPENSE MANAGEMENT
*
* Version 1
* By LTC Denny Hugg
* ANGSC/DOS Andrews AFB MD 16 Jul 1985
*
* Version 2
* modified by Maj Jim McMurry
* ANGSC/DOSC Truax Field, WI 15 Jun 1986
*
* gsusfile = SUSPENSE.DBF
* gcomplfile = COMPLETE.DBF
* gdelfile = DELETED.DBF
*
* This program copies the structure of PSNEWGUY.DBF to the files named
* above, creates appropriate indexes, and returns to PSSST.PRG.
*
* If this is a new year, gsusfile, gsusindex, and gpryindex are renamed
* to the new year. The files gcomplfile and gdelfile are archived as
* new files are created for the new year.
*
ERASE
* --- see if he was sent here because it's a new year
STORE VAL($(gdate,1,2)) -1 TO lastyear
STORE gaddstring + 'SP.0' + STR(lastyear,2) TO lastfile
IF .NOT. FILE ("&lastfile")
* --- look to see if he was using an old version of pssst
STORE gaddstring + 'SP.DBF' TO oldfile
IF .NOT. FILE ("&oldfile")
@ 10,22 SAY 'Creating Your Personal Files Now ...'
* --- create suspense database
USE PSNEWGUY.DBF
COPY STRUCTURE TO &gsusfile
* --- create suspense index file
USE &gsusfile
INDEX ON duedate TO &gsusindex
* --- create priority index file
INDEX ON priority TO &gpryindex
* --- create 'completed' database
USE PSNEWGUY.DBF
COPY STRUCTURE TO &gcomplfile
* --- no index as we want them entered and reported in order completed
* --- create deleted database
COPY STRUCTURE TO &gdelfile
* --- again no index - report in order deleted
ELSE
* --- he was using an old version of pssst
* --- we'll set him up with the new structure
USE PSNEWGUY.DBF
COPY STRUCTURE TO &gsusfile
COPY STRUCTURE TO &gcomplfile
COPY STRUCTURE TO &gdelfile
USE &gsusfile
* --- get stuff from old suspense file then get rid of it
APPEND FROM &oldfile
DELETE FILE &oldfile
* --- get rid of old indexes
STORE gaddstring + 'SP.NDX' TO oldfile
DELETE FILE &oldfile
STORE gaddstring + 'PR.NDX' TO oldfile
DELETE FILE &oldfile
* --- get stuff from old completed file then dump it
STORE gaddstring + 'CM.DBF' TO oldfile
USE &gcomplfile
APPEND FROM &oldfile
DELETE FILE &oldfile
* --- same drill for old deleted file
STORE gaddstring + 'DD.DBF' TO oldfile
USE &gdelfile
APPEND FROM &oldfile
DELETE FILE &oldfile
* --- create new index files based on suspense date and priority
USE &gsusfile
INDEX ON duedate TO &gsusindex
INDEX ON priority TO &gpryindex
USE
ENDIF
IF .NOT. FILE ("PSPHONE.DBF")
IF FILE ("PHONE.DBF")
* --- he has an old phone.dbf
* --- give him the new structure and filename
@ 15,13 SAY 'The Data From PHONE.DBF Has Been Copied To PSPHONE.DBF'
@ 17, 2 SAY 'This Procedure Takes Some Time, But Is A One-Shot';
+' Deal For Just A Few Folks'
USE PSNEWPHN
COPY STRUCTURE TO PSPHONE
USE PSPHONE
APPEND FROM PHONE
* --- this should take care of old entries that weren't in caps
INDEX ON !(lname) To PSPHONEI
@ 15, 0 SAY gclearline
@ 17, 0 SAY gclearline
ELSE
* --- create psphone.dbf for him
USE PSNEWPHN
COPY STRUCTURE TO PSPHONE
USE PSPHONE
* --- all lname's are forced to caps during entry
INDEX ON lname TO PSPHONEI
ENDIF
ENDIF
USE
ERASE
ELSE
@ 10,22 SAY 'H A P P Y N E W Y E A R ! ! !'
@ 11,36 SAY gfirstname
@ 12,20 SAY "I'm Archiving Last Years Completed Items"
STORE VAL($(gdate,1,2)) -5 TO year5
STORE VAL($(gdate,1,2)) -1 TO year1
STORE gaddstring + 'CM.0' + STR(year5,2) TO cm5
STORE gaddstring + 'DD.0' + STR(year1,2) TO dd1
* --- delete last year's deleted stuff
DELETE FILE &dd1
IF FILE ("&cm5")
@ 13,17 SAY 'As Well As Deleting The Files From 5 Years Ago'
DELETE FILE &cm5
ENDIF
STORE '.0' + $(gdate,1,2) TO suffix
STORE gaddstring + 'SP' + suffix TO gsusfile
* --- give suspense file new year's name
RENAME &lastfile TO &gsusfile
STORE gaddstring + 'CM' + suffix TO gcomplfile
STORE gaddstring + 'DD' + suffix TO gdelfile
* --- create new year's completed and deleted files
USE PSNEWGUY.DBF
COPY STRUCTURE TO &gcomplfile
COPY STRUCTURE TO &gdelfile
ENDIF
USE
RETURN
* --- EOF PSNEWGUY.PRG