home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol198 / maintain.bld < prev    next >
Encoding:
Text File  |  1985-02-10  |  15.0 KB  |  458 lines

  1. * DATE 09/10/84  18:19
  2. * maintain.bld
  3. STOR t TO more
  4. DO WHIL more
  5.  STOR CHR(PEEK(063)) TO dr
  6.  SELE PRIMARY
  7.  USE &dr.:build INDEX &dr.:code
  8.  REST from coname additive
  9.  ERAS
  10.  STOR '?' TO command
  11. TEXT
  12.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  13.  *                                                                           *
  14.  *                                                                           *
  15.  *                                                                           *
  16.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  17.  *                                                                           *
  18.  *                                                                           *
  19.  *                                                                           *
  20.  *                                                                           *
  21.  *                                                                           *
  22.  *                                                                           *
  23.  *                                                                           *
  24.  *                                                                           *
  25.  *                                                                           *
  26.  *                                                                           *
  27.  *                                                                           *
  28.  *                                                                           *
  29.  *                                                                           *
  30.  *                                                                           *
  31.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  32.  *   Please select one of the above options. You may also leave this menu    *
  33.  *   by typing 'Q' and get on-line HELP by typing '?'.                       *
  34.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  35. ENDT
  36.  @ 03,04 SAY coname + "  -  FILE MAINTENANCE MENU"
  37.  @ 03,65 SAY DATE()
  38.  @ 07,24 SAY 'A. Backup data files'
  39.  @ 08,24 SAY 'B. Browse through building file'
  40.  @ 09,24 SAY 'C. Browse through tenant file'
  41.  @ 10,24 SAY 'D. Display building file'
  42.  @ 11,24 SAY 'E. Display tenant file'
  43.  @ 12,24 SAY 'F. First initialization of Property Manager Program'
  44.  @ 13,24 SAY 'G. Reininitialze defaults, company name, etc.'
  45.  @ 14,24 SAY 'H. Purge building and tenant file'
  46.  @ 15,24 SAY 'I. Re-index the records into all indexes'
  47.  @ 16,24 SAY 'J. Return to main menu'
  48.  @ 18,23 SAY "PLEASE SELECT ONE OF THE OPTIONS"
  49.  @ 18,58 GET command PICTURE '!'
  50.  READ
  51.  DO WHIL @(COMMAND, 'ABCDEFGHIJ?Q') = 0
  52.   STOR '?' TO command
  53.   @ 18,58 GET command PICTURE '!'
  54.   READ
  55.  ENDD
  56.  DO CASE
  57.  CASE command = 'A'
  58.   STOR 'Y' TO doit
  59.   ERAS
  60.   @ 01,05 SAY 'This module makes a backup of the DATA Files to another disk'
  61.   @ 03,05 SAY 'Do you want to do a backup of the DATA Files (Y/N) ?'
  62.   @ 03,60 GET doit PICTURE '!'
  63.   READ
  64.   IF doit = 'Y'
  65.    @ 01,00
  66.    @ 03,00
  67.    @ 03,05 SAY 'The left drive is Drive A  - The right drive is Drive B'
  68.    @ 04,05 SAY 'The DATA File is on drive '+dr+' and you normally backup to drive B'
  69.    @ 06,05 SAY 'Make sure the backup disk is in the drive selected for backup'
  70.    RESE
  71.    STOR 'B' TO bdr
  72.    @ 08,05 SAY 'Which drive selected for backup DATA File ? ' GET bdr PICTURE '!'
  73.    READ
  74.    DO WHIL @(bdr,'AB') = 0
  75.     @ 08,05 SAY 'Which drive selected for backup DATA File ? ' GET bdr PICTURE '!'
  76.     READ
  77.    ENDD while @
  78.    IF bdr <> dr
  79.     @ 10,05 SAY 'Now copying DATA Files from drive '+dr+' to drive '+bdr+ ' '
  80.     SET ECHO ON
  81.     SET TALK ON
  82.     SELE PRIMARY
  83.     USE &dr.:build INDEX &dr.:code
  84.     RESE
  85.     COPY TO &bdr.:buildbak
  86.     SELE SECONDARY
  87.     USE &dr.:tenant INDEX &dr.:codea
  88.     COPY TO &bdr.:tenbak
  89.     SET TALK OFF
  90.     SET ECHO OFF
  91.     SELE PRIMARY
  92.     USE &dr.:build INDEX &dr.:code
  93.    ELSE
  94.     @ 10,05 SAY 'Cant backup to same drive - Aborting'
  95.     @ 12,00 SAY 'Hit RETURN to Continue'
  96.     SET CONSOLE OFF
  97.     WAIT
  98.     SET CONSOLE ON
  99.    ENDI not same drive
  100.   ENDI do backup
  101.  CASE command = 'B'
  102. * browse thru records
  103.   ERAS
  104.   @ 01,12 SAY '***WARNING***  ***WARNING***  ***WARNING***'
  105.   @ 03,13 SAY 'Changes made will be written to the File'
  106.   @ 06,12 SAY 'CTRL-C write current record & go down'
  107.   @ 07,12 SAY 'CTRL-R write current record & go up'
  108.   @ 08,12 SAY 'CTRL-Z/B pans screen left or right'
  109.   @ 09,12 SAY 'CTRL-V toggles Insert on or off'
  110.   @ 10,12 SAY 'CTRL-G Delete character under cursor'
  111.   @ 11,12 SAY 'CTRL-U Delete or Recall current record'
  112.   @ 12,12 SAY 'CTRL-Q exit Dont Write Current record'
  113.   @ 13,12 SAY 'CTRL-W exit and Save all changes'
  114. * get a starting point in file
  115.   STOR '  ' TO stletter
  116.   @ 15,12 SAY 'We are using the building code index to browse'
  117.   @ 16,12 SAY '....so please tell me the starting code number'
  118.   @ 17,12 SAY 'or as much of it as you want to.'
  119.   @ 19,12 SAY '           Where shall we start.............'
  120.   @ 19,57 Get stletter PICTURE '99'
  121.   @ 22,00
  122.   READ
  123.   STOR TRIM(stletter) TO stletter
  124. * goto starting point or next if no find
  125.   FIND &stletter
  126.   IF # = 0
  127.    GO top
  128.   ENDI
  129. * browse thru file
  130.   SET ESCAPE OFF
  131.   BROW fields bcode, baddr
  132.   SET ESCAPE ON
  133.  CASE command = 'C'
  134.   ERAS
  135.   SELE SECONDARY
  136.   USE &dr.:tenant INDEX &dr.:codea
  137. * browse thru records
  138.   ERAS
  139.   @ 01,12 SAY '***WARNING***  ***WARNING***  ***WARNING***'
  140.   @ 03,13 SAY 'Changes made will be written to the File'
  141.   @ 06,12 SAY 'CTRL-C write current record & go down'
  142.   @ 07,12 SAY 'CTRL-R write current record & go up'
  143.   @ 08,12 SAY 'CTRL-Z/B pans screen left or right'
  144.   @ 09,12 SAY 'CTRL-V toggles Insert on or off'
  145.   @ 10,12 SAY 'CTRL-G Delete character under cursor'
  146.   @ 11,12 SAY 'CTRL-U Delete or Recall current record'
  147.   @ 12,12 SAY 'CTRL-Q exit Dont Write Current record'
  148.   @ 13,12 SAY 'CTRL-W exit and Save all changes'
  149. * get a starting point in file
  150.   STOR '     ' TO stletter
  151.   @ 15,12 SAY 'We are using the building code index to browse'
  152.   @ 16,12 SAY '....so please tell me the starting code number'
  153.   @ 17,12 SAY 'or as much of it as you want to.'
  154.   @ 19,12 SAY '           Where shall we start.............'
  155.   @ 19,57 Get stletter PICTURE '99999'
  156.   @ 22,00
  157.   READ
  158.   STOR TRIM(stletter) TO stletter
  159. * goto starting point or next if no find
  160.   FIND &stletter
  161.   IF # = 0
  162.    GO top
  163.   ENDI
  164. * browse thru file
  165.   SET ESCAPE OFF
  166.   BROW fields bcode, tunit, tenant
  167.   SET ESCAPE ON
  168.   SELE PRIMARY
  169.   USE &dr.:build INDEX &dr.:code
  170.  CASE command = 'D'
  171.   STOR CHR(PEEK (063)) TO dr
  172.   ERAS
  173.   @ 02,12 SAY 'Records are displayed by code number and you can select the '
  174.   @ 03,12 SAY 'starting code letter or any part of it.  If I do not find that'
  175.   @ 04,12 SAY 'number in the file, I will start at the beginning'
  176.   @ 06,12 SAY 'When WAITING hit space bar to continue... or ESCape to quit'
  177. * get a starting point in file
  178.   STOR '  ' TO stletter
  179.   @ 10,12 SAY 'Place at which to start display'
  180.   @ 10,57 Get stletter PICTURE '99'
  181.   READ
  182.   STOR TRIM(stletter) TO stletter
  183. * goto starting point or next if no find
  184.   FIND &stletter
  185.   IF # = 0
  186.    GO top
  187.   ENDI
  188. * display selected list
  189.   ERAS
  190.   SET ESCAPE OFF
  191.   DISP NEXT 65000 bcode, $(bdata,1,38), $(baddr,1,20)
  192.   IF eof
  193.    WAIT
  194.   ENDI
  195.   SET ESCAPE ON
  196.  CASE command = 'E'
  197.   STOR CHR(PEEK(063)) TO dr
  198.   SELE SECONDARY
  199.   USE &dr.:tenant INDEX &dr.:codea
  200.   ERAS
  201.   @ 02,12 SAY 'Records are displayed by code number and you can select the '
  202.   @ 03,12 SAY 'starting code letter or any part of it.  If I do not find that'
  203.   @ 04,12 SAY 'number in the file, I will start at the beginning'
  204.   @ 06,12 SAY 'When WAITING hit space bar to continue... or ESCape to quit'
  205. * get a starting point in file
  206.   STOR '     ' TO stletter
  207.   @ 10,12 SAY 'Place at which to start display'
  208.   @ 10,57 Get stletter PICTURE '99999'
  209.   READ
  210.   STOR TRIM(stletter) TO stletter
  211. * goto starting point or next if no find
  212.   FIND &stletter
  213.   IF # = 0
  214.    GO top
  215.   ENDI
  216. * display selected list
  217.   ERAS
  218.   SET ESCAPE OFF
  219.   DISP NEXT 65000 bcode, tunit, ttype, tenant
  220.   IF eof
  221.    WAIT
  222.   ENDI
  223.   SET ESCAPE ON
  224.   SELE PRIMARY
  225.   USE &dr.:build INDEX &dr.:code
  226.  CASE command = 'F'
  227.   ERAS
  228.   STOR 'N' TO option
  229. TEXT
  230.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  231.  
  232.         W A R N I N G       W  A  R  N  I N  G       W A R N I N G
  233.         =============       ==================      ==============
  234.  
  235.         This option is designed to create a new data base file to
  236.         startup this program the first time. It will mark for     
  237.         deletion all of the sample files we gave you in the build- 
  238.         ing and tenant databases. Then add your records and come
  239.         back to the maintenance menu to purge. A similar program 
  240.         is found on the Accounting Maintenance menu.
  241.  
  242.         NEVER RUN THIS OPTION UNLESS YOU HAVE BACKED UP THE PROGRAM        
  243.  
  244.  
  245.  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252. ENDT
  253.   @ 19,20 SAY 'ARE YOU READY TO PROCEED'
  254.   @ 19,47 GET option PICTURE '!'
  255.   READ
  256.   IF option = 'Y'
  257.    STOR CHR(PEEK(063)) TO dr
  258.    SELE SECONDARY
  259.    USE &dr.:tenant
  260.    DELE ALL
  261.    SELE PRIMARY
  262.    USE &dr.:build
  263.    DELE ALL
  264.    SET INDEX TO &dr.:code
  265.   ENDI option = 'Y'
  266.  CASE command = 'G'
  267.   SAVE TO temp
  268.   REST from manage.dat
  269.   IF PASS = 'Y'
  270.    ERAS
  271.    @ 12,10 SAY 'PLEASE ENTER THE PASSWORD SLOWLY ........'
  272.    SET EXACT ON
  273.    SET COLON OFF
  274.    STOR '12345678' TO passt
  275.    STOR ' ' TO passt1
  276.    STOR ' ' TO one
  277.    STOR ' ' to one1
  278.    STOR 0 to count
  279.    DO WHIL count < 8
  280.     SET CONSOLE OFF
  281.     @ 12,50 SAY passt1
  282.     WAIT TO one1
  283.     @ 12,50 ACCEPT one1
  284.     SET CONSOLE ON
  285.     STOR TRIM(one) + one1 TO one
  286.     STOR count + 1 TO count
  287.     STOR $(passt,1,count) TO passt1
  288.     @ 12,50 SAY passt1
  289.     SET CONSOLE OFF
  290.    ENDD
  291.    SET CONSOLE ON
  292.    STOR $(one,2,9) TO passt
  293.    IF TRIM(passt) <> TRIM(passp)
  294.     ERAS
  295.     @ 14,10 SAY "U N A U T H O R I Z E D       A C C E S S  "
  296.     @ 17,10
  297.     SET CONSOLE OFF
  298.     QUIT
  299.    ENDI passt
  300.    SET EXACT OFF
  301.    SET COLON ON
  302.   ENDI pass
  303.   DO init.spm
  304.   REST from temp additive
  305.  CASE command = 'H'
  306.   STOR CHR(PEEK (063)) TO dr
  307.   STOR 'N' TO command
  308.   ERAS
  309.   @ 02,05 SAY '*****   WARNING!   *****   WARNING!   *****   WARNING!   ****'
  310.   @ 04,05 SAY 'This will PERMANENTLY remove any deleted records.'
  311.   @ 06,05 SAY 'Type Y to continue, any other key to cancel this operation'
  312.   @ 06,64 GET command PICTURE '!'
  313.   READ
  314.   IF command = 'Y'
  315.    ERAS
  316. * give the user something to read while file is packed
  317. TEXT
  318.  
  319. Records which have been marked for deletion are being removed from the file.
  320.  
  321. When that is completed, all records will be reindexed. 
  322.  
  323. We will keep you posted as we go along..........but please be patient.
  324.  
  325. ENDT
  326. *pack the file to remove deleted records
  327. *but let us know how many records are deleted
  328.    SET INDEX TO
  329.    GO bottom
  330.    STOR # to before
  331.    @ 08,00 SAY 'The building data base contains ' + STR(before,4) + ' files before deletions'
  332.    @ 09,00 SAY ' '
  333.    SET INDEX TO &dr.:code
  334.    SET TALK ON
  335.    PACK
  336.    SET TALK OFF
  337.    SELE SECONDARY
  338.    USE &dr.:tenant
  339.    GO bottom
  340.    STOR # to before
  341.    ERAS
  342.    @ 08,00 SAY 'The tenant data base contains ' + STR(before,4) + ' files before deletions'
  343.    @ 09,00 SAY ' '
  344.    SET INDEX TO &dr.:codea
  345.    SET TALK ON
  346.    PACK
  347.    SET TALK OFF
  348.    SELE PRIMARY
  349.    USE &dr.:build INDEX &dr.:code
  350.    @ 19,00
  351.    @ 20,00
  352.    @ 21,00 SAY ' *************************************************************************'
  353.    @ 23,20 SAY 'Hit any key to Continue '
  354.    SET CONSOLE OFF
  355.    WAIT
  356.    SET CONSOLE ON
  357.   ENDI command = Y
  358.   RELE ALL
  359.   STOR t TO more
  360.  CASE command = 'I'
  361. * re-initialize index files
  362.   ERAS
  363.   @ 2,00 SAY 'We are going to index to all of the indexes and'
  364.   @ 3,00 SAY 'will keep you posted as we do it.'
  365.   @ 5,00 SAY 'Please be patient as this takes a little time...'
  366.   @ 7,00 SAY 'Records are now being re-indexed'
  367.   STOR CHR(PEEK(063)) TO dr
  368.   SET TALK ON
  369.   SET ECHO ON
  370.   SELE SECONDARY
  371.   USE &dr.:tenant
  372.   INDE on bcode to &dr.:codea
  373.   SELE PRIMARY
  374.   USE &dr.:build
  375.   INDE ON bcode TO &dr.:code
  376.   SET INDEX TO &dr.:code
  377.   SET TALK OFF
  378.   SET ECHO OFF
  379.  CASE command = '?'
  380.   ERAS
  381. TEXT
  382.  
  383.  
  384.        M A I N T E N A N C E   M E N U   H E L P   S C R E E N
  385.  
  386.  
  387. The maintenance menu allows you to work with both the building and the tenant
  388. databases.   Some of the options on this screen are exceedingly powerful  and
  389. should be used with care.
  390.  
  391. The browse command allows you to examine certain of the data in the files and
  392. make changes directly in the file.  Because of size limitations, you can only
  393. browse in the code, address and type fields in the building database  and  in
  394. the code, unit and tenant name fields in the tenant database.
  395.  
  396. The same type of space limitations apply in the display mode.  However, it is
  397. a simple, non-dangerous (and preferable) way to view multiple records. In the
  398. building mode  I display the code, the units, the type, the acquisition  date
  399. and part of the address. In the tenant mode I display the code, tenant,  type
  400. and tenant name.
  401.  
  402.  
  403.                 Please hit any key to continue........
  404. ENDT
  405.   SET CONSOLE OFF
  406.   WAIT
  407.   SET CONSOLE ON
  408.   ERAS
  409. TEXT
  410.  
  411. Purge deleted entries  -  this permanently removes from the file all entries
  412. marked for deletion and then reindexes the file. Use this carefully and only
  413. purge after you have made a backup of the file.
  414.  
  415. Backup data file - I hate to say this -  but computers goof and disks are so
  416. so delicate. ALWAYS ALWAYS ALWAYS never let a week go by without a backup  -
  417. so all you lose is one week (do it every day if you want).  This program can
  418. make an automatic backup of the data to another disk.    There should always   
  419. be another copy of the program and data, but backup is a convenient way for 
  420. an extra copy.
  421.  
  422. Reindex -  this is necessary if you are going to search for a file using the 
  423. search by index command. 
  424.  
  425. The first time initialization option has instructions. Basically, first time
  426. around run it to delete the sample files. The set name option refers to the
  427. name that appears on the top of the menu and on reports. You can change it
  428. anytime. Note, when going from dBASE version to another or from one operating
  429. system to another, you must delete memory variable files. These files are   
  430. MANAGE.DAT and CONAME.MEM. If deleted, the program will reinitialize itself.
  431.  
  432.              Please press any key to return to the menu......... 
  433. ENDT
  434.   SET CONSOLE OFF
  435.   WAIT
  436.   SET CONSOLE ON
  437.   ERAS
  438.  CASE (command = 'J' .OR. command = 'Q')
  439.   STOR f TO more
  440.  ENDC
  441. ENDD while more
  442. REST from manage.dat
  443. IF escap = 'N'
  444.  SET ESCAPE OFF
  445. ELSE
  446.  SET ESCAPE ON
  447. ENDI
  448. IF bright = 'A'
  449.  SET INTENSITY ON
  450. ELSE
  451.  SET INTENSITY OFF
  452. ENDI bright
  453. RELE ALL
  454. STOR 0 TO box
  455. STOR t TO first
  456. STOR t TO keepitup
  457. RETU
  458.