home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / propmgr2.zip / ADD.ACG < prev    next >
Text File  |  1986-09-03  |  7KB  |  271 lines

  1. * DATE 08/27/84  12:57
  2. * add.prg
  3. STOR CHR(PEEK(063)) TO dr
  4. SET INDEX TO
  5. ERAS
  6. STOR t TO first
  7. STOR t TO more
  8. DO WHIL more
  9.  IF first
  10.   STOR 'Add Records Module' TO mode
  11.   STOR 'Enter as many records as you want.' TO prompt1
  12.   STOR 'When done, enter blank for last name' TO prompt2
  13.   STOR 'Or Control (CODE) Q to end session' TO prompt3
  14.   @ 1,25 SAY mode
  15.   @ 2, 0 SAY "+---------------------------------------"
  16.   @ 2,39 SAY "---------------------------------------+"
  17.   @ 3, 3 SAY "Lastname"
  18.   @ 3,46 SAY "First & MI"
  19.   @ 4, 5 SAY "Spouse"
  20.   @ 4,46 SAY "Address as"
  21.   @ 6, 6 SAY "Title"
  22.   @ 7, 1 SAY "Company #1"
  23.   @ 8, 9 SAY "#2"
  24.   @ 9, 0 SAY "Co. Address"
  25.   @ 9,51 SAY "Suite"
  26.   @ 10, 7 SAY "City"
  27.   @ 10,36 SAY "ST"
  28.   @ 10,53 SAY "Zip"
  29.   @ 12, 2 SAY "Home Addr"
  30.   @ 12,53 SAY "Apt"
  31.   @ 13, 7 SAY "City"
  32.   @ 13,36 SAY "ST"
  33.   @ 13,53 SAY "Zip"
  34.   @ 14, 2 SAY "Telephone  Office"
  35.   @ 14,46 SAY "Home phone"
  36.   @ 15, 1 SAY "Salutation"
  37.   @ 15,42 SAY "Send to office"
  38.   @ 16, 3 SAY "Codes 1-"
  39.   @ 16,20 SAY "2-"
  40.   @ 16,31 SAY "3-"
  41.   @ 16,42 SAY "4-"
  42.   @ 16,54 SAY "5-"
  43.   @ 16,65 SAY "6-"
  44.   @ 17,50 SAY "Update"
  45.   @ 18, 0 SAY "+---------------------------------------"
  46.   @ 18,39 SAY "---------------------------------------+"
  47.   @ 19,12 SAY prompt1
  48.   @ 20,12 SAY prompt2
  49.   @ 21,12 SAY prompt3
  50.  ENDI first
  51.  STOR f TO first
  52.  STOR '                                   ' TO BLNKS
  53.  STOR $(blnks,1,25) TO mlastname
  54.  STOR $(blnks,1,20) TO mfname
  55.  STOR $(blnks,1,15) TO mspouse
  56.  STOR $(blnks,1,14) TO mmr
  57.  STOR blnks TO mtitle
  58.  STOR blnks TO mcompany1
  59.  STOR blnks TO mcompany2
  60.  STOR blnks TO mcaddress
  61.  STOR $(blnks,1,10) TO msuite
  62.  STOR $(blnks,1,20) TO mccity
  63.  STOR $(blnks,1,2) TO mcst
  64.  STOR $(blnks,1,5) TO mczip
  65.  STOR blnks TO maddress
  66.  STOR $(blnks,1,10) TO mapt
  67.  STOR $(blnks,1,20) TO mcity
  68.  STOR $(blnks,1,2) TO mst
  69.  STOR $(blnks,1,5) TO mzip
  70.  STOR $(blnks,1,13) TO mophone
  71.  STOR $(blnks,1,13) TO mphone
  72.  STOR $(blnks,1,22) TO mdear
  73.  STOR $(blnks,1,1) TO msend
  74.  STOR $(blnks,1,3) TO mcs1
  75.  STOR $(blnks,1,3) TO mcs2
  76.  STOR $(blnks,1,3) TO mcs3
  77.  STOR $(blnks,1,3) TO mcs4
  78.  STOR $(blnks,1,3) TO mcs5
  79.  STOR $(blnks,1,3) TO mcs6
  80.  STOR $(blnks,1,8) TO mupdate
  81.  IF $(DATE(),1,2) <> '00' .AND. mupdate =  '  '
  82.   STOR DATE() to mupdate
  83.  ENDI
  84.  @ 1,74 SAY #
  85.  @ 3,12 GET mlastname
  86.  @ 3,57 GET mfname
  87.  @ 4,12 GET mspouse
  88.  @ 4,57 GET mmr
  89.  @ 6,12 GET mtitle
  90.  @ 7,12 GET mcompany1
  91.  @ 8,12 GET mcompany2
  92.  @ 9,12 GET mcaddress
  93.  @ 9,57 GET msuite
  94.  @ 10,12 GET mccity
  95.  @ 10,40 GET mcst picture '!!'
  96.  @ 10,57 GET mczip picture '99999'
  97.  @ 12,12 GET maddress
  98.  @ 12,57 GET mapt
  99.  @ 13,12 GET mcity
  100.  @ 13,40 GET mst picture '!!'
  101.  @ 13,57 GET mzip picture '99999'
  102.  @ 14,20 GET mophone picture '(999)999-9999'
  103.  @ 14,57 GET mphone picture '(999)999-9999'
  104.  @ 15,12 GET mdear
  105.  @ 15,57 GET msend picture '!'
  106.  @ 16,12 GET mcs1 PICTURE '!!!'
  107.  @ 16,23 GET mcs2 PICTURE '!!!'
  108.  @ 16,34 GET mcs3 PICTURE '!!!'
  109.  @ 16,45 GET mcs4 PICTURE '!!!'
  110.  @ 16,57 GET mcs5 PICTURE '!!!'
  111.  @ 16,68 GET mcs6 PICTURE '!!!'
  112.  @ 17,57 GET mupdate picture '99/99/99'
  113.  READ
  114.  CLEA GETS
  115.  IF mlastname <> ' '
  116.   DO CASE
  117.   CASE mfname = ' '
  118.    STOR t TO error
  119.   CASE mmr = ' '
  120.    STOR t TO error
  121.   CASE mdear = ' '
  122.    STOR t TO error
  123.   CASE .NOT. (msend = 'Y' .OR. msend = 'N')
  124.    STOR t TO error
  125.   OTHE
  126.    STOR f TO error
  127.   ENDC
  128.   IF error
  129.    @ 01,00
  130.    @ 19,00
  131.    @ 20,00
  132.    @ 21,00
  133.    @ 1,18 SAY 'Please Correct the Indicated Data'
  134.    STOR t to an:error
  135.    DO WHIL an:error
  136.     DO CASE
  137.     CASE mfname = ' '
  138.      @ 20,15 SAY 'Must add a First Name                                  '
  139.      @ 03,57 GET mfname
  140.      READ
  141.     CASE mmr = ' '
  142.      @ 20,15 SAY 'Must have Mr. or Miss. etc                             '
  143.      @ 04,57 GET mmr
  144.      READ
  145.     CASE mdear = ' '
  146.      @ 20,15 SAY 'Must have a salutation for Dear.....                   '
  147.      @ 15,12 GET mdear
  148.      READ
  149.     CASE .NOT. (msend = 'Y' .OR. msend = 'N')
  150.      @ 20,15 SAY 'Must answer "Y" or "N" to send letter to office   '
  151.      @ 15,57 GET msend picture '!'
  152.      READ
  153.     OTHE
  154.      STOR f TO an:error
  155.     ENDC
  156.    ENDD while an:error
  157.    STOR 'N' TO command
  158.    @ 20,15 SAY 'Are there any more changes ?                        '
  159.    @ 20,48 GET command picture '!'
  160.    READ
  161.    IF command = 'Y'
  162.     @ 3,12 GET mlastname
  163.     @ 3,57 GET mfname
  164.     @ 4,12 GET mspouse
  165.     @ 4,57 GET mmr
  166.     @ 6,12 GET mtitle
  167.     @ 7,12 GET mcompany1
  168.     @ 8,12 GET mcompany2
  169.     @ 9,12 GET mcaddress
  170.     @ 9,57 GET msuite
  171.     @ 10,12 GET mccity
  172.     @ 10,40 GET mcst PICTURE '!!'
  173.     @ 10,57 GET mczip picture '99999'
  174.     @ 12,12 GET maddress
  175.     @ 12,57 GET mapt
  176.     @ 13,12 GET mcity
  177.     @ 13,40 GET mst PICTURE '!!'
  178.     @ 13,57 GET mzip picture '99999'
  179.     @ 14,20 GET mophone picture '(999)999-9999'
  180.     @ 14,57 GET mphone picture '(999)999-9999'
  181.     @ 15,12 GET mdear
  182.     @ 15,57 GET msend picture '!'
  183.     @ 16,12 GET mcs1 PICTURE '!!!'
  184.     @ 16,23 GET mcs2 PICTURE '!!!'
  185.     @ 16,34 GET mcs3 PICTURE '!!!'
  186.     @ 16,45 GET mcs4 PICTURE '!!!'
  187.     @ 16,57 GET mcs5 PICTURE '!!!'
  188.     @ 16,68 GET mcs6 PICTURE '!!!'
  189.     @ 17,57 GET mupdate picture '99/99/99'
  190.     READ
  191.     CLEA GETS
  192.    ENDI command = 'Y'
  193.    STOR 'Add Records Module' TO mode
  194.    STOR 'Enter as many records as you want.' TO prompt1
  195.    STOR 'When done, enter blank for last name' TO prompt2
  196.    STOR 'Or Control (CODE)  Q to end session' TO prompt3
  197.    @ 01,00
  198.    @ 19,00
  199.    @ 20,00
  200.    @ 21,00
  201.    @ 1,27 SAY mode
  202.    @ 19,12 SAY prompt1
  203.    @ 20,12 SAY prompt2
  204.    @ 21,12 SAY prompt3
  205.   ENDI error
  206.   APPE BLANK
  207.   REPL lastname WITH mlastname, fname WITH mfname
  208.   REPL spouse WITH mspouse, mr WITH mmr
  209.   REPL title WITH mtitle, company1 WITH mcompany1
  210.   REPL company2 WITH mcompany2, caddress WITH mcaddress
  211.   REPL suite WITH msuite, ccity WITH mccity
  212.   REPL cst WITH mcst, czip WITH mczip
  213.   REPL address WITH maddress, apt WITH mapt
  214.   REPL city WITH mcity, st WITH mst
  215.   REPL zip WITH mzip, ophone WITH mophone
  216.   REPL phone WITH mphone, dear WITH mdear
  217.   REPL send with msend
  218.   REPL cs1 WITH mcs1, cs2 WITH mcs2
  219.   REPL cs3 WITH mcs3, cs4 WITH mcs4
  220.   REPL cs5 WITH mcs5, cs6 WITH mcs6
  221.   REPL update WITH mupdate
  222.   REPL new WITH t
  223.   STOR t TO more
  224.  ELSE
  225.   STOR f TO more
  226.  ENDI there is an empty record
  227. ENDD while more
  228. STOR 'Y' TO command
  229. ERAS
  230. TEXT
  231.  
  232.  
  233.  
  234.      The  newly added RECORDS will  NOT appear to in the files until they are
  235.      RE-INDEXED and this will take some time......        
  236.  
  237.      You may re-index now or by using Maintenance Menu Function number 7.
  238.  
  239.      If you do decide to index, I will keep you posted as I go along, but you
  240.      will have to be patient.
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253. ENDT
  254. @ 10,10 SAY  'Do you wish to RE-INDEX records NOW (Y/N)'
  255. @ 10,52 GET   command PICTURE '!'
  256. READ
  257. IF command = 'Y'
  258.  STOR CHR(PEEK(063)) TO dr
  259.  SET INDEX TO &dr.:lastname
  260.  SET ECHO ON
  261.  SET TALK ON
  262.  REIN
  263.  SET TALK OFF
  264.  SET ECHO OFF
  265. ELSE
  266.  STOR CHR(PEEK(063)) TO dr
  267.  SET INDEX TO &dr.:lastname
  268. ENDI command = Y
  269. RELE ALL
  270. STOR t TO first
  271.