home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
DATABASE
/
DPG.ZIP
/
VRENT.DPG
< prev
next >
Wrap
Text File
|
1992-04-23
|
4KB
|
225 lines
files
video
{
str 20 category
int 2 copies
int 2 in_stock
float 2 2 rent
date release_date
}
index title 20
customer
{
str 20 full_name
str 20 address_1
str 20 address_2
str 20 address_3
}
index account_name 20
transaction
{
str 20 title
date transaction_date
str 1 type
}
on { customer }
procedures
wait
{
printstr 30 20 "Press any key to continue"
cursor 56 20
pause
}
show_video
{
printstr 10 6 "Category"
printstr 10 7 "Copies"
printstr 10 8 "Copies in Stock"
printstr 10 9 "Rental Charge"
printstr 10 10 "Release Date"
printstr 30 5 video.title
printstr 30 6 video.category
printint 30 7 video.copies
printint 30 8 video.in_stock
printfloat 30 9 video.rent
printdate 30 10 video.release_date
}
alter_video
{
show_video
:CATEGORY
edit video.category 30 6 { return esc=END down }
:COPIES
edit video.copies 30 7 { return esc=END up=CATEGORY down }
:IN_STOCK
edit video.in_stock 30 8 { return esc=END up=COPIES down }
:RENT
edit video.rent 30 9 { return esc=END up=IN_STOCK down }
:RELEASE_DATE
edit video.release_date 30 10 { return esc up=RENT }
:END
write video
}
add_video "Videos!Add a Video"
{
printstr 10 5 "Title"
create 30 5 video { return esc=CANCEL }
alter_video
return
:CANCEL
delete video
}
edit_video "Videos!Edit a Video"
{
printstr 10 5 "Title"
select video 30 5 { return esc=CANCEL }
alter_video
:CANCEL
}
display_video "Videos!Display a Video"
{
printstr 10 5 "Title"
select video 30 5 { return esc=CANCEL }
show_video
wait
:CANCEL
}
remove_video "Videos!Remove a Video"
str 1 sure
{
printstr 10 5 "Title"
select video 30 5 { return esc=CANCEL }
show_video
printstr 30 20 "Are you sure? (Y/N) "
cursor 50 20
getkey sure
if !strcmp sure "Y"
delete video
:CANCEL
}
show_customer
{
printstr 10 6 "Full Name"
printstr 10 7 "Address"
printstr 30 5 customer.account_name
printstr 30 6 customer.full_name
printstr 30 7 customer.address_1
printstr 30 8 customer.address_2
printstr 30 9 customer.address_3
}
alter_customer
{
show_customer
:FULL_NAME
edit customer.full_name 30 6 { return esc=END down }
:ADDRESS_1
edit customer.address_1 30 7 { return esc=END up=FULL_NAME down }
:ADDRESS_2
edit customer.address_2 30 8 { return esc=END up=ADDRESS_1 down }
:ADDRESS_3
edit customer.address_3 30 9 { return esc up=ADDRESS_2 }
:END
write customer
}
add_customer "Customers!Add a Customer"
{
printstr 10 5 "Account Name"
create 30 5 customer { return esc=CANCEL }
alter_customer
return
:CANCEL
delete customer
}
edit_customer "Customers!Edit a Customer"
{
printstr 10 5 "Account Name"
select customer 30 5 { return esc=CANCEL }
alter_customer
:CANCEL
}
display_customer "Customers!Display a Customer"
{
printstr 10 5 "Account Name"
select customer 30 5 { return esc=CANCEL }
show_customer
wait
:CANCEL
}
remove_customer "Customers!Remove a Customer"
str 1 sure
{
printstr 10 5 "Account Name"
select customer 30 5 { return esc=CANCEL }
show_customer
printstr 30 20 "Are you sure? (Y/N) "
cursor 50 20
getkey sure
if !strcmp sure "Y"
delete customer
:CANCEL
}
enter_transactions_show
{
printstr 0 (-1) transaction.title
printdate 30 (-1) transaction.transaction_date
printstr 50 (-1) transaction.type
}
enter_transactions_edit
{
switch fieldno { TITLE LOAN_DATE TYPE }
:TITLE
edit transaction.title 0 (-1) { return esc up down right pgup pgdn home end ins del }
return
:LOAN_DATE
edit transaction.transaction_date 30 (-1) { return esc up down left right pgup pgdn home end ins del }
return
:TYPE
edit transaction.type 50 (-1) { return esc up down left pgup pgdn home end ins del }
return
}
enter_transactions "Transactions!Enter Transactions"
{
printstr 10 5 "Account Name"
select customer 30 5 { return esc=CANCEL }
show_customer
printstr 0 11 "Film Title"
printstr 30 11 "Transaction Date"
printstr 50 11 "Type (L/R)"
scroll transaction customer 3 enter_transactions_show enter_transactions_edit 0 13 80 12
:CANCEL
}
display_transactions "Transactions!Display Transactions"
{
printstr 10 5 "Account Name"
select customer 30 5 { return esc=CANCEL }
show_customer
printstr 0 11 "Film Title"
printstr 30 11 "Transaction Date"
printstr 50 11 "Type (L/R)"
scroll transaction customer 3 enter_transactions_show 0 0 13 80 12
:CANCEL
}