home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
pssst.zip
/
PSVIEWPR.PRG
< prev
Wrap
Text File
|
1986-07-16
|
7KB
|
231 lines
* PSVIEWPR.PRG
*
* A DBASE II 16BIT COMMAND FILE to allow viewing tasks in order of
* priority and forcing a choice between duplicate priorities. Suspense
* items may be removed from, or relocated on the priority list.
* This was the first shot at forcing elimination of duplicates, but it
* seemed too slow when there were a lot of them. This is designed to
* be used now after they've been ordered with PSREORDR, however, it
* still catches duplicates
*
* Version 1
* By LTC Denny Hugg
* ANGSC/DOS Andrews AFB MD 16 Jul 1985
*
* Version 2
* modified by Maj Jim McMurry
* ANGSC/DOSC Truax Field, WI 15 Jun 1986
*
ERASE
STORE 'V I E W P R I O R I T Y I T E M S' TO heading
DO PSHEADING
USE &gsusfile
GO BOTTOM
STORE # TO last
IF last = 0
STORE 10 TO line
STORE 'You Have No Suspense Items To Prioritize ' + gfirstname TO prompt
DO PSPROMPT
STORE 12 TO line
STORE 'Returning To Priority Management Menu' TO prompt
DO PSPROMPT
STORE 0 TO timer
DO WHILE TIMER < gdelay
STORE timer + 1 TO timer
ENDDO
USE
RELEASE ALL EXCEPT g*
RETURN
ENDIF
* --- indexed on priority
USE &gsusfile INDEX &gpryindex
STORE 10 TO line
STORE 'You May Remove Items From The Priority List' TO prompt
DO PSPROMPT
STORE 12 TO line
STORE 'By Assigning Them Priority 0.00' TO prompt
DO PSPROMPT
STORE 0 TO timer
DO WHILE timer < gdelay
STORE timer + 1 TO timer
ENDDO
DO WHILE T
* --- wish I could get past the 0's quicker without moving them
* --- out of the file. That would be slower anyway
* --- this needs to stay in the loop as this procedure can be
* --- quite dynamic. Shouldn't have many 0 priorities anyway
IF priority = '0.00'
SKIP
LOOP
ENDIF
IF EOF
* --- there's nobody home (anymore?)
@ 9, O SAY gclearline
@ 10, 0 SAY gclearline
@ 11, 0 SAY gclearline
@ 12, 0 SAY gclearline
@ 13, 0 SAY gclearline
STORE 10 TO line
STORE 'You Have No Priorities To Analyze ' + gfirstname TO prompt
DO PSPROMPT
STORE 12 TO line
STORE 'Returning To Priority Management Menu' TO prompt
DO PSPROMPT
STORE 0 TO timer
DO WHILE timer < gdelay
STORE timer + 1 TO timer
ENDDO
USE
RELEASE ALL EXCEPT g*
RETURN
ENDIF
STORE 'N' TO needchange
STORE 0 TO counter
CLEAR GETS
ERASE
STORE 1 TO line
STORE 'VIEWING PRIORITIES' TO prompt
DO PSPROMPT
@ 4, 0 SAY 'Rec # Prio Description'
@ 4,70 SAY 'Due Date'
@ 5, 0 SAY gline
@ 5,78 SAY ' '
STORE # TO firstshown
DO WHILE .NOT. EOF .AND. counter < 15
DISPLAY priority + ' ' + descrip + ' ' + duedate
STORE priority TO oldrecord
SKIP
STORE counter + 1 TO counter
* --- flags us if any two records on the screen are the same priority
* --- but we'll only do it when necessary
IF needchange = 'N'
IF .NOT. EOF .AND. counter < 15
STORE priority to newrecord
IF oldrecord = newrecord
STORE 'Y' TO needchange
ENDIF
ENDIF
ENDIF
ENDDO
STORE ' ' TO select
@ 0, 0 SAY gcuron
IF needchange = 'Y'
@ 22,79 SAY ' ';
+'You Have Duplicate Priorities ... Enter Record # To Change ';
GET select PICTURE '99999'
ELSE
@ 22,79 SAY ' ';
+'Enter # Of Priority To Change Or <RETURN> To Continue ';
GET select PICTURE '99999'
ENDIF
READ NOUPDATE
@ 0, 0 SAY gcuroff
@ 22,79 SAY gclearline
IF select = ' '
* --- this is the only exit as we want him reviewing all priorities
IF EOF
ERASE
STORE 10 TO line
STORE 'Thats The End Of Your Records '+gfirstname TO prompt
DO PSPROMPT
STORE 12 TO line
STORE 'Returning To Priority Management Menu' TO prompt
DO PSPROMPT
STORE 0 TO timer
DO WHILE timer < gdelay
STORE timer + 1 TO timer
ENDDO
USE
RELEASE ALL EXCEPT g*
RETURN
ELSE
* --- a priority for everything and everything in it's priority
IF needchange = 'Y'
@ 22,79 SAY ' ';
+"You've Still Got Duplicates ..."
STORE 0 TO timer
DO WHILE timer < gdelay
STORE timer + 1 TO timer
ENDDO
GO firstshown
LOOP
ENDIF
* --- display the last item from the previous display in case
* --- it and the next item were duplicates
SKIP -1
LOOP
ENDIF
ELSE
IF $(select,1,1) = ' '
* --- he added some leading space(s)
STORE 1 TO pointer
* --- locate the first non-empty character
DO WHILE $(select,pointer,1) = ' '
STORE pointer + 1 TO pointer
ENDDO
* --- get the non-empty characters
STORE $(select,pointer,LEN(select)-pointer + 1) TO select
ENDIF
STORE TRIM(select) TO recno
* --- make the record number a standard length for display
STORE '0000' TO zeros
STORE $(zeros,1,5-LEN(recno)) + recno TO recno
ENDIF
* --- make sure he doesn't enter a bogus record number
IF VAL(recno) > last
@ 22,79 SAY gclearline
@ 22,79 SAY ' ';
+ 'There Is No ' + recno + ' In Your Database'
STORE 1 TO timer
DO WHILE timer < gdelay
STORE timer + 1 TO timer
ENDDO
GO firstshown
LOOP
ENDIF
GO VAL(recno)
STORE ' ' TO mpriority
@ 0, 0 SAY gcuron
@ 22,79 SAY ' '+;
'The Present Priority is '+priority+' ... Enter New Priority ';
GET mpriority PICTURE '9.99'
READ NOUPDATE
@ 0, 0 SAY gcuroff
STORE TRIM(mpriority) TO mpriority
IF mpriority = ' .' .OR. mpriority = '0.' .OR. mpriority = '0.0'
STORE '0.00' TO mpriority
ELSE
STORE '00' TO zeros
STORE mpriority + $(zeros,1,4-LEN(mpriority)) TO mpriority
ENDIF
IF mpriority <> priority
REPLACE priority with mpriority
* --- go back to beginning in case he made a low priority a high one
GO TOP
ELSE
@ 22,79 SAY gclearline
@ 22,79 SAY ' ';
+"That's The Same Priority ... Try Again"
* --- redisplay the list of records just as they were
STORE 0 TO timer
DO WHILE timer < gdelay
STORE timer + 1 TO timer
ENDDO
GO firstshown
ENDIF
ENDDO T
* EOF PSVIEWPR.PRG
IP -1
LOOP
ENDIF
ELSE
IF $(select,1,1) = ' '
* --- he added some leading space(s)
STORE 1 TO pointer
* --- locate the first non-empty character
DO WHILE $(select,pointer,1) = ' '
STORE pointer + 1 TO pointer
ENDDO
* --- get the non-empty characters