home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
sri314_b.zip
/
CHARITY.ZIP
/
SOLEDIT.PRG
< prev
next >
Wrap
Text File
|
1990-06-07
|
3KB
|
112 lines
***************************************************************************
** SOLEDIT.PRG
** (C) Copyright 1990, Sub Rosa Publishing Inc.
** A demonstration program provided to SR-Info and VP-Info users.
** This program may be copied freely. If it is used in commercial code,
** please credit the source, Sub Rosa Publishing Inc.
**
** SOLEDIT is a subroutine on MENU.PRG, used to edit and add solicitor
** records to SOLICIT.DBF. This is similar to DONEDIT, which is more
** fully commented.
**
** SOLEDIT is compatible with all current versions of SR-Info and
** VP-Info, but VP-Info actually has an easier way of accomplishing the
** same task. EDIT OFF can be used instead of READ, thus eliminating the
** need to program function keys by yourself. In addition, the code
** that creates new code numbers could be moved into an ON FIELD structure.
**
** Sid Bursten and Bernie Melman
** May 9,1990
***************************************************************************
ON escape
WINDOW
CLEAR gets
CANCEL
ENDON
WINDOW
SET deleted off
USE solicit index sol_name,sol_code
IF recno(1)=0
APPEND blank
ENDIF
GOTO dbf(recs) ;goto last record added to file
ERASE
TEXT .2
DO WHILE t
IF solicitor=' '
mfname=fname
mname=name
recnum=#
WINDOW 10,10,17,69 double
CLEAR gets
TEXT
.. solicitor,!!!-!-99
Record to add
First Name... @mfname
Last Name... @mname
ENDTEXT
WINDOW
READ
finder=!(left(mname,3)+left(mfname,1))
* LAST &finder ;in VP-Info only
FIND &finder
IF #=0
finder=finder+'01'
ELSE
LIMIT 4 ;this and following 2 commands not required in
GOTO bottom ; VP-Info when LAST is used instead of FIND
LIMIT
num=val(right(solicitor,2))
IF num<99
finder=finder+right(str(101+num,3),2)
ELSE
finder='******'
ENDIF
ENDIF
GOTO recnum
REPLACE fname with mfname,name with mname,solicitor with finder
ERASE
TEXT .2
:field=field(address)
ELSE
:field=field(fname)
ENDIF
@ 0,0 say pic(#,'999,999')
@ 0,77 say iff(deleted(1),'DEL',' ')
READ
kn=:key
DO CASE kn
CASE kn=17 ; ^Q=no update
NOUPDATE
CASE kn=329 ; <PgUp>=Beginning of file
SKIP -1
IF #=0
GOTO top
RING
ENDIF
CASE kn=337 ; <PgDn>=End of file
SKIP
IF eof
GOTO bottom
RING
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 solicitor>' '
APPEND blank
ENDIF
CASE kn=335 ; <End>=Quit
BREAK
ENDCASE kn
ENDDO
CLOSE all
RETURN
*
* *** end of program soledit.prg ***