home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
DBAPG.ARC
/
S-UPDATE.PRG
< prev
next >
Wrap
Text File
|
1984-08-12
|
1KB
|
46 lines
* Program.: S-UPDATE.PRG
* Author..: Luis A. Castro
* Date....: 01/11/83, 01/17/84, 06/24/84
* Notice..: Copyright 1983 & 1984, Luis A. Castro, All Rights Reserved
* Version.: dBASE II, version 2.4x
¬ Notes...║ Simulate≤ thσ UPDAT┼ command«
*
SET TALK OFF
*
* ---The parameters may be initialized with STORE statements
* ---or entered from the keyboard with ACCEPT statements
* ---(i.e. the STORE verbs could be changed to ACCEPT verbs).
STORE "MASTER" TO masterfile
STORE "FROM" TO fromfile
STORE "Lastname+Firstname" TO key:expr
*
* ---Initialize macro to REPLACE or ADD to masterfile.
* ---Assumes Name field is replaced and Amount field is added.
STORE "Name WITH P.Name, "+;
"Amount WITH Amount + P.Amount" TO Mreplace
*
SELECT PRIMARY
USE &fromfile
SELECT SECONDARY
* ---Assumes the master file and index file have the same name.
USE &masterfile INDEX &masterfile
SELECT PRIMARY
DO WHILE .NOT. EOF
STORE &key:expr TO mkey
SELECT SECONDARY
FIND &mkey
IF # = 0
* ---No matching record.
* ---So, add a blank record to masterfile.
APPEND BLANK
ENDIF
* ---Update information to masterfile from fromfile.
REPLACE &Mreplace
SELECT PRIMARY
SKIP
ENDDO
CLEAR
SET TALK ON
RETURN
* EOF: S-UPDATE.PRG