home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Du Jour
/
SoftwareDuJour.iso
/
BUSINESS
/
DBASE
/
MEMBERS.ARC
/
MDMOD.PRG
< prev
next >
Wrap
Text File
|
1986-10-21
|
5KB
|
218 lines
*----------------------------------------------------------------------
* Program : Membership Database Package
* File : MDMOD
* Function: Add/Delete/Browse Program for Members Database
* Author : J. North
* Version : (AT contest)
* Date : 10/15/86
*----------------------------------------------------------------------
*
clear
@ 1, 0 TO 9, 79 DOUBLE
@ 2, 2 say "DATABASE EDIT SETUP Press Ctrl-End to return to menu."
@ 4, 30 say "Browse Order Query File .QRY"
@ 5, 29 say "- - - - - - - - - - -"
@ 6, 30 say "0- Record # Order"
@ 7, 30 say "1- Last/First Name"
@ 8, 30 say "2- Zip Code"
do set_brt
@ 4, 2 say "F2 - Set Browse Order"
@ 5, 2 say "F3 - Select Query File"
@ 6, 2 say "F4 -"
@ 7, 2 say "F5 -"
@ 8, 2 say "F6 - Edit Database"
do set_dim
@ 3, 1 to 3, 78 DOUBLE
@ 4, 28 to 8, 28 DOUBLE
@ 4, 50 to 8, 50
@ 5, 51 to 5, 78
@ 7, 51 to 7, 78
call curson
@ 10, 0 say ""
dir *.qry
q_ord=1
q_qry=space(8)
do while .T.
@ 4, 43 get q_ord picture "9"
@ 4, 64 get q_qry picture "!!!!!!!!"
clear gets
set console off
key=0
do while key=0
key=inkey()
enddo
set console on
do case
case key=23
call cursoff
return
case key=-1
@ 4, 43 get q_ord picture "9" range 0,2
read
case key=-2
@ 4, 64 get q_qry picture "!!!!!!!!"
read
if q_qry#space(8).and. .not. file(trim(q_qry)+".qry")
q_qry=space(8)
endif
case key=-5
exit
endcase
enddo
do clwait
set deleted off
select 1
use members index name,zip
goto top
if eof()
append blank
replace distribute with .T.
endif
set order to q_ord
if q_qry#space(8)
qry=trim(q_qry)
q_qry=qry+".qry"
set filter to file &q_qry
else
qry="(all)"
endif
goto top
if eof()
clear
do dialog with 10,"None of the records match the query specifications. - Press any key."
wait ""
use
return
endif
do case
case q_ord=0
ord="Rec #"
case q_ord=1
ord="Name"
case q_ord=2
ord="Zip"
endcase
clear
@ 1, 0 TO 22, 79 DOUBLE
@ 3, 1 TO 3, 78 DOUBLE
@ 11, 1 TO 11, 78
@ 0, 0 say "Query: "+qry
@ 0, 17 say "Order: "+ord
@ 2, 2 say "Record # MEMBER INFORMATION"
@ 4, 2 say "First Name"
@ 4, 32 say "Last Name"
@ 6, 4 say "Company"
@ 6, 50 say "Home Phone"
@ 7, 4 say "Address"
@ 8, 50 say "Work Phone"
@ 9, 7 say "City"
@ 10, 6 say "State"
@ 10, 20 say "Zip Code"
@ 10, 45 say "Expiration Date"
@ 12, 2 say "Membership Type"
@ 12, 25 say "Chapter Code"
@ 12, 45 say "Occupation Codes"
@ 13, 1 say "---------------------- ------------------- -----------------------------------"
@ 14, 2 say "RG - Regular PH - Philadelphia 01-Architect 09-Manufacturer"
@ 15, 2 say "CM - Corporate NE - North East 02-Builder 10-Lawyer"
@ 16, 2 say "ST - Staff NJ - New Jersey 03-Consultant 11-Policy Maker"
@ 17, 2 say "HM - Honorary DE - Delaware 04-Distributor 12-Researcher"
@ 18, 45 say "05-Educator 13-Retailer"
@ 19, 45 say "06-Engineer 14-Student"
@ 20, 45 say "07-Government 15-Writer/Editor"
@ 21, 2 say "Include on distributed lists (Y/N)?"
@ 21, 45 say "08-Installer"
@ 12, 23 TO 19, 23
@ 12, 43 TO 21, 43
@ 20, 1 TO 20, 42
do set_brt
@ 23, 2 say "Prev-Rec: PgUp New-Rec : ^Home Del/Recall: F1"
do case
case q_ord=1
@ 23, 58 say "Find Last Name: ^PgUp"
case q_ord=2
@ 23, 58 say "Find Zip Code: ^PgUp"
endcase
@ 24, 2 say "Next-Rec: PgDn Goto Menu: ^End"
do set_dim
draw_d=.T.
do while .T.
if draw_d
do d_mbr
draw_d=.F.
endif
if deleted()
do set_rv
@ 2,40 say "Deleted"
do set_dim
else
@ 2,40 say space(7)
endif
read save
rk=mod(readkey(),256)
do case
case rk=14
exit
case rk=7
draw_d=.T.
skip 1
if eof()
goto top
endif
case rk=6
draw_d=.T.
if .not. bof()
skip -1
endif
case rk=34 .and. q_ord>0
clear gets
do case
case q_ord=1
target=space(16)
@ 24, 58 get target picture "XXXXXXXXXXXXXXXX"
case q_ord=2
target=space(5)
@ 24, 58 get target picture "99999"
endcase
read
if mod(readkey(),256)=14
exit
endif
recsav=recno()
target=trim(target)
if len(target)#0
seek target
if eof()
@ 24, 58 say "Record Not Found "
else
recsav=recno()
endif
endif
goto recsav
draw_d=.T.
case rk=36
if deleted()
recall
else
delete
endif
case rk=33
append blank
replace distribute with .T.
draw_d=.T.
endcase
enddo
call cursoff
* - Need to rebuild index files if user selected Rec # order
if q_ord=0
do clwait
do dialog with 10,"Updating index files ..."
set order to 1
reindex
endif
set deleted on
set filter to
use
return