home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1997 #3 / amigamamagazinepolishissue03-1 / spisy / siec / amil / amil_contrib.rexx < prev    next >
OS/2 REXX Batch file  |  1992-09-02  |  5KB  |  268 lines

  1. /*
  2. **-----------------------------------------
  3. ** 
  4. ** AMIL_Contrib.rexx
  5. **
  6. ** Contribute entries for AMIL.guide
  7. **
  8. ** © 1996 Tassos Hadjithomaoglou
  9. **
  10. **-----------------------------------------
  11. ** $VER: AMIL_Contrib.rexx V0.2 (14-Sep-96)
  12. **-----------------------------------------
  13. **
  14. ** History
  15. **
  16. **  0.1 First release.
  17. **  0.2 AmigaGuide keywords removed. They were confusing while editing.
  18. **      Header text removed. Not really needed.
  19. **
  20. **------------------------------------------------------------------------
  21. */
  22.  
  23. /*
  24. ** Path for Editor
  25. **
  26. ** Enter here the full path of an Editor of your choice.
  27. ** That's the only thing you should change.
  28. ** PS: The Editor should be able to run in SYNCHRONOUS mode
  29. */
  30.  
  31. Editor = 'C:Ed'
  32.  
  33.  
  34. /*
  35. ** Please don't change anything after this line
  36. **----------------------------------------------
  37. */
  38.  
  39. OPTIONS RESULTS
  40.  
  41. SIGNAL ON BREAK_C
  42. SIGNAL ON SYNTAX
  43.  
  44. TRUE=1
  45. FALSE=0
  46.  
  47. NL='0A'X
  48.  
  49. /*
  50. ** Check for argument, else ask for one
  51. */
  52.  
  53. FromAMIL = TRUE
  54.  
  55. PARSE ARG project
  56.  
  57. IF project = '' THEN
  58. DO
  59.     FromAMIL = FALSE
  60.  
  61.    SAY NL'Please choose a project to fill form for : 'NL
  62.     SAY ' 1. Persons/People'
  63.     SAY ' 2. Companies'
  64.     SAY ' 3. Dealers'
  65.     SAY ' 4. Groups/Teams'
  66.     SAY ' 5. BBS'
  67.     SAY ' 6. Mailing Lists'
  68.     SAY ' 7. Newsgroups'
  69.     SAY ' 8. Zines'
  70.     SAY '10. WWW Resources'NL
  71.  
  72.    PARSE PULL project
  73.    IF project = '' THEN
  74.    DO
  75.       SAY 'Contribution abandoned !!!'
  76.       EXIT 0
  77.    END
  78. END
  79.  
  80. project = UPPER(project)
  81.  
  82. /*
  83. ** Footer Text
  84. */
  85.  
  86. ContribText_Footer=NL'*** mailto : chatasos@cs.teiath.gr ***'NL
  87.  
  88. /*
  89. ** Contribution Texts
  90. */
  91.  
  92. ContribText_Persons='Persons/People'NL ||,
  93. NL ||,
  94. 'Person Name'NL ||,
  95. ' Company  : 'NL ||,
  96. ' E-Mail   : 'NL ||,
  97. ' WWW      : 'NL ||,
  98. ' IRC      : 'NL ||,
  99. ' Fidonet  : 'NL ||,
  100. ' Notes    : 'NL ||,
  101. ' Projects : 'NL
  102.  
  103.  
  104. ContribText_Companies='Companies'NL ||,
  105. NL ||,
  106. 'Company Name'NL ||,
  107. ' E-Mail     : 'NL ||,
  108. ' FTP        : 'NL ||,
  109. ' WWW        : 'NL ||,
  110. ' Fidonet    : 'NL ||,
  111. ' Activities : 'NL ||,
  112. ' Products   : 'NL
  113.  
  114.  
  115. ContribText_Dealers='Dealers/Vendors'NL ||,
  116. NL ||,
  117. 'Dealer Name'NL ||,
  118. ' E-Mail   : 'NL ||,
  119. ' FTP      : 'NL ||,
  120. ' WWW      : 'NL ||,
  121. ' Fidonet  : 'NL ||,
  122. ' Products : 'NL
  123.  
  124.  
  125. ContribText_Groups='Groups/Teams'NL ||,
  126. NL ||,
  127. 'Group Name'NL ||,
  128. ' E-Mail     : 'NL ||,
  129. ' FTP        : 'NL ||,
  130. ' WWW        : 'NL ||,
  131. ' Fidonet    : 'NL ||,
  132. ' Activities : 'NL ||,
  133. ' Projects   : 'NL
  134.  
  135.  
  136. ContribText_BBS='BBS'NL ||,
  137. NL ||,
  138. 'BBS Name'NL ||,
  139. ' Sysop    : 'NL ||,
  140. ' E-Mail   : 'NL ||,
  141. ' FTP      : 'NL ||,
  142. ' WWW      : 'NL ||,
  143. ' Telnet   : 'NL ||,
  144. ' Fidonet  : 'NL ||,
  145. ' Amiganet : 'NL ||,
  146. ' Notes    : 'NL ||,
  147. ' Lines    : 'NL
  148.  
  149.  
  150. ContribText_Mailing='Mailing Lists'NL ||,
  151. NL ||,
  152. 'Mailing List Name'NL ||,
  153. ' E-Mail      : 'NL ||,
  154. ' SubscribeAd : 'NL ||,
  155. ' SubscribeCm : 'NL ||,
  156. ' Mail        : 'NL ||,
  157. ' FTP         : 'NL ||,
  158. ' Notes       : 'NL
  159.  
  160.  
  161. ContribText_Newsgroups='Newsgroups'NL ||,
  162. NL ||,
  163. 'Newsgroup Name'NL ||,
  164. ' News      : 'NL ||,
  165. ' Notes     : 'NL ||,
  166. ' Moderator : 'NL
  167.  
  168.  
  169. ContribText_Zines='Zines'NL ||,
  170. NL ||,
  171. 'Zine Name'NL ||,
  172. ' E-Mail : 'NL ||,
  173. ' WWW    : 'NL ||,
  174. ' Editor : 'NL
  175.  
  176.  
  177. ContribText_WWW='WWW Resources'NL ||,
  178. NL ||,
  179. 'WWW Resource Name'NL ||,
  180. ' E-Mail : 'NL ||,
  181. ' WWW    : 'NL ||,
  182. ' Notes  : 'NL
  183.  
  184.  
  185. /*
  186. ** Open the Contrib_file and 
  187. ** write the right ContribText_* to it
  188. */
  189.  
  190. bool1=OPEN(Contrib_file,'T:AMIL_Contrib.txt',W)
  191.  
  192. SELECT
  193.     WHEN project='1' THEN DO
  194.         WRITELN(Contrib_file,ContribText_Persons)
  195.     END
  196.     WHEN project='2' THEN DO
  197.         WRITELN(Contrib_file,ContribText_Companies)
  198.     END
  199.     WHEN project='3' THEN DO
  200.         WRITELN(Contrib_file,ContribText_Dealers)
  201.     END
  202.     WHEN project='4' THEN DO
  203.         WRITELN(Contrib_file,ContribText_Groups)
  204.     END
  205.     WHEN project='5' THEN DO
  206.         WRITELN(Contrib_file,ContribText_BBS)
  207.     END
  208.     WHEN project='6' THEN DO
  209.         WRITELN(Contrib_file,ContribText_Mailing)
  210.     END
  211.     WHEN project='7' THEN DO
  212.         WRITELN(Contrib_file,ContribText_Newsgroups)
  213.     END
  214.     WHEN project='8' THEN DO
  215.         WRITELN(Contrib_file,ContribText_Zines)
  216.     END
  217.     WHEN project='10' THEN DO
  218.         WRITELN(Contrib_file,ContribText_WWW)
  219.     END
  220.     OTHERWISE DO
  221.         bool1=CLOSE(Contrib_file)
  222.         ADDRESS COMMAND 'Delete T:AMIL_Contrib.txt QUIET'
  223.         SAY 'Wrong choice !!!'
  224.         EXIT
  225.     END
  226. END
  227.  
  228. WRITELN(Contrib_file,ContribText_Footer)
  229.  
  230. bool1=CLOSE(Contrib_file)
  231.  
  232. ADDRESS COMMAND Editor 'T:AMIL_Contrib.txt'
  233.  
  234. IF ~FromAMIL THEN
  235. DO
  236.     SAY NL'Contribution finished...'NL
  237.     SAY 'Use your favorite mail program to open the file T:AMIL_Contrib.txt'
  238.     SAY 'and send the contribution to me.'NL
  239. END
  240.  
  241. EXIT 0
  242.  
  243. /*
  244. ** End of ARexx script
  245. */
  246.  
  247.  
  248. /*
  249. ** Handle the Error condition
  250. */
  251.  
  252. SYNTAX:
  253.     bool1=CLOSE(Contrib_file)
  254.     ADDRESS COMMAND 'Delete T:AMIL_Contrib.txt QUIET'
  255.     SAY 'Error at line' SIGL ':' ERRORTEXT(RC)
  256.     SAY 'Please report it to the author'
  257.     EXIT
  258.  
  259. /*
  260. ** Handle the Control C command given by the user
  261. */
  262.  
  263. BREAK_C:
  264.     bool1=CLOSE(Contrib_file)
  265.     ADDRESS COMMAND 'Delete T:AMIL_Contrib.txt QUIET'
  266.     SAY 'Contribution aborted...'
  267.     EXIT
  268.