home *** CD-ROM | disk | FTP | other *** search
- * Program.: SAM_APPE.PRG
- * Author..: Your Name
- * Date....: 11/05/85
- * Notice..: Copyright 1985, Your Company, All Rights Reserved
- * Version.: dBASE III, version 1.1
- * Notes...: APPEND program for NAMES.DBF
- *
- PARAMETER row
- PRIVATE IsBlank,OldLastRec
- * ---Save last record number of original database.
- OldLastRec = LastRec
- * ---Use batch method to APPEND records.
- COPY STRUCTURE TO NAMES.$$$
- USE NAMES.$$$
- DO SAYFORM
- DO WHILE .T.
- IsBlank = .T.
- APPEND BLANK
- * ---Here, you can use REPLACE to Initialize selected fields.
- * ---Such as: REPLACE Startdate WITH DATE(), Amount WITH 49.95
- LastRec = LastRec + 1
- * ---This inner loop is similar to the DoEDIT procedure.
- DO WHILE .T.
- @ row,0 CLEAR
- SET COLOR TO &PromptAtr
- @ row,0 SAY "Press <Ctrl-End> to Exit"
- DO StatLine WITH LastRec
- DO GETFORM
- READ
- * ---Here, you can use REPLACE to Compute selected fields.
- * ---Such as: REPLACE Total WITH Amount + Shipping + Tax
- IF ("" <> TRIM( Lastname + Firstname ))
- IsBlank = .F.
- ENDIF
- SET COLOR TO &PromptAtr
- @ row,0 SAY "APPEND: More Re-edit <Return> "
- DO GetKey WITH choice,"MR"+Returnkey
- IF choice $ "M"+Returnkey
- EXIT
- ENDIF
- ENDDO
- IF choice = Returnkey
- EXIT
- ENDIF
- ENDDO
- * ---If the last APPENDed record is blank, DELETE it.
- IF IsBlank
- DELETE
- LastRec = LastRec - 1
- ENDIF
- * ---If some records were added, APPEND them to original database.
- IF LastRec > OldLastRec
- SET COLOR TO &PromptAtr
- @ row,0 CLEAR
- @ row,0 SAY "Appending new records..."
- DO OpenFile
- SET DELETED ON
- APPEND FROM NAMES.$$$
- SET DELETED OFF
- ENDIF
- USE
- DELETE FILE NAMES.$$$
- DO OpenFile
- IF LastRec > 0
- GOTO oldrecnum
- ENDIF
- RETURN
- * EOF: SAM_APPE.PRG
-