home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PCBOARD / PAUSEPPE.ZIP / PAUSE.PPS < prev    next >
Text File  |  1994-02-12  |  3KB  |  71 lines

  1. ;***********************************************************************
  2. ;*                                                                     *
  3. ;*                           PAUSE.PPE V1.00                           *
  4. ;*                                                                     *
  5. ;*                        written by: Gary Meeker                      *
  6. ;*                                                                     *
  7. ;*                            started: 02-12-94                        *
  8. ;*                                                                     *
  9. ;***********************************************************************
  10.  
  11. STRING  Key           ' Keystroke char
  12. STRING  FileName      ' Filename to Display
  13. STRING  ProgressChar  ' Progress Character String
  14. BYTE    MaxCount      ' Length of Progress Character String
  15. BYTE    Count         ' Progress Character Counter
  16. BYTE    Chars         ' Number of Characters to display
  17. SWORD   Pause         ' Wait Pause (0 = infinite, Negative = PAUSE only)
  18. BOOLEAN NoKey         ' Don't allow [ENTER] to exit the pause
  19. BOOLEAN Stuff         ' Flag to show we need a CR stuffed
  20.  
  21. ProgressChar = CHR(8)+"\"+CHR(8)+"|"+CHR(8)+"/"+CHR(8)+"-"
  22. MaxCount = LEN(ProgressChar)
  23. Count = 9              ' Start on '-'
  24. Chars = 1              ' Just display 1 character
  25.  
  26. GETTOKEN Pause         ' Get the maximum time to pause
  27. GETTOKEN FileName      ' Get the Prompt to display
  28.  
  29. NoKey = (Pause < 0)    ' If negative, then no exit.
  30. Pause = ABS(Pause) * 6 ' Make sure it's positive and counting 1/6 secs.
  31.  
  32. IF (Pause = 0) LET Pause = 720  ' Maximum time 2 minutes (120 Secs * 6)
  33.  
  34. 'If no filename or special filename is given then use the default and
  35. ' indicate we need to stuff a CR into the keyboard buffer so we can
  36. ' replace PCBTEXT #418 with our PPE.
  37.  
  38. IF ((FileName="") | (FileName="!")) THEN
  39.    IF (FileName="!") LET Stuff = TRUE
  40.    FileName = PPEPATH()+PPENAME()
  41. END IF
  42.  
  43. 'Display the prompt file
  44. IF (EXIST(FileName)) DISPFILE FileName, LANG+SEC+GRAPH
  45.  
  46. Key = INKEY()                           ' Get a Keypress from the user
  47.  
  48. WHILE (NoKey | (Key<>CHR(13))) DO       ' Exit when we get an ENTER
  49.                                         '   unles NoKey
  50.    PRINT MID(ProgressChar, Count, Chars)' Show our progress
  51.    Chars = 2                            ' Now show 2 chars from here on
  52.    Count = Count + 2                    ' Point to next progress char.
  53.    IF (Count > MaxCount) LET Count = 1  ' Loop back to 1st character
  54.  
  55.    DELAY 3                              ' Delay 1/6 a second
  56.    DEC Pause                            ' Decrement our delay
  57.    IF (Pause = 0) BREAK                 '   If 0, we are done
  58.  
  59.    Key = INKEY()                        ' Get a Keypress if present
  60.    WHILE (Key<>"") DO                   ' Read any keys until none left
  61.       IF (Key = CHR(13)) BREAK          ' If we got a RETURN we are done
  62.       Key = INKEY()                     '    else Get Another Keypress
  63.    END WHILE                            '
  64. END WHILE
  65.  
  66. PRINT CHR(13)                           ' Back to start of line
  67. CLREOL                                  ' Clear the Prompt
  68. KEYFLUSH                                ' Clear the Keyboard
  69. IF (Stuff) KBDSTUFF CHR(13)             ' Stuff a CR if needed
  70. END
  71.