home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / pssst.zip / PSNONPRI.PRG < prev    next >
Text File  |  1986-07-16  |  5KB  |  168 lines

  1. * PSNONPRI.PRG
  2. *
  3. * A DBASE II 16BIT COMMAND FILE to allow viewing non-priority tasks
  4. * (assigned priority 0) with the option of assigning a priority, thereby
  5. * moving them to the 'priority list'
  6. *
  7. * Version 1
  8. * By LTC Denny Hugg
  9. * ANGSC/DOS Andrews AFB MD 16 Jul 1985
  10. *
  11. * Version 2
  12. * modified by Maj Jim McMurry
  13. * ANGSC/DOSC Truax Field, WI 15 Jun 1986
  14. *
  15. * --- indexed on priority
  16. ERASE
  17. STORE 'M O V E   N O N  -  P R I O R I T Y   I T E M S' TO heading
  18. DO PSHEADING
  19. USE &gsusfile
  20. * --- find out what the record number of the last one is
  21. DO WHILE priority = '0.00'
  22.    STORE # TO last
  23.    SKIP
  24. ENDDO
  25. USE &gsusfile INDEX &gpryindex
  26. * --- see if there are any non-priority items
  27. FIND 0
  28. IF # = 0
  29.    STORE 10 TO line
  30.    STORE 'You Have No Non-Priority Items ' +gfirstname TO prompt
  31.    DO PSPROMPT
  32.    STORE 12 TO line
  33.    STORE 'Returning To Priority Management Menu' TO prompt
  34.    DO PSPROMPT
  35.    STORE 0 TO timer
  36.    DO WHILE timer < gdelay
  37.       STORE timer + 1 TO timer
  38.    ENDDO
  39.    USE
  40.    RELEASE ALL EXCEPT g*
  41.    RETURN
  42. ELSE
  43.    * --- a timer to keep the heading up awhile
  44.    STORE 0 TO timer
  45.    DO WHILE timer < gdelay
  46.       STORE timer + 1 TO timer
  47.    ENDDO
  48. ENDIF
  49. GO TOP
  50. * --- we want to know if he moved any items to the priority list
  51. STORE 'N' TO flag
  52. DO WHILE T
  53.    STORE 0 TO counter
  54.    ERASE
  55.    STORE 1 TO line
  56.    STORE 'NON - PRIORITY ITEMS' TO prompt
  57.    DO PSPROMPT
  58.    @  4, 0 SAY 'Rec #        Description'
  59.    @  4,70 SAY 'Due Date'
  60.    @  5, 0 SAY gline
  61.    @  5,78 SAY ' '
  62.    * --- keep track of where we are in the file
  63.    STORE # TO firstshown
  64.    DO WHILE .NOT. EOF .AND. priority = '0.00' .AND. counter <15
  65.       * --- display 15 records at a time
  66.       DISPLAY '      ' + descrip +'  ' + duedate
  67.       SKIP
  68.       STORE counter + 1 TO counter
  69.    ENDDO
  70.    STORE '     ' TO select
  71.    @  0, 0 SAY gcuron
  72.    @ 22,79 SAY '  ';
  73.               +'Enter Record # Of Item To Move To Priority List ';
  74.               +'Or <RETURN> To Continue ';
  75.            GET select PICTURE '99999'
  76.    READ NOUPDATE
  77.    @  0, 0 SAY gcuroff
  78.    @ 22,79 SAY gclearline
  79.    IF select = '     '
  80.       * --- this is the only exit as we want him reviewing all non priorities
  81.       IF EOF .OR. priority <> '0.00'
  82.          ERASE
  83.          STORE 10 TO line
  84.          STORE 'Thats The End Of Your Non-Priority Items ';
  85.                  +gfirstname TO prompt
  86.          DO PSPROMPT
  87.          STORE 12 TO line
  88.          IF flag = 'N'
  89.             STORE 'Returning To Priority Management Menu' TO prompt
  90.          ELSE
  91.             STORE 'Proceeding To View Your Priorities' TO prompt
  92.          ENDIF
  93.          DO PSPROMPT
  94.          STORE 0 TO timer
  95.          DO WHILE timer < gdelay
  96.             STORE timer + 1 TO timer
  97.          ENDDO
  98.          IF flag = 'Y'
  99.             * --- let him look at the lineup
  100.             DO PSVIEWPR
  101.             RETURN
  102.          ELSE
  103.             RETURN
  104.          ENDIF
  105.       ELSE
  106.          * --- go back and display some more records
  107.          LOOP
  108.       ENDIF
  109.    ELSE
  110.       IF $(select,1,1) = ' '
  111.          * --- he added some leading space(s)
  112.          STORE 1 TO pointer
  113.          * --- locate the first non-empty character
  114.          DO WHILE $(select,pointer,1) = ' '
  115.             STORE pointer + 1 TO pointer
  116.          ENDDO
  117.          * --- get the non-empty characters
  118.          STORE $(select,pointer,LEN(select)-pointer + 1) TO select
  119.       ENDIF
  120.       * --- make it pretty for display purposes
  121.       STORE TRIM(select) TO recno
  122.       RELEASE select
  123.       STORE '0000' TO zeros
  124.       STORE $(zeros,1,5-LEN(recno)) + recno TO recno
  125.       * --- make sure he doesn't enter a bogus record number
  126.       * --- he can, however, pick from something other than that displayed 
  127.       * --- someday use an array of those records displayed to check this
  128.       IF VAL(recno) > last
  129.          @ 22,79 SAY gclearline
  130.          @ 22,79 SAY '                    ';
  131.                    + 'There Is No ' + recno + ' On The Non-Priority List'
  132.          STORE 1 TO timer
  133.          DO WHILE timer < gdelay
  134.             STORE timer + 1 TO timer
  135.          ENDDO
  136.          * --- re-display the records so he can figure it out
  137.          GO firstshown
  138.          LOOP
  139.       ENDIF
  140.       GO VAL(recno)
  141.       STORE '    ' TO mpriority
  142.       @ 22,79 SAY '             '+;
  143.                   'What Priority Would You Like To Assign Record '+recno+'? ';
  144.               GET mpriority PICTURE '9.99'
  145.       READ NOUPDATE
  146.       * --- add the 0's since it's a character field
  147.       STORE TRIM(mpriority) TO mpriority
  148.       IF mpriority = ' .'
  149.          STORE '0.00' TO mpriority
  150.       ELSE
  151.          STORE '00' TO zeros
  152.          STORE mpriority + $(zeros,1,4-LEN(mpriority)) TO mpriority
  153.       ENDIF
  154.       IF mpriority <> priority
  155.          REPLACE priority with mpriority
  156.          * --- he'll go to view next
  157.          STORE 'Y' TO flag
  158.          * --- we want to give him another chance at the earlier non-prio's
  159.          GO TOP
  160.       ELSE
  161.          * --- he dicked it up - redisplay it the same way
  162.          GO firstshown
  163.       ENDIF
  164.    ENDIF
  165. ENDDO T
  166. * EOF PSNONPRI.PRG
  167.  
  168.