Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : SBBILL.ZIP
Filename : NEW.PRG

 
Output of file : NEW.PRG contained in archive : SBBILL.ZIP

* --- NEW.PRG
* enter a new client, assign client number (=record number+1000)

* --- initialize memvars for data entry
mLast = SPACE(15)
mFirst = SPACE(10)
mTitle = SPACE(4 )
mAddress = SPACE(25)
mCity = SPACE(25)
mZip = SPACE(5 )
mPhone = SPACE(14)
mDes = SPACE(30)
mStart = ctod(' / / ')
mDue = ctod(' / / ')
mBalance = 0.00


* --- draw the data entry screen and get the data in a subroutine so that
* new and edit can both use it.
DO GETDATA with 'NEW'
return
* end of procedure

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* --- GETDATA: draws the data entry screen and get the data *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
PROCEDURE GETDATA
PARA CallPRG

SELECT Client
clear
@ 2,0 say 'Enter Client Information Below'
if CallPRG = 'NEW'
@ 4,0 say 'Client No: NEW CLIENT'
else
@ 4,0 say 'Client No: '+ltrim(str(mclientno,4))
endif
@ 5,0 say ' Title:'
@ 6,0 say 'Firstname:'
@ 7,0 say ' Lastname:'
@ 9,0 say ' Street:'
@ 10,0 say 'City & St:'
@ 11,0 say ' Zip Code:'
@ 12,0 say 'Telephone:'
@ 14,0 say ' Start On:'
@ 15,0 say ' Pay By:'
@ 16,0 say ' Balance: '+ltrim(str(mbalance,10,2))
@ 18,0 say ' Descript:'

do while .t.

@ 5,11 get mtitle picture '!XXX'
@ 6,11 get mfirst picture '!XXXXXXXXX'
@ 7,11 get mlast picture '!XXXXXXXXXXXXXX'
@ 9,11 get maddress
@ 10,11 get mcity
@ 11,11 get mzip
@ 12,11 get mphone picture '(999) 999-9999'
@ 14,11 get mstart
@ 15,11 get mdue
@ 18,11 get mdes picture '@!'
read
if lastkey()=27
return
endif
set message to 22
@ 21,0 prompt ' SAVE ' message 'Save this information.'
@ 21,10 prompt ' EDIT ' message 'Re-edit this information.'
@ 21,20 prompt ' QUIT ' message 'Abort without saving this information.'
menu to opt
set message to
DO CASE
CASE opt = 0 .or. opt = 3
if updated()
mconfirm = 'N'
@ 23,0 say 'Data has been changed. Press "Y" to abandon changes: ' ;
get mconfirm picture '!'
read
if mconfirm = 'Y'
return
endif
@ 23,0
else
return
endif
CASE opt = 1
if CallPRG = 'NEW'
append blank
mclientno = recno()
endif
replace clientno with mclientno,;
title with mtitle,;
last with mlast,;
first with mfirst,;
address with maddress
replace city with mcity,;
zip with mzip,;
phone with mphone,;
des with mdes,;
balance with mbalance
replace start with mstart,;
due with mdue
exit
ENDCASE
@ 21,0
@ 22,0
ENDDO