home *** CD-ROM | disk | FTP | other *** search
/ Carsten's PPE Collection / Carstens_PPE_Collection_2007.zip / S / SENDFIL1.ZIP / SENDFILE.PPS < prev    next >
Text File  |  1995-08-01  |  4KB  |  155 lines

  1. ;PPE to offer the user to flag files for downloading from a text file.
  2. ;Can also be run as a PPE to offer specific file choices.
  3. ;
  4. ;Needs <ppename>.cfg to hold the names of files to prompt
  5. ;The CFG file (SENDFILE.CFG) contains a header entry of 5 lines and
  6. ;entries for each file consisting of 5 lines each:
  7. ;
  8. ;
  9. ;DISPLAY1=line to display as a header - include even if blank
  10. ;DISPLAY2=line to display as a header - include even if blank
  11. ;DISPLAY3=line to display as a header - include even if blank
  12. ;DISPLAY4=line to display as a header - include even if blank
  13. ;DISPLAY5=line to display as a header - include even if blank
  14. ;FILE1_line1=FILENAME
  15. ;FILE1_line2=FULL PATH TO FILE (E:\PCB\UPLOAD\) WITH TRAILING BACKSLASH
  16. ;FILE1_line3=DESCRIPTION LINE 1 (even if blank)
  17. ;FILE1_line4=DESCRIPTION LINE 2 (even if blank)
  18. ;FILE1_line5=DESCRIPTION LINE 3 )even if blank)
  19. ;FILE2_line1=FILENAME
  20. ;FILE2_line2=FULL PATH TO FILE (E:\PCB\UPLOAD\) WITH TRAILING BACKSLASH
  21. ;FILE2_line3=DESCRIPTION LINE 1 (even if blank)
  22. ;FILE2_line4=DESCRIPTION LINE 2 (even if blank)
  23. ;FILE2_line5=DESCRIPTION LINE 3 )even if blank)
  24. ;Repeat for each file
  25. ;
  26. ;
  27. ;For example:
  28. ;Contents of SENDFILE.CFG to prompt for three files:
  29. ;@X1C------------------------------------------------------------------------------
  30. ;@X1F@BOARDNAME:79C@
  31. ;@X1F                                   File Helper
  32. ;@X1C------------------------------------------------------------------------------
  33. ;
  34. ;BGI20.ZIP
  35. ;E:\PCB\DL03\
  36. ;"The Beginner's Guide to the Internet" is a full-color, computer-based
  37. ;tutorial about the Internet. It covers E-mail, ftp, telnet, gopher,
  38. ;Archie, Veronica, WAIS, World Wide Web, newsgroups, mailing lists, etc.
  39. ;INTEMAIL.ZIP
  40. ;E:\PCB\DL03\
  41. ;How to do almost anything on the Internet using only E-Mail! This
  42. ;special report will show you how to retrieve files from FTP sites,
  43. ;Gopher, Archie, Veronica, WAIS, World-Wide Web and more.
  44. ;ISFQ1194.ZIP
  45. ;E:\PCB\DL03\
  46. ;alt.internet.services frequently asked questions as of 11-21-94 -
  47. ;downloaded from rtfm.mit.edu in /pub/usenet/alt.internet.services
  48. ;Much useful information.
  49. ;
  50. ;NO COMMENT LINES ARE ALLOWED IN THE  CFG FILE!
  51. ;
  52. ;
  53. ;To use in multiple instances, just use a different name for the PPE and
  54. ;the CFG file.  They must be the same, but you can use any name you want.
  55. ;
  56. ;To prompt a user to flag files from a bulletin, new file or amy text file
  57. ;just insert a line with a "!" and the full path to SENDFILE.PPE (or whatever
  58. ;you have named it) where you want the user prompted:
  59. ;
  60. ;!e:\pcb\ppe\sendfile.ppe
  61. ;
  62. ;No headers or PPE description/menu lines are shown.  The user sees:
  63. ;
  64. ;Flag <filename> for downloading (Y/N):
  65. ;
  66. ;If the answer is Y, the user sees:
  67. ;
  68. ;*****<filename> flagged for later downloading.
  69. ;
  70. ;Questions or comments should be sent to:
  71. ;elizabeth.copper@daycal.cts.com
  72. ;or you can call Daily Calendar BBS
  73. ;in Coronado, CA at 619-435-2687.
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. INTEGER i ;LINE NUMBER IN CFG FILE
  81. STRING fname, fpath, desc1, desc2, desc3  ;LINE CONTENTS IN CFG FILE
  82. STRING h1, h2, h3, h4, h5  ;HEADER LINES
  83. STRING answer
  84.  
  85. FOPEN 1, PPEPATH()+PPENAME()+".CFG",O_RD,S_DW
  86. IF (FERR(1)) THEN
  87.    LET fname = "Error opening file "+PPEPATH()+PPENAME()+".CFG"
  88.    PRINTLN fname
  89.    END
  90. ENDIF
  91. FDEFIN 1
  92.  
  93. FDGET h1
  94. INC i
  95. FDGET h2
  96. INC i
  97. FDGET h3
  98. INC i
  99. FDGET h4
  100. INC i
  101. FDGET h5
  102. INC i
  103.  
  104. IF (!LEN(TRIM(h1," "))=0) THEN
  105.         PRINTLN h1
  106. ENDIF
  107. IF (!LEN(TRIM(h2," "))=0) THEN
  108.         PRINTLN h2
  109. ENDIF
  110. IF (!LEN(TRIM(h3," "))=0) THEN
  111.         PRINTLN h3
  112. ENDIF
  113. IF (!LEN(TRIM(h4," "))=0) THEN
  114.         PRINTLN h4
  115. ENDIF
  116. IF (!LEN(TRIM(h5," "))=0) THEN
  117.         PRINTLN h5
  118. ENDIF
  119.  
  120. WHILE (!FERR(1)) DO
  121.    FDGET fname
  122.    INC i
  123.    FDGET fpath
  124.    INC i
  125.    FDGET desc1
  126.    INC i
  127.    FDGET desc2
  128.    INC i
  129.    FDGET desc3
  130.  
  131.    IF (!LEN(TRIM(fname," "))=0) THEN
  132.            LET answer = YESCHAR()
  133.            PRINTLN "@X1C"+fname
  134.            PRINTLN "@X1C"+desc1
  135.            PRINTLN "@X1C"+desc2
  136.            PRINTLN "@X1C"+desc3
  137.            NEWLINE
  138.  
  139.            INPUTSTR "Flag "+fname+" for downloading (Y/N): ",answer,@X1F,1,"YyNn",YESNO+AUTO
  140.            NEWLINE
  141.            IF (LEN(TRIM(answer," "))=0) THEN
  142.               END
  143.            ENDIF
  144.            IF (UPPER(answer)="Y") THEN
  145.               FLAG fpath+fname
  146.               PRINTLN "@X1F*****"+fname+" flagged for later downloading."
  147.               NEWLINE
  148.            ENDIF
  149.    ENDIF
  150.    INC i
  151. ENDWHILE
  152. FCLOSE 1
  153. END
  154.  
  155.