home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
DB
/
DB012B.ZIP
/
VPI1MANL.ZIP
/
CHARITY.ZIP
/
ENTRY.PRG
< prev
next >
Wrap
Text File
|
1991-12-29
|
4KB
|
112 lines
***************************************************************************
** ENTRY.PRG
** (C) Copyright 1990, Sub Rosa Publishing Inc.
** A demonstration program provided to VP-Info users.
** This program may be copied freely. If it is used in commercial code,
** please credit the source, Sub Rosa Publishing Inc.
**
** ENTRY is a free-standing program chained to from DONMENU.PRG, used to
** enter and edit donations.
**
** ENTRY is compatible with all current versions of VP-Info.
**
** Sid Bursten and Bernie Melman
** May 9,1990
***************************************************************************
ON escape ;what to do when <Esc> is pressed
WINDOW
CANCEL
ENDON
SET text on ;include display fields in GET TABLE for READ
SET trim off ;do not trim & macros in TEXT display
SET execution off ;don't force re-execution of ON FIELD on exit
SET deleted on ;don't show deleted records
SET talk off ;suppress messages like NO FIND
USE donate index donatdon,donatsol,donatdat
USE#2 donor index don_code
USE#3 solicit index sol_code
IF recno(1)=0
APPEND blank
ENDIF
goto dbf(recs) ;goto last record added to file
PERFORM inputscrn
DO WHILE t
:field=field(donor) ;start with first name
IF donor<>donor#2
FIND#2 &donor#1 ;align file when donor code filled in
REPLACE solicitor with solicitor#2
ENDIF
IF solicitor<>solicitor#3 ;align solicitor file
FIND#3 solicitor#1
ENDIF
@ 0,0 say pic(#,'999,999')
@ 0,77 say iff(deleted(1),'DEL',' ')
READ
kn=:key ;save key used to get out of READ
DO CASE kn
CASE kn=17 ; ^Q=no update
NOUPDATE ;cancel any changes already made
CASE kn=329 ; <PgUp>=Beginning of file
SKIP -1
IF #=0 ;don't back up past beginning of file
GOTO top
RING ;notify user end of file reached
ENDIF
CASE kn=337 ; <PgDn>=End of file
SKIP
IF eof
GOTO bottom
RING ;notify user end of file reached
ENDIF
CASE kn=375 ; ^<Home>=Beginning of file
GO top
CASE kn=373 ; ^<End>=End of file
GOTO bottom
CASE kn=374 ; ^<PgDn>=Add a record
GOTO top
IF donor>' '
APPEND blank ;append only if not already an empty record
REPLACE date with date(ymd)
ENDIF
CASE kn=335 ; <End>=Quit
BREAK
ENDCASE kn
ENDDO
CHAIN DONMENU
*
PROCEDURE inputscrn
WINDOW ;cancel any existing window before erasing screen
ERASE
SET width to 80
TEXT .3 ;get screen text from library, volume number 3
ON field
FIELD donor
IF @(' ',donor)>0
:field=field(donor)
ELSE
IF donor<>donor#2
FIND#2 &donor#1 ;align file when donor code filled in
IF recno(2)>0
IF solicitor<>solicitor#3
FIND#3 &solicitor#1 ;align file when solicitor code filled in
ENDIF
REPLACE solicitor with solicitor#3
@ 23,0
ELSE
@ 23,0 say cen('Invalid Donor number...please re-enter.',80)
ENDIF
ENDIF
ENDIF
FIELD date
IF date=' ' .or. date<>date(ymd,date)
:field=field(date)
@ 23,0 say cen('Date must be filled in with legal date in form YY/MM/DD',80)
RING
ELSE
@ 23,0
ENDIF
ENDON
ENDPROC inputscrn
*
* *** end of program ENTRY.prg ***