home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / OR_WAIT1.ZIP / WAIT.PPS < prev    next >
Text File  |  1995-01-04  |  4KB  |  100 lines

  1. ; Program      : WAIT prompt to replace PCBTEXT #418
  2. ; Version      : 1.00
  3. ; Programmer   : Siri\/s / Oriental Royal
  4. ; Fidonet addr.: 6:720/301
  5. ; BBS          : Sirius BBS
  6. ; Phone number : +886-2-961-0004, +886-2-962-9282
  7. ; Date         : 01/03/1995
  8. ; Description  : This PPS replace the PCBTEXT #418, and it can runs in
  9. ;                CTTY, ANSI, RIP.
  10. ;                Please feel free to modify the source code, that's why
  11. ;                the source code is included. If you do modify it,
  12. ;                Please don't distribute your version.
  13.  
  14. ; Declaration ----------------------------------------------------
  15. INTEGER    X_axis
  16. INTEGER    Y_axis
  17. INTEGER    Counter
  18. INTEGER    EA_Pos               ' Erase Arrow start position (X axis)
  19. STRING     KeyPress             ' The Key user press
  20. STRING     CR                   ' Carriage Return
  21. STRING     Windmill(3)          ' Store the symbol of Windmill
  22. STRING     Prompt               ' Prompt string
  23. STRING     FileExt              ' Language support, the extension of filename
  24. STRING     WaitTxt(3)           ' Store partial strin of prompt
  25. STRING     WaitCfg(5)           ' The configuration variable
  26.  
  27. ; Initialization -------------------------------------------------
  28. LET Counter = 1
  29. LET CR = CHR(13)
  30.  
  31. FOPEN 1,PPEPATH()+"WAIT.CFG",O_RD,S_DW
  32. FDEFIN 1
  33.  
  34. WHILE (Counter < 6) DO          ' Read the config file
  35.   FDGET WaitCfg(Counter)
  36.   INC Counter
  37. ENDWHILE
  38.  
  39. FCLOSE 1
  40.  
  41. LET FileExt = LANGEXT()         ' Read language file for prompt
  42. IF (EXIST(PPEPATH()+"WAITTXT"+LANGEXT())) THEN
  43.   FOPEN 3,PPEPATH()+"WAITTXT"+LANGEXT(),O_RD,S_DW
  44.   LET Counter = 1
  45.   WHILE (Counter < 5) DO
  46.     FGET 3,WaitTxt(Counter)
  47.     INC Counter
  48.   ENDWHILE
  49.   FCLOSE 3
  50. ELSE                            ' If language file not found, set default
  51.   LET WaitTxt(1) = "Press"
  52.   LET WaitTxt(2) = "Enter"
  53.   LET WaitTxt(3) = "to continue"
  54. ENDIF
  55.  
  56. LET Windmill(0) = "φ"
  57. LET Windmill(1) = "-"
  58. LET Windmill(2) = "\"
  59. LET Windmill(3) = "|"
  60. LET Prompt = " "+WaitCfg(4)+" "+WaitTxt(1)+" "+WaitCfg(5)+"["\
  61.              +WaitCfg(3)+WaitTxt(2)+WaitCfg(5)+"]"+WaitCfg(4)+" "\
  62.              +WaitTxt(3)+" "
  63.  
  64. ; Main Program ---------------------------------------------------
  65. IF (GRAFMODE() = "N") THEN      ' Detect user's ANSI capability
  66.   PRINT WaitTxt(1)+" ("+WaitTxt(2)+") "+WaitTxt(3)
  67.   END                           ' If No ANSI, end the program
  68. ELSE
  69.   PRINT Prompt
  70. ENDIF
  71.  
  72. LET X_axis = GETX()             ' Get cursor X, Y axis value after print prompt
  73. LET Y_axis = GETY()
  74. LET EA_Pos = X_axis+1           ' Set the Erase Arrow X axis next to right windmill
  75.  
  76. WHILE (KeyPress != CR) DO       ' If user didn't press enter
  77.   ANSIPOS 1,Y_axis              ' move cursor to the begin of prompt
  78.   PRINT WaitCfg(1)              ' set left windmill color
  79.   PRINT Windmill(3-Counter%4)   ' print left windmill
  80.   ANSIPOS X_axis,Y_axis         ' move cursor to the end of prompt
  81.   PRINT WaitCfg(2)              ' set right windmill color
  82.   PRINT Windmill(Counter%4)     ' print right windmill
  83.   DELAY 1                       ' Delay 1/18.2 sec.
  84.   INC Counter
  85.   LET KeyPress = INKEY()
  86. ENDWHILE
  87.  
  88. COLOR @X0C                      ' Set the arrow color to red
  89.  
  90. WHILE (EA_Pos >= 1) DO          ' While loop until the arrow reach the
  91.   ANSIPOS EA_Pos,Y_axis         ' begin of the prompt
  92.   PRINT CHR(174)+"- "           ' the space after dash is to to erase
  93.   DEC EA_Pos                    ' previous dash.
  94. ENDWHILE
  95.  
  96. DEFCOLOR                        ' Reset current color to default
  97. KBDSTUFF CR                     ' pass Enter to PCBoard
  98.  
  99. END
  100.