home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
manage1.zip
/
BUILD.PRG
< prev
next >
Wrap
Text File
|
1986-05-29
|
13KB
|
435 lines
** Last revision: May 26, 1986 at 17:43
* build.prg main command program of building database
STOR .t. TO first
* set up the loop
STOR .T. to more
DO WHIL more
* if first time this trip
IF first
DO b_first
STOR .f. TO first
ENDI
STOR '<A>dd, <B>ackward, <D>elete/Recall, <E>dit, <F>orward, <H>elp' TO prompt1
STOR '<P>rint, <S>earch by building code or a<N>y part of database' TO prompt2
STOR '<T>enant records or <R>eturn to main menu SELECT' TO prompt3
STOR 'Main Building Database ' TO mode
STOR '?' TO command
* find out if the current record is marked for deletion
IF DELETE()
STOR 'Deleted' TO deleted
ELSE
STOR ' ' TO deleted
ENDI *
* show the current record, and find out what to do next
@ 0, 0 SAY deleted
@ 1,26 SAY mode
@ 3,10 SAY baddr
@ 3,61 SAY bcode
@ 4,10 SAY SUBSTR(bcity,1,20)
@ 4,44 SAY SUBSTR(bcity,21,2)
@ 4,61 SAY SUBSTR(bcity,23,5)
@ 6,10 SAY SUBSTR(bdata,1,25)
@ 6,61 SAY SUBSTR(bdata,26,13)
@ 7,10 SAY SUBSTR(bdata,39,2)
@ 7,61 SAY SUBSTR(bdata,41,3)
@ 9,10 SAY SUBSTR(bdata,44,8)
@ 9,61 SAY bprice PICTURE '999,999,999.99'
@ 12,10 SAY remit
@ 12,61 SAY phone
@ 13,10 SAY remitad
@ 14,10 SAY remitc
@ 15,10 SAY checks
@ 17,10 SAY bnotes
@ 18,61 SAY bupdate
@ 20, 4 SAY prompt1
@ 21, 4 SAY prompt2
@ 22, 4 SAY prompt3
@ 22,70 GET command PICTURE '!'
READ
* perform selected function
DO CASE
CASE command = 'A'
DO ADDB
LOOP
CASE (command = 'B' .OR. command = ',' )
* move backwards one record
SKIP -1
LOOP
CASE command = 'D'
* switch the current record from deleted to recalled
IF DELETE()
RECA
ELSE
DELE
ENDI DELETE()
LOOP
CASE command = 'E'
SET INTENSITY ON
SET DELIMITER OFF
STOR baddr TO mbaddr
STOR bcode TO mbcode
STOR SUBSTR(bcity,1,20) TO mbcity
STOR SUBSTR(bcity,21,2) TO mbst
STOR SUBSTR(bcity,23,5) TO mbzip
STOR SUBSTR(bdata,1,25) TO mbmgr
STOR SUBSTR(bdata,26,13) TO mbphone
STOR SUBSTR(bdata,39,2) TO mbtype
STOR SUBSTR(bdata,41,3) TO mbunit
STOR SUBSTR(bdata,44,8) TO mbacq
STOR bprice TO mbprice
STOR remit TO mremit
STOR phone TO mphone
STOR remitad TO mremitad
STOR remitc TO mremitc
STOR checks TO mchecks
STOR bnotes TO mbnotes
STOR bupdate TO mbupdate
STOR 'Edit Building Data' TO mode
STOR ' Enter the new or corrected information' TO prompt1
STOR " Control 'Q' or 'W' to end edit session" TO prompt2
STOR SPACE(75) TO prompt3
@ 1,02 SAY SPACE(76)
@ 1,26 SAY mode
@ 3,10 GET mbaddr
@ 3,61 GET mbcode PICTURE '99'
@ 4,10 GET mbcity
@ 4,44 GET mbst PICTURE '!!'
@ 4,61 GET mbzip PICTURE '99999'
@ 6,10 GET mbmgr
@ 6,61 GET mbphone PICTURE '(999)999-9999'
@ 7,10 GET mbtype
@ 7,61 GET mbunit
@ 9,10 GET mbacq PICTURE '99/99/99'
@ 9,61 SAY SPACE(16)
@ 9,61 GET mbprice
@ 12,10 GET mremit
@ 12,61 GET mphone
@ 13,10 GET mremitad
@ 14,10 GET mremitc
@ 15,10 GET mchecks
@ 17,10 GET mbnotes
@ 18,61 GET mbupdate PICTURE '99/99/99'
@ 20,00
@ 21,00
@ 22,00
@ 20,04 SAY prompt1
@ 21,04 SAY prompt2
@ 22,04 SAY prompt3
READ
CLEA GETS
* test if there is a bad field validation
IF mbcode = ' '
* no building code
STOR .t. TO error
ELSE
STOR .f. TO error
ENDI
* if test for error was true then fix the fields that need fixing
IF error
* erase the lines to be used for prompts
@ 01,00
@ 20,00
@ 21,00
@ 22,00
* tell them to correct it
@ 1,18 SAY 'Please Correct the Indicated Data'
* keep looping until all fields are fixed
STOR .t. to an_error
DO WHIL an_error
DO CASE
CASE mbcode = ' '
@ 20,15 SAY 'Must have a building code '
@ 03,61 GET mbcode PICTURE '99'
READ
OTHE
STOR .f. TO an_error
ENDC
ENDD while an:error
ENDI error
SET DELIMITER ON
SET INTENSITY OFF
STOR 'N' TO command
@ 20,00
@ 21,00
@ 22,00
@ 20,23 SAY 'Are there any more changes ? '
@ 20,55 GET command picture '!'
READ
SET DELIMITER OFF
SET INTENSITY ON
IF command = 'Y'
@ 1,00
@ 1,26 SAY mode
@ 3,10 GET mbaddr
@ 3,61 GET mbcode PICTURE '99'
@ 4,10 GET mbcity
@ 4,44 GET mbst PICTURE '!!'
@ 4,61 GET mbzip PICTURE '99999'
@ 6,10 GET mbmgr
@ 6,61 GET mbphone PICTURE '(999)999-9999'
@ 7,10 GET mbtype
@ 7,61 GET mbunit
@ 9,10 GET mbacq PICTURE '99/99/99'
@ 9,61 GET mbprice
@ 12,10 GET mremit
@ 12,61 GET mphone
@ 13,10 GET mremitad
@ 14,10 GET mremitc
@ 15,10 GET mchecks
@ 17,10 GET mbnotes
@ 18,61 GET mbupdate PICTURE '99/99/99'
@ 20,00
@ 21,00
@ 22,00
@ 20,04 SAY prompt1
@ 21,04 SAY prompt2
@ 22,04 SAY prompt3
* let user enter data
READ
CLEA GETS
ENDI command = 'Y'
REPL baddr WITH mbaddr, bcode WITH mbcode
REPL bcity WITH mbcity + mbst + mbzip
REPL bdata WITH mbmgr + mbphone + mbtype + mbunit + mbacq
REPL bprice WITH mbprice, remit WITH mremit, phone WITH mphone
REPL remitad WITH mremitad, remitc WITH mremitc,checks WITH mchecks, bnotes WITH mbnotes
* ask if an automatic update of the date is wanted
IF SUBSTR(DTOC(DATE()),1,2) <> '00'
STOR 'Y' TO command
@ 20,00
@ 21,00
@ 22,00
@ 20,12 SAY 'Do You wish to UpDate to Todays Date (Y/N) ?'
@ 20,57 GET command PICTURE '!'
READ
IF command = 'Y'
REPL bupdate WITH DTOC(DATE())
ELSE
REPL bupdate WITH mbupdate
ENDI $(date)
ENDI command = 'Y'
SET INTENSITY OFF
SET DELIMITER ON
STOR .t. TO first
LOOP
CASE (command = 'F' .OR. command = '.' )
* move forward one record
SKIP
LOOP
CASE (command = 'H' .OR. command = '?' )
* display a screen full of instructions
STOR .t. TO first
CLEA
TEXT
M A I N B U I L D I N G M E N U H E L P F I L E
Welcome to the SIG/M PROPERTY MANAGER Building File Data Base.
I am here to help you and you can call me anytime by just entering
a ? mark at any place where this program asks for a command.
When you go back to the screen you will see two lines - on top of
the first line it says 'Main Building Database Menu' - thus, the
program always tells you where you are!
Between the two lines we have the information you or someone else
entered into the computer. This information tells you all about a
particular building.
If you press any key I will tell you more.
ENDT
SET CONSOLE OFF
WAIT
SET CONSOLE ON
CLEA
TEXT
This is a multiple data base - by that I mean - you can have one screen of
information about the building and another screen of information about any of
the tenants in that building. To find the first tenant for the building you
are looking at hit 'T' for tenant information. The transition is not quite
immediate, because the program takes the time to find the first individual in
the building that you have on the screen.
The information on screen in clear, so let's look below the line. This shows
what you can do. To look at the next record - hit 'F' (or a period). To go
back one record - hit 'B' (or a comma). To delete a record hit 'D' and a sign
will appear at the upper right corner. To remove the delete - hit 'D' again.
Don't worry - you cannot accidentally delete a record just by hitting 'D'.
You must run another program on the Maintenance Menu (purge) to delete.
To find a file - hit 'S' for search. To find any string in any part of the
file hit 'N' (a real handy way to search). To Edit a file - hit 'E'. To add more
records you hit 'A'. Once in add you can enter new buildings and the tenants
connected with that building. If you already have the building data in this
program the menu gives you the option to add only tenants.
Please hit any key for the next screen
ENDT
SET CONSOLE OFF
WAIT
SET CONSOLE ON
CLEA
TEXT
We suggest that you enter all units for the property first time around, even if
they are vacant. (Put in the last rental for the property) If you leave a blank
for the tenant name - the unit will appear on the vacancy list.
To do property connected reports, such as rent bills, tenant labels, vacancy
lists or delinquency lists, hit 'R' for Reports. 'M' for Maintanance allows
you to do housekeeping chores, etc. See the specific help menus as well as
the menus themselves for more information.
Please don't forget that at any menu '?' brings on a help menu and 'Q' quits
to the prior menu.
-------------------------------------------------------------------------
WHATEVER YOU DO - NEVER SHUT OFF THE MACHINE OR REMOVE A DISK UNTIL YOU
FIRST RETURN TO THE MAIN MENU AND THEN QUIT TO THE OPERATING SYSTEM.
IF you ever get a SYNTAX error and hitting ENTER does not solve the prob-
lem, then just hit ESCAPE and type QUIT. Then just start all over again.
-------------------------------------------------------------------------
Please hit any key to get back to the data base
ENDT
SET CONSOLE OFF
WAIT
SET CONSOLE ON
STOR .T. TO more
CASE command = 'P'
* Screen print
@ 20,00
@ 21,00
@ 22,00
@ 20,0 SAY 'PRINT OPTIONS: S (SINGLE SPACE), D (DOUBLE SPACE), N (NO PRINTING) '
STOR 'Y' TO PRNTSCRN
STOR 'N' TO PRNTOPT
@ 20,67 GET PRNTOPT PICTURE '!'
READ
DO WHIL AT(PRNTOPT, 'SDN') = 0
@ 20,67 GET PRNTOPT PICTURE '!'
READ
ENDD
IF PRNTOPT = 'S'
STOR 1 TO LINEMULT
ENDI
IF PRNTOPT = 'D'
STOR 2 TO LINEMULT
ENDI
IF PRNTOPT = 'N'
STOR 'N' TO PRNTSCRN
ENDI
IF PRNTSCRN = 'Y'
SET DEVICE TO PRINT
EJEC
@ LINEMULT*4,2 SAY 'Address:'
@ LINEMULT*4,12 SAY BADDR
@ LINEMULT*4,56 SAY 'Code:'
@ LINEMULT*4,63 SAY BCODE
@ LINEMULT*5,5 SAY 'City:'
@ LINEMULT*5,12 SAY SUBSTR(BCITY,1,20)
@ LINEMULT*5,38 SAY 'State:'
@ LINEMULT*5,46 SAY SUBSTR(BCITY,21,2)
@ LINEMULT*5,57 SAY 'Zip:'
@ LINEMULT*5,63 SAY SUBSTR(BCITY,23,5)
@ LINEMULT*7,2 SAY 'Manager:'
@ LINEMULT*7,12 SAY SUBSTR(BDATA,1,25)
@ LINEMULT*7,55 SAY 'Phone:'
@ LINEMULT*7,63 SAY SUBSTR(BDATA,26,13)
@ LINEMULT*8,5 SAY 'Type:'
@ LINEMULT*8,12 SAY SUBSTR(BDATA,39,2)
@ LINEMULT*8,45 SAY 'Number of Units:'
@ LINEMULT*8,63 SAY SUBSTR(BDATA,41,3)
@ LINEMULT*10,1 SAY 'Acquired:'
@ LINEMULT*10,12 SAY SUBSTR(BDATA,44,8)
@ LINEMULT*10,46 SAY 'Purchase Price:'
@ LINEMULT*10,63 SAY BPRICE PICTURE '$999,999,999.99'
@ LINEMULT*12,29 SAY "Send Rental Payments To:"
@ LINEMULT*13,01 SAY "Company:"
@ LINEMULT*13,12 SAY REMIT
@ LINEMULT*13,55 SAY "Phone:"
@ LINEMULT*13,63 SAY PHONE
@ LINEMULT*14,02 SAY "Street:"
@ LINEMULT*14,12 SAY REMITAD
@ LINEMULT*15,04 SAY "City:"
@ LINEMULT*15,12 SAY REMITC
@ LINEMULT*16,1 SAY "Chks To:"
@ LINEMULT*16,12 SAY CHECKS
@ LINEMULT*17,02 SAY "Notes:"
@ LINEMULT*17,12 SAY BNOTES
@ LINEMULT*18,53 SAY 'Updated:'
@ LINEMULT*18,63 SAY BUPDATE
@ LINEMULT*19,1 SAY DTOC(DATE())
@ 52,0 SAY ' '
SET DEVICE TO SCREEN
ENDI
@ 20,0
@ 21,0
@ 22,0
RELE PRNTSCRN, PRNTOPT, LINEMULT
CASE command = 'Q'.OR. command = 'R'
STOR .f. TO more
CASE command = 'T'
@ 20,00
@ 21,00
@ 22,00
STOR ' ' to findt
@ 20,08 SAY 'Enter tenant number (or leave at blank for first tenant) '
@ 20,64 GET findt PICTURE '999'
READ
STOR TRIM(bcode)+TRIM(findt) TO findt
SELE B
USE &dr:tenant index &dr.:codea
SEEK TRIM(findt)
IF FOUND()
DO tenant
ELSE
@ 20,00
@ 21,00
@ 22,00
@ 20,18 SAY 'Unable to locate either tenant or building'
@ 21,24 SAY 'PLEASE HIT ANY KEY TO CONTINUE'
SET CONSOL OFF
WAIT
SET CONSOL ON
SELE A
USE &dr:build index &dr.:code
ENDI
LOOP
CASE command= 'S'
@ 20,00
@ 21,00
@ 22,00
STOR ' ' TO findb
@ 20,27 SAY 'Enter Code Number'
@ 20,49 GET findb PICTURE '99'
READ
SEEK TRIM(findb)
IF .NOT. FOUND()
@ 20,00
@ 21,00
@ 22,00
@ 20,15 SAY 'Unable to locate building with that Code Number'
@ 21,24 SAY 'PLEASE HIT ANY KEY TO CONTINUE'
SET CONSOL OFF
WAIT
SET CONSOL ON
GO TOP
ENDI
CASE command= 'N'
DO search1b
STOR .t. TO first
LOOP
* loop back again
ENDC
ENDD WHILE more
RETU