home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / pssst.zip / PSEDITS.PRG < prev    next >
Text File  |  1986-08-14  |  7KB  |  210 lines

  1. * PSEDITS.PRG
  2. *
  3. * A DBASE II 16BIT COMMAND FILE to allow input or creation of
  4. * filename, and select from the major branches of the PSSST system.
  5. *
  6. * Version 1
  7. * By LTC Denny Hugg
  8. * ANGSC/DOS Andrews AFB MD 16 Jul 1985
  9. *
  10. * Version 2
  11. * modified by Maj Jim McMurry
  12. * ANGSC/DOSC Truax Field, WI 15 Jun 1986
  13. *
  14. ERASE
  15. * --- both indexes active in case due date or priority changed
  16. USE &gsusfile
  17. GO BOTTOM
  18. STORE # TO last
  19. IF last = 0
  20.    ERASE
  21.    STORE 10 TO line
  22.    STORE 'You Have Nothing In Your Suspense File '+gfirstname TO prompt
  23.    DO PSPROMPT
  24.    STORE 0 TO counter
  25.    DO WHILE counter < gdelay
  26.       STORE counter + 1 TO counter
  27.    ENDDO
  28.    RELEASE ALL EXCEPT g*
  29.    RETURN
  30. ENDIF
  31. * --- we want both indexes updated in case those two fields are edited
  32. * --- and certainly in the case records are completed or deleted
  33. USE &gsusfile INDEX &gsusindex, &gpryindex
  34. STORE 'N' TO needpack
  35. GO TOP
  36. DO WHILE T
  37.    STORE 0 TO counter
  38.    CLEAR GETS
  39.    ERASE
  40. * --- uses selection from psjobtrk menu to branch to appropriate module
  41.    DO CASE
  42.       CASE gc=3
  43.          STORE 'LISTING SUSPENSE ITEMS FOR EDIT' TO heading
  44.       CASE gc=5
  45.          STORE 'LISTING SUSPENSE ITEMS FOR COMPLETION' TO heading
  46.       CASE gc=7
  47.          STORE 'LISTING SUSPENSE ITEMS FOR DELETION' TO heading
  48.    ENDCASE
  49.    DO PSHEADING
  50.    @  5, 0 SAY 'Rec#     Description'
  51.    @  5,70 SAY 'Due Date'
  52.    @  6, 0 SAY gline
  53.    @  6,78 SAY ' '
  54.    STORE # TO firstshown
  55. * --- display 14 records at a time
  56.    DO WHILE .NOT. EOF .AND. counter < 14
  57.       IF *
  58.          SKIP
  59.       ELSE
  60.          DISPLAY '  ' + descrip, + '     '+ duedate
  61.          SKIP
  62.          STORE counter + 1 TO counter
  63.       ENDIF
  64.    ENDDO
  65.    STORE '     ' TO select
  66.    @  0, 0 SAY gcuron
  67.    @ 22,79 SAY '              ';
  68.              + 'Enter Record To Work On Or <Return> To Continue ';
  69.            GET select PICTURE '99999'
  70.    READ NOUPDATE
  71.    @ 0, 0 SAY gcuroff
  72.    @ 22,79 SAY gclearline
  73.    IF select = '     '
  74.       * --- this is the only exit as we want him reviewing all suspenses
  75.       IF EOF
  76.          ERASE
  77.          STORE 10 TO line
  78.          STORE 'Thats The End Of Your Records '+gfirstname;
  79.                +' Returning To JobTrack' TO prompt
  80.          DO PSPROMPT
  81.          IF needpack = 'N'
  82.             STORE 0 TO timer
  83.             DO WHILE timer < gdelay
  84.                STORE timer + 1 TO timer
  85.             ENDDO
  86.          ELSE
  87. * --- don't need a timer as pack takes awhile
  88.             PACK
  89.          ENDIF
  90.          USE
  91.          RELEASE ALL EXCEPT g*
  92.          RETURN
  93.       ELSE
  94. * --- go back and display some more records
  95.          LOOP
  96.       ENDIF
  97.    ELSE
  98.       IF $(select,1,1) = ' '
  99.          * --- he added some leading space(s)
  100.          STORE 1 TO pointer
  101.          * --- locate the first non-empty character
  102.          DO WHILE $(select,pointer,1) = ' '
  103.             STORE pointer + 1 TO pointer
  104.          ENDDO
  105.          * --- get the non-empty characters
  106.          STORE $(select,pointer,LEN(select)-pointer + 1) TO select
  107.       ENDIF
  108.       RELEASE pointer
  109.       * --- we may use this if the record doesn't exist
  110.       STORE TRIM(select) TO temp
  111. * --- make the record number a standard length for display
  112.       STORE temp TO select
  113.       STORE '0000' TO zeros
  114.       STORE $(zeros,1,5-LEN(select)) + select TO select
  115.       STORE VAL(select) TO recno
  116.       RELEASE zeros
  117.    ENDIF
  118. * --- make sure he doesn't enter a bogus record number
  119.    IF recno > last
  120.       @ 22,79 SAY gclearline
  121.       * --- temp2 is still the string version of recno
  122.       @ 22,79 SAY '                        ';
  123.                 + 'There Is No ' + temp + ' In Your Database'
  124.       STORE 1 TO timer
  125.       DO WHILE timer < gdelay
  126.          STORE timer + 1 TO timer
  127.       ENDDO
  128.       @ 22, 79 SAY gclearline
  129.       RELEASE  temp
  130.       GO firstshown
  131.       LOOP
  132.    ENDIF
  133.    RELEASE select
  134.    GO recno
  135.    DO CASE
  136.       CASE gc = 3
  137.          ERASE
  138.          STORE 2 TO line
  139.          STORE 'E D I T   S U S P E N S E   I T E M S' TO prompt
  140.          DO PSPROMPT
  141.          @  0, 0 SAY gcuron
  142.          @  5, 0 SAY 'Description ';
  143.                  GET  descrip
  144.          @  7, 1 SAY 'Origin ';
  145.                  GET  origin picture '!!!!!!!!'
  146.          @  7,29 SAY 'Priority  .'
  147.          @  7,38 GET  priority PICTURE '9.99'
  148.          @  7,53 SAY 'Date Received   /  /'
  149.          @  7,67 GET  in:date PICTURE '99/99/99'
  150.          @  9, 4 SAY 'Due   /  /'
  151.          @  9, 8 GET  duedate PICTURE '99/99/99'
  152.          @  9,34 SAY 'OPR ';
  153.                  GET  opr PICTURE '!!!!'
  154.          @  9,57 SAY 'Phone    -   -'
  155.          @  9,63 GET  phone PICTURE '999-999-9999'
  156.          @ 11, 0 SAY 'Remarks ';
  157.                  GET  rem1
  158.          @ 12, 8 GET  rem2
  159.          @ 13, 8 GET  rem3
  160.          @ 14, 8 GET  rem4
  161.          @ 15, 8 GET  rem5
  162.          @ 16, 8 GET  rem6
  163.          @ 17, 8 GET  rem7
  164.          @ 18, 8 GET  rem8
  165.          @ 19, 8 GET  rem9
  166.          @ 20, 8 GET  rem10
  167.          @ 21, 8 GET  rem11
  168.          @ 22, 8 GET  rem12
  169.          READ
  170.          @ 0, 0 SAY gcuroff
  171.          * --- test descrip for presence of a semi-colon then get rid of it
  172.          * --- by replacing it with a space.  semi-colons really screw up the
  173.          * --- printouts, so it's worth the time.
  174.          * --- trap out a semi-colon in the last column
  175.          IF $(descrip,55,1) = ';'
  176.             STORE $(descrip,1,54) TO half1
  177.             REPLACE descrip WITH half1
  178.          ENDIF
  179.          * --- trap out a semi-colon in the first column
  180.          IF $(descrip,1,1) = ';'
  181.             STORE $(descrip,2,55) TO half1
  182.             REPLACE descrip WITH half1
  183.          ENDIF
  184.          * --- trap out any semi-colons in between
  185.          STORE 1 TO pointer
  186.          DO WHILE pointer < 56
  187.             IF $(descrip,pointer,1) = ';'
  188.                STORE $(descrip,1,pointer-1) TO half1
  189.                STORE $(descrip,pointer+1,55-pointer) TO half2
  190.                REPLACE descrip WITH half1 + ' ' + half2
  191.             ENDIF
  192.             STORE pointer + 1 TO pointer
  193.          ENDDO
  194.          * --- redisplay the list of records just as they were unless we
  195.          *     changed the first record displayed
  196.          IF # <> firstshown
  197.             GO firstshown
  198.          ELSE
  199.             GO TOP
  200.          ENDIF
  201.       CASE gc = 5
  202.          RELEASE  select, zeros
  203.          DO PSCOMPLT
  204.       CASE gc = 7
  205.          RELEASE  select, zeros
  206.          DO PSDELETE
  207.    ENDCASE
  208. ENDDO T
  209. * EOF PSEDITS.PRG
  210.