home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / manage1.zip / ADDB.PRG < prev    next >
Text File  |  1986-05-30  |  21KB  |  717 lines

  1. **    Last revision: May 27, 1986 at 19:09
  2. * addb.prg
  3. STOR 'A' TO choice
  4. CLEA
  5. TEXT
  6.  
  7.     Welcome to the 'ADD' Menu.  We can now add new buildings to the
  8.     data file - or add new tenants to existing buildings already in
  9.     the data base.                                               
  10.                                                                        
  11.     Note that when you add a building, you will be given the option
  12.     of adding the tenants or the units at the same time.
  13.  
  14.           <A> add a new building                                    
  15.           <B> add tenants to a building already in the data base
  16.           <C> return to main menu without adding
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. ENDT
  29. @ 13,10 SAY 'How shall we proceed ? '
  30. @ 13,42 GET choice picture '!'
  31. READ
  32. DO WHIL AT(choice, 'ABC') = 0
  33.  @ 13,42 GET choice PICTURE '!'
  34.  READ
  35.  CLEA GETS
  36. ENDD while AT(choice)
  37. DO CASE
  38. CASE choice = 'A'
  39. * this program will add records to the current files
  40.  STOR .t. TO first
  41.  STOR .t. TO more
  42.  SET INTENSITY ON
  43.  SET DELIMITER OFF
  44.  DO WHIL more
  45. * set up screen for data entry
  46.   IF first
  47.    DO b_first
  48.    STOR .f. TO first
  49.   ENDI
  50.   STOR 'Add Building Records' TO mode
  51.   STOR 'First enter data about the building. You then will be able to' TO prompt1
  52.   STOR 'enter tenant data before you enter another building.' TO prompt2
  53.   STOR "To terminate session leave building blank and hit control 'Q'or 'W'" TO prompt3
  54. * get a set of default memory variables for data entry
  55.   STOR SPACE(50) TO blnks
  56.   STOR SUBSTR(blnks,1,35) TO mbaddr
  57.   STOR SUBSTR(blnks,1,2) TO mbcode
  58.   STOR SUBSTR(blnks,1,20) TO mbcity
  59.   STOR SUBSTR(blnks,1,2) TO mbst
  60.   STOR SUBSTR(blnks,1,5) TO mbzip
  61.   STOR SUBSTR(blnks,1,25) TO mbmgr
  62.   STOR SUBSTR(blnks,1,13) TO mbphone
  63.   STOR SUBSTR(blnks,1,2) TO mbtype
  64.   STOR SUBSTR(blnks,1,3) TO mbunit
  65.   STOR SUBSTR(blnks,1,8) TO mbacq
  66.   STOR 0 TO mbprice
  67.   STOR SUBSTR(blnks,1,35) TO mremit
  68.   STOR SUBSTR(blnks,1,13) TO mphone
  69.   STOR SUBSTR(blnks,1,35) TO mremitad
  70.   STOR SUBSTR(blnks,1,35) TO mremitc
  71.   STOR SUBSTR(blnks,1,50) TO mchecks
  72.   STOR SUBSTR(blnks,1,50) TO mbnotes
  73.   STOR DTOC(date()) TO mbupdate
  74. * let user enter data
  75.   @ 1,26 SAY mode
  76.   @ 3,10 GET mbaddr
  77.   @ 3,61 GET mbcode PICTURE '99'
  78.   @ 4,10 GET mbcity
  79.   @ 4,44 GET mbst PICTURE '!!'
  80.   @ 4,61 GET mbzip PICTURE '99999'
  81.   @ 6,10 GET mbmgr
  82.   @ 6,61 GET mbphone PICTURE '(999)999-9999'
  83.   @ 7,10 GET mbtype
  84.   @ 7,61 GET mbunit
  85.   @ 9,10 GET mbacq PICTURE '99/99/99'
  86.   @ 9,61 GET mbprice
  87.   @ 12,10 GET mremit
  88.   @ 12,61 GET mphone PICTURE '(999)999-9999'
  89.   @ 13,10 GET mremitad
  90.   @ 14,10 GET mremitc
  91.   @ 15,10 GET mchecks
  92.   @ 17,10 GET mbnotes
  93.   @ 18,61 GET mbupdate PICTURE '99/99/99'
  94.   @ 20, 4 SAY prompt1
  95.   @ 21, 4 SAY prompt2
  96.   @ 22, 4 SAY prompt3
  97.   READ
  98.   CLEA GETS
  99. * if a building was entered
  100. * add a new record with the entered data
  101.   IF mbaddr <> ' '
  102. * validation
  103. * this module validates added records
  104. * test if there is a bad field validation
  105.    DO CASE
  106.    CASE mbcode = ' '
  107. * no building code
  108.     STOR .t. TO error
  109.    OTHE
  110.     STOR .f. TO error
  111.    ENDC
  112. * if test for error was true then fix the fields that need fixing
  113.    IF error
  114. * erase the lines to be used for prompts
  115.     @ 01,00
  116.     @ 20,00
  117.     @ 21,00
  118.     @ 22,00
  119. * tell them to correct it
  120.     @ 1,18 SAY 'Please Correct the Indicated Data'
  121. * keep looping until all fields are fixed
  122.     STOR .t. to an_error
  123.     DO WHIL an_error
  124.      DO CASE
  125.      CASE mbcode = ' '
  126.       @ 20,15 SAY 'Must have a building code                              '
  127.       @ 03,61 GET mbcode PICTURE '99'
  128.       READ
  129.      OTHE
  130.       STOR .f. TO an_error
  131.      ENDC
  132.     ENDD while an:error
  133.    ENDI error
  134.    RELE error, an_error
  135.    SET DELIMITER ON
  136.    SET INTENSITY OFF
  137.    STOR 'N' TO command
  138.    @ 20,01 SAY SPACE(75)
  139.    @ 21,01 SAY SPACE(75)
  140.    @ 22,01 SAY SPACE(75)
  141.    @ 20,15 SAY 'Are there any more changes ?                        '
  142.    @ 20,48 GET command picture '!'
  143.    READ
  144.    SET DELIMITER OFF
  145.    SET INTENSITY ON
  146.    IF command = 'Y'
  147.     @ 1,00
  148.     @ 1,26 SAY mode
  149.     @ 3,10 GET mbaddr
  150.     @ 3,61 GET mbcode PICTURE '99'
  151.     @ 4,10 GET mbcity
  152.     @ 4,44 GET mbst PICTURE '!!'
  153.     @ 4,61 GET mbzip PICTURE '99999'
  154.     @ 6,10 GET mbmgr
  155.     @ 6,61 GET mbphone PICTURE '(999)999-9999'
  156.     @ 7,10 GET mbtype
  157.     @ 7,61 GET mbunit
  158.     @ 9,10 GET mbacq PICTURE '99/99/99'
  159.     @ 9,61 GET mbprice
  160.     @ 12,10 GET mremit
  161.     @ 12,61 GET mphone PICTURE '(999)999-9999'
  162.     @ 13,10 GET mremitad
  163.     @ 14,10 GET mremitc
  164.     @ 15,10 GET mchecks
  165.     @ 17,10 GET mbnotes
  166.     @ 18,61 GET mbupdate PICTURE '99/99/99'
  167.     @ 20,01 SAY SPACE(75)
  168.     @ 21,01 SAY SPACE(75)
  169.     @ 22,01 SAY SPACE(75)
  170.     @ 20,04 SAY prompt1
  171.     @ 21,04 SAY prompt2
  172.     @ 22,04 SAY prompt3
  173.     READ
  174.     CLEA GETS
  175.    ENDI command = 'Y'
  176. * add new record
  177.    APPE BLANK
  178.    REPL baddr WITH mbaddr, bcode WITH mbcode
  179.    REPL bcity WITH mbcity+mbst+mbzip
  180.    REPL bdata WITH mbmgr+mbphone+mbtype+mbunit+mbacq
  181.    REPL bprice WITH mbprice, remit WITH mremit, phone WITH mphone
  182.    REPL remitad WITH mremitad, remitc WITH mremitc
  183.    REPL checks WITH mchecks, bnotes with mbnotes, bupdate WITH mbupdate
  184.    RELE mbcity, mbst, mbzip, mbmgr, mbphone, mbtype, mbunit, mbacq
  185.    RELE mbprice, mremit, mphone, mremitad, mremitc
  186.    RELE mchecks, mbnotes, mode, prompt1, prompt2, prompt3
  187.    SELE B
  188.    USE &dr.:tenant
  189.    SET INDEX TO &dr.:codea
  190.    STOR .t. TO more1
  191.    STOR .t. TO first
  192.    CLEA
  193.    DO WHIL more1
  194.     IF first
  195.      DO t_first
  196.      STOR .f. TO first
  197.     ENDI
  198.     STOR 'Add Tenant Records' TO mode
  199.     STOR 'Enter as many tenants as you want. When done, enter a blank for tenant' TO prompt1
  200.     STOR "name and unit or control 'Q' or 'W' to end session." TO prompt2
  201.     STOR SUBSTR(blnks,1,35) TO mtenant
  202.     STOR SUBSTR(blnks,1,3) TO mtcode
  203.     STOR SUBSTR(blnks,1,5) to mtunit
  204.     STOR 'R' TO mttype
  205.     STOR SUBSTR(blnks,1,25) TO mtcontac
  206.     STOR SUBSTR(blnks,1,13) TO mtphone
  207.     STOR 'N' TO malt
  208.     STOR SUBSTR(blnks,1,35) TO maltad
  209.     STOR SUBSTR(blnks,1,35) TO maltcty
  210.     STOR SUBSTR(blnks,1,8) TO mtexpir
  211.     STOR SUBSTR(blnks,1,8) TO mtfirst
  212.     STOR 0 TO mtsec
  213.     STOR SUBSTR(blnks,1,4) TO mtsecb
  214.     STOR SUBSTR(blnks,1,2) TO mtlate
  215.     STOR 0 TO mtrent
  216.     STOR 0.0000 TO mtrentpc
  217.     STOR 0 TO mtrenpcr
  218.     STOR 0 TO mtlatec
  219.     STOR 0 TO mtaddl
  220.     STOR 0 TO mtrente
  221.     STOR 0 TO mtrentm
  222.     STOR 0 TO mtrentd
  223.     STOR SUBSTR(blnks,1,8) TO mtrentpd
  224.     STOR 0 TO mtrentp
  225.     STOR 0 TO mtrenty
  226.     STOR 0 TO mtrentt
  227.     STOR SUBSTR(blnks,1,8) TO mtflag
  228.     STOR SUBSTR(blnks,1,35) TO mtnotes
  229.     STOR mbupdate TO mtupdate
  230. * setup gets to read data
  231.     @ 1,26 SAY mode
  232.     @ 3,10 GET mtenant
  233.     @ 3,62 SAY mbcode
  234.     @ 3,64 GET mtcode PICTURE '999'
  235.     @ 4,10 GET mtunit
  236.     @ 4,36 SAY mbaddr
  237.     @ 5,10 GET mtcontac
  238.     @ 5,62 GET mtphone PICTURE '(999)999-9999'
  239.     @ 6,36 GET malt PICTURE '!'
  240.     @ 7,10 GET maltad
  241.     @ 8,10 GET maltcty
  242.     @ 10,10 GET mttype PICTURE '!'
  243.     @ 10,36 GET mtrentpc
  244.     @ 10,62 GET mtfirst PICTURE '99/99/99'
  245.     @ 11,10 GET mtrenpcr
  246.     @ 11,62 GET mtexpir PICTURE '99/99/99'
  247.     @ 12,10 GET mtsec
  248.     @ 12,36 GET mtsecb
  249.     @ 12,62 GET mtlate PICTURE '99'
  250.     @ 13,10 GET mtrent
  251.     @ 13,36 GET mtlatec
  252.     @ 13,62 GET mtaddl
  253.     @ 14,10 GET mtrente
  254.     @ 14,36 GET mtrentm
  255.     @ 15,10 GET mtrentd
  256.     @ 15,36 GET mtrentp PICTURE '99/99/99'
  257.     @ 15,62 GET mtrentp
  258.     @ 16,10 GET mtrenty
  259.     @ 16,36 GET mtflag PICTURE '99/99/99'
  260.     @ 16,62 GET mtrentt
  261.     @ 18,10 GET mtnotes
  262.     @ 18,61 GET mtupdate PICTURE '99/99/99'
  263.     @ 20,01 SAY SPACE(75)
  264.     @ 21,01 SAY SPACE(75)
  265.     @ 22,01 SAY SPACE(75)
  266.     @ 20, 7 SAY prompt1
  267.     @ 21, 7 SAY prompt2
  268.     READ
  269.     CLEA GETS
  270. * test if there is a bad field validation
  271.     IF mtenant <> ' '
  272. * validation
  273.      DO CASE
  274.      CASE mtcode = ' '
  275.       STOR .t. TO error
  276.      CASE .NOT.(malt = 'Y' .OR. malt = 'N')
  277.       STOR .t. TO error
  278.      CASE .NOT.(mttype = 'R'.OR.mttype='P'.OR. mttype='O')
  279.       STOR .t. TO error
  280.      CASE (mttype = 'P'.OR. mttype = 'O') .AND.(.NOT.(mtrentpc >0.AND. mtrenpcr >0))
  281.       STOR .t. TO error
  282.      OTHE
  283.       STOR .f. TO error
  284.      ENDC
  285. * if test for error was true then fix the fields that need fixing
  286.      IF error
  287. * erase the lines to be used for prompts
  288.       @ 01,00
  289.       @ 20,01 SAY SPACE(75)
  290.       @ 21,01 SAY SPACE(75)
  291.       @ 22,01 SAY SPACE(75)
  292. * tell them to correct it
  293.       @ 1,18 SAY 'Please Correct the Indicated Data'
  294. * keep looping until all fields are fixed
  295.       STOR .t. to an_error
  296.       DO WHIL an_error
  297.        DO CASE
  298.        CASE mtcode = ' '
  299.         @ 20,01 SAY SPACE(75)
  300.         @ 21,01 SAY SPACE(75)
  301.         @ 20,15 SAY 'Must have a tenant code                              '
  302.         @ 03,61 GET mtcode PICTURE '999'
  303.         READ
  304.        CASE .NOT.(malt = 'Y' .OR. malt = 'N')
  305.         @ 20,01 SAY SPACE(75)
  306.         @ 20,15 SAY "Must answer 'Y' or 'N' to alternate address"
  307.         @ 06,36 GET malt PICTURE '!'
  308.         READ
  309.        CASE .NOT.(mttype = 'R'.OR.mttype='P'.OR. mttype='O')
  310.         @ 20,01 SAY SPACE(75)
  311.         @ 21,01 SAY SPACE(75)
  312.         @ 20,05 SAY "Type must be 'R' for Regular, 'P' for Percentage which uses the higher of"
  313.         @ 21,05 SAY "the percentage or the base rent or 'O' for Overage plus base rent"
  314.         @ 10,10 GET mttype PICTURE '!'
  315.         READ
  316.        CASE (mttype = 'P'.OR. mttype = 'O').AND.(.NOT.(mtrentpc>0.AND. mtrenpcr> 0))
  317.         @ 20,01 SAY SPACE(75)
  318.         @ 21,01 SAY SPACE(75)
  319.         @ 20,05 SAY 'If a percentage or overage lease, you must state the percentage'
  320.         @ 21,05 SAY 'AND the base for calculating the percentage rent'
  321.         @ 10,36 GET mtrentpc
  322.         @ 11,10 GET mtrenpcr
  323.         READ
  324.        OTHE
  325.         STOR .f. TO an_error
  326.        ENDC
  327.       ENDD while an:error
  328.      ENDI error
  329. * give them another chance
  330.      SET DELIMITER ON
  331.      SET INTENSITY OFF
  332.      STOR 'N' TO command
  333.      @ 20,01 SAY SPACE(75)
  334.      @ 21,01 SAY SPACE(75)
  335.      @ 22,01 SAY SPACE(75)
  336.      @ 20,23 SAY 'Are there any more changes ?  '
  337.      @ 20,50 GET command picture '!'
  338.      READ
  339.      SET INTENSITY ON
  340.      SET DELIMITER OFF
  341.      IF command = 'Y'
  342.       @ 1,00
  343.       @ 1,26 SAY mode
  344.       @ 3,10 GET mtenant
  345.       @ 3,62 SAY mbcode
  346.       @ 3,64 GET mtcode PICTURE '999'
  347.       @ 4,10 GET mtunit
  348.       @ 4,36 SAY mbaddr
  349.       @ 5,10 GET mtcontac
  350.       @ 5,62 GET mtphone PICTURE '(999)999-9999'
  351.       @ 6,36 GET malt PICTURE '!'
  352.       @ 7,10 GET maltad
  353.       @ 8,10 GET maltcty
  354.       @ 10,10 GET mttype PICTURE '!'
  355.       @ 10,36 GET mtrentpc
  356.       @ 10,62 GET mtfirst PICTURE '99/99/99'
  357.       @ 11,10 GET mtrenpcr
  358.       @ 11,62 GET mtexpir PICTURE '99/99/99'
  359.       @ 12,10 GET mtsec
  360.       @ 12,36 GET mtsecb
  361.       @ 12,62 GET mtlate PICTURE '99'
  362.       @ 13,10 GET mtrent
  363.       @ 13,36 GET mtlatec
  364.       @ 13,62 GET mtaddl
  365.       @ 14,10 GET mtrente
  366.       @ 14,36 GET mtrentm
  367.       @ 15,10 GET mtrentd
  368.       @ 15,36 GET mtrentp PICTURE '99/99/99'
  369.       @ 15,62 GET mtrentp
  370.       @ 16,10 GET mtrenty
  371.       @ 16,36 GET mtflag PICTURE '99/99/99'
  372.       @ 16,62 GET mtrentt
  373.       @ 18,10 GET mtnotes
  374.       @ 18,61 GET mtupdate PICTURE '99/99/99'
  375.       @ 20,01 SAY SPACE(75)
  376.       @ 21,01 SAY SPACE(75)
  377.       @ 22,01 SAY SPACE(75)
  378.       @ 20, 7 SAY prompt1
  379.       @ 21, 7 SAY prompt2
  380. * let user enter data
  381.       READ
  382.       CLEA GETS
  383.      ENDI command = 'Y'
  384. * put data in file
  385.      APPE BLANK
  386.      STOR mbcode + mtcode TO mbcod1
  387.      REPL tenant WITH mtenant, bcode WITH mbcod1, tunit WITH mtunit
  388.      REPL baddr WITH mbaddr, tcontac WITH mtcontac, tphone WITH mtphone
  389.      REPL alt WITH malt, altad WITH maltad, altcty WITH maltcty
  390.      REPL ttype WITH mttype, texpir WITH mtexpir
  391.      REPL trentpc WITH mtrentpc, trentpcr WITH mtrenpcr
  392.      REPL tfirst WITH mtfirst, tsec WITH mtsec, tsecb WITH mtsecb
  393.      REPL tlate WITH mtlate, trent WITH mtrent, tlatec WITH mtlatec
  394.      REPL taddl WITH mtaddl, trente WITH mtrente, trentm WITH mtrentm
  395.      REPL trentd WITH mtrentd, trentpd WITH mtrentpd, trentp WITH mtrentp
  396.      REPL trenty WITH mtrenty, trentt WITH mtrentt, tflag WITH mtflag
  397.      REPL tnotes WITH mtnotes,tupdate WITH mtupdate
  398.      STOR .t. TO more1
  399.     ELSE
  400. * get ready to stop the loop
  401.      STOR .f. TO more1
  402.     ENDI mtenant <> ' '
  403.    ENDD WHILE more1
  404.    SET DELIMITER ON
  405.    SET INTENSITY OFF
  406.    SELE A
  407.    USE &dr.:build INDEX &dr.:code
  408.    STOR 'N' TO command
  409.    CLEA
  410.    @ 12,14 SAY "Do you want to add another building (Y/N) ? "
  411.    @ 12,59 GET command PICTURE '!'
  412.    READ
  413.    CLEA GETS
  414.    DO WHIL AT(command, 'YN') = 0
  415.     @ 12,59 GET command PICTURE '!'
  416.     READ
  417.     CLEA GETS
  418.    ENDD
  419.    DO CASE
  420.    CASE command = 'N'
  421.     STOR .f. TO more
  422.    CASE command  = 'Y'
  423.     STOR .t. TO more
  424.     STOR .t. TO first
  425.    ENDC
  426.   ELSE
  427.    STOR .f. TO more
  428.   ENDI mbaddr
  429.  ENDD WHILE MORE
  430.  SELE A
  431.  USE &dr.:build
  432.  SET INDEX TO &dr.:code
  433.  SET INTENSITY OFF
  434.  SET DELIMITER ON
  435. CASE choice = 'B'
  436.  STOR '99' TO findit
  437.  @ 13,00
  438.  @ 13,10 SAY 'What is the code number of the building (99 to quit) ? '
  439.  @ 13,65 GET findit PICTURE '99'
  440.  READ
  441.  IF findit = '99'
  442.   RETU
  443.  ENDI
  444.  SEEK findit
  445.  DO WHIL (EOF() .OR. BOF())
  446.   STOR '99' TO findit
  447.   @ 13,65 GET findit PICTURE '99'
  448.   READ
  449.   IF findit = '99'
  450.    RETU
  451.   ENDI
  452.   SEEK findit
  453.  ENDD
  454. * this program will add tenant records to the current files
  455.  SET DELIMITER OFF
  456.  SET INTENSITY ON
  457.  STOR SPACE(50) TO blnks
  458. * set up screen for data entry
  459. *loop until finished adding records
  460.  STOR baddr TO mbaddr
  461.  STOR bcode TO mbcode
  462.  STOR bupdate TO mbupdate
  463.  SELE B
  464.  USE &dr.:tenant
  465.  SET INDEX TO &dr.:codea
  466.  STOR .t. TO more
  467.  STOR .t. TO first
  468.  CLEA
  469.  DO WHIL more
  470.   IF first
  471.    DO t_first
  472.    STOR .f. TO first
  473.   ENDI
  474.   STOR 'Add Tenant Records' TO mode
  475.   STOR 'Enter as many tenants as you want. When done, enter a blank for tenant' TO prompt1
  476.   STOR "name and unit or control 'Q' or 'W' to end session." TO prompt2
  477.   STOR SUBSTR(blnks,1,35) TO mtenant
  478.   STOR SUBSTR(blnks,1,3) TO mtcode
  479.   STOR SUBSTR(blnks,1,5) to mtunit
  480.   STOR 'R' TO mttype
  481.   STOR SUBSTR(blnks,1,25) TO mtcontac
  482.   STOR SUBSTR(blnks,1,13) TO mtphone
  483.   STOR 'N' TO malt
  484.   STOR SUBSTR(blnks,1,35) TO maltad
  485.   STOR SUBSTR(blnks,1,35) TO maltcty
  486.   STOR SUBSTR(blnks,1,8) TO mtexpir
  487.   STOR SUBSTR(blnks,1,8) TO mtfirst
  488.   STOR 0 TO mtsec
  489.   STOR SUBSTR(blnks,1,4) TO mtsecb
  490.   STOR SUBSTR(blnks,1,2) TO mtlate
  491.   STOR 0 TO mtrent
  492.   STOR 0.0000 TO mtrentpc
  493.   STOR 0 TO mtrenpcr
  494.   STOR 0 TO mtlatec
  495.   STOR 0 TO mtaddl
  496.   STOR 0 TO mtrente
  497.   STOR 0 TO mtrentm
  498.   STOR 0 TO mtrentd
  499.   STOR SUBSTR(blnks,1,8) TO mtrentpd
  500.   STOR 0 TO mtrentp
  501.   STOR 0 TO mtrenty
  502.   STOR 0 TO mtrentt
  503.   STOR SUBSTR(blnks,1,8) TO mtflag
  504.   STOR SUBSTR(blnks,1,35) TO mtnotes
  505.   STOR mbupdate TO mtupdate
  506. * setup gets to read data
  507.   @ 1,00
  508.   @ 1,26 SAY mode
  509.   @ 3,10 GET mtenant
  510.   @ 3,62 SAY mbcode
  511.   @ 3,61 GET mtcode PICTURE '999'
  512.   @ 4,10 GET mtunit
  513.   @ 4,36 SAY mbaddr
  514.   @ 5,10 GET mtcontac
  515.   @ 5,62 GET mtphone PICTURE '(999)999-9999'
  516.   @ 6,36 GET malt PICTURE '!'
  517.   @ 7,10 GET maltad
  518.   @ 8,10 GET maltcty
  519.   @ 10,10 GET mttype PICTURE '!'
  520.   @ 10,36 GET mtrentpc
  521.   @ 10,62 GET mtfirst PICTURE '99/99/99'
  522.   @ 11,10 GET mtrenpcr
  523.   @ 11,62 GET mtexpir PICTURE '99/99/99'
  524.   @ 12,10 GET mtsec
  525.   @ 12,36 GET mtsecb
  526.   @ 12,62 GET mtlate PICTURE '99'
  527.   @ 13,10 GET mtrent
  528.   @ 13,36 GET mtlatec
  529.   @ 13,62 GET mtaddl
  530.   @ 14,10 GET mtrente
  531.   @ 14,36 GET mtrentm
  532.   @ 15,10 GET mtrentd
  533.   @ 15,36 GET mtrentp PICTURE '99/99/99'
  534.   @ 15,62 GET mtrentp
  535.   @ 16,10 GET mtrenty
  536.   @ 16,36 GET mtflag PICTURE '99/99/99'
  537.   @ 16,62 GET mtrentt
  538.   @ 18,10 GET mtnotes
  539.   @ 18,61 GET mtupdate PICTURE '99/99/99'
  540.   @ 20,00
  541.   @ 21,00
  542.   @ 22,00
  543.   @ 20, 7 SAY prompt1
  544.   @ 21, 7 SAY prompt2
  545.   READ
  546.   CLEA GETS
  547. * test if there is a bad field validation
  548.   IF mtenant <> ' '
  549. * validation
  550.    DO CASE
  551.    CASE mtcode = ' '
  552.     STOR .t. TO error
  553.    CASE .NOT.(malt = 'Y' .OR. malt = 'N')
  554.     STOR .t. TO error
  555.    CASE .NOT.(mttype = 'R'.OR.mttype='P'.OR. mttype='O')
  556.     STOR .t. TO error
  557.    CASE (mttype = 'P'.OR. mttype = 'O') .AND.(.NOT.(mtrentpc >0.AND. mtrenpcr >0))
  558.     STOR .t. TO error
  559.    OTHE
  560.     STOR .f. TO error
  561.    ENDC
  562. * if test for error was true then fix the fields that need fixing
  563.    IF error
  564. * erase the lines to be used for prompts
  565.     @ 01,00
  566.     @ 20,00
  567.     @ 21,00
  568.     @ 22,00
  569. * tell them to correct it
  570.     @ 1,18 SAY 'Please Correct the Indicated Data'
  571. * keep looping until all fields are fixed
  572.     STOR .t. to an_error
  573.     DO WHIL an_error
  574.      DO CASE
  575.      CASE mtcode = ' '
  576.       @ 20,00
  577.       @ 20,15 SAY 'Must have a tenant code                              '
  578.       @ 03,61 GET mtcode PICTURE '999'
  579.       READ
  580.      CASE .NOT.(malt = 'Y' .OR. malt = 'N')
  581.       @ 20,00
  582.       @ 20,15 SAY "Must answer 'Y' or 'N' to alternate address"
  583.       @ 06,36 GET malt PICTURE '!'
  584.       READ
  585.      CASE .NOT.(mttype = 'R'.OR.mttype='P'.OR. mttype='O')
  586.       @ 20,00
  587.       @ 21,00
  588.       @ 20,05 SAY "Type must be 'R' for Regular, 'P' for Percentage which uses the higher of"
  589.       @ 21,05 SAY "the percentage or the base rent or 'O' for Overage plus base rent"
  590.       @ 10,10 GET mttype PICTURE '!'
  591.       READ
  592.      CASE (mttype = 'P'.OR. mttype = 'O').AND.(.NOT.(mtrentpc>0.AND. mtrenpcr> 0))
  593.       @ 20,00
  594.       @ 21,00
  595.       @ 20,05 SAY 'If a percentage or overage lease, you must state the percentage'
  596.       @ 21,05 SAY 'AND the base for calculating the percentage rent'
  597.       @ 10,36 GET mtrentpc
  598.       @ 11,10 GET mtrenpcr
  599.       READ
  600.      OTHE
  601.       STOR .f. TO an_error
  602.      ENDC
  603.     ENDD while an:error
  604.    ENDI error
  605. * give them another chance
  606.    SET DELIMITER ON
  607.    SET INTENSITY OFF
  608.    STOR 'N' TO command
  609.    @ 20,00
  610.    @ 21,00
  611.    @ 22,00
  612.    @ 20,23 SAY 'Are there any more changes ?                        '
  613.    @ 20,50 GET command picture '!'
  614.    READ
  615.    SET DELIMITER OFF
  616.    SET INTENSITY ON
  617.    IF command = 'Y'
  618.     @ 1,00
  619.     @ 1,26 SAY mode
  620.     @ 3,10 GET mtenant
  621.     @ 3,62 SAY mbcode
  622.     @ 3,61 GET mtcode PICTURE '999'
  623.     @ 4,10 GET mtunit
  624.     @ 4,36 SAY mbaddr
  625.     @ 5,10 GET mtcontac
  626.     @ 5,62 GET mtphone PICTURE '(999)999-9999'
  627.     @ 6,36 GET malt PICTURE '!'
  628.     @ 7,10 GET maltad
  629.     @ 8,10 GET maltcty
  630.     @ 10,10 GET mttype PICTURE '!'
  631.     @ 10,36 GET mtrentpc
  632.     @ 10,62 GET mtfirst PICTURE '99/99/99'
  633.     @ 11,10 GET mtrenpcr
  634.     @ 11,62 GET mtexpir PICTURE '99/99/99'
  635.     @ 12,10 GET mtsec
  636.     @ 12,36 GET mtsecb
  637.     @ 12,62 GET mtlate PICTURE '99'
  638.     @ 13,10 GET mtrent
  639.     @ 13,36 GET mtlatec
  640.     @ 13,62 GET mtaddl
  641.     @ 14,10 GET mtrente
  642.     @ 14,36 GET mtrentm
  643.     @ 15,10 GET mtrentd
  644.     @ 15,36 GET mtrentp PICTURE '99/99/99'
  645.     @ 15,62 GET mtrentp
  646.     @ 16,10 GET mtrenty
  647.     @ 16,36 GET mtflag PICTURE '99/99/99'
  648.     @ 16,62 GET mtrentt
  649.     @ 18,10 GET mtnotes
  650.     @ 18,61 GET mtupdate PICTURE '99/99/99'
  651.     @ 20,00
  652.     @ 21,00
  653.     @ 22,00
  654.     @ 20, 7 SAY prompt1
  655.     @ 21, 7 SAY prompt2
  656. * let user enter data
  657.     READ
  658.     CLEA GETS
  659.    ENDI command = 'Y'
  660. * put data in file
  661.    APPE BLANK
  662.    STOR mbcode + mtcode TO mbcod1
  663.    REPL tenant WITH mtenant, bcode WITH mbcod1, tunit WITH mtunit
  664.    REPL baddr WITH mbaddr, tcontac WITH mtcontac, tphone WITH mtphone
  665.    REPL alt WITH malt, altad WITH maltad, altcty WITH maltcty
  666.    REPL ttype WITH mttype, texpir WITH mtexpir
  667.    REPL trentpc WITH mtrentpc, trentpcr WITH mtrenpcr
  668.    REPL tfirst WITH mtfirst, tsec WITH mtsec, tsecb WITH mtsecb
  669.    REPL tlate WITH mtlate, trent WITH mtrent, tlatec WITH mtlatec
  670.    REPL taddl WITH mtaddl, trente WITH mtrente, trentm WITH mtrentm
  671.    REPL trentd WITH mtrentd, trentpd WITH mtrentpd, trentp WITH mtrentp
  672.    REPL trenty WITH mtrenty, trentt WITH mtrentt, tflag WITH mtflag
  673.    REPL tnotes WITH mtnotes,tupdate WITH mtupdate
  674.    STOR .t. TO more
  675.   ELSE
  676. * get ready to stop the loop
  677.    STOR .f. TO more
  678.   ENDI mtenant <> ' '
  679.  ENDD WHILE more
  680.  SELE A
  681.  USE &dr.:build
  682.  SET index TO &dr.:code
  683.  SET DELIMITER ON
  684.  SET INTENSITY OFF
  685. CASE choice = '?'
  686.  CLEA
  687.  TEXT
  688.  
  689.  
  690.                   A D D   M E N U   H E L P   S C R E E N
  691.  
  692.  
  693.       The options are rather simple.  In a normal case you would add a 
  694.       building and at the same time add all of the units. (Add them even
  695.       if vacant - just leave the tenant name blank - so that it will 
  696.       appear on the vacancy list).
  697.  
  698.       When a unit becomes vacant - we suggest you not delete the record
  699.       - but that you delete the name of the tenant. Note, however, the
  700.       automatic rent posting program will post the rental to the unit - 
  701.       so you will have to make an offsetting journal entry for vacancy 
  702.       losses.  Most people do that anyway.
  703.  
  704.       However, if you want to add a tenant who was never in the data base
  705.       you have that option on this menu.
  706.  
  707.  
  708.                           Press any key to continue 
  709.  
  710.  ENDT
  711. CASE choice = 'C'
  712.  STOR .t. TO first
  713.  RETU
  714. ENDC
  715. RETU
  716. 
  717.