home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / mr2i201.zip / NEWSUTIL.CMD < prev    next >
OS/2 REXX Batch file  |  1997-07-01  |  6KB  |  223 lines

  1. /*
  2.     MR/2 ICE - MSGUTIL.CMD
  3.  
  4.     Copyright (c) 1996, Nick Knight
  5.     All Rights Reserved.
  6.  
  7.     Author:     Nick Knight
  8.     Created:    03/03/96
  9.     Usage:        msgutil subcommand MessageFile
  10.     Purpose:    msgutil.cmd allows for special processing of message
  11.                 files.    It is called from within MR/2 ICE, passed a
  12.                 subcommand based on the Fkey used to invoke it (F1 == 1,
  13.                 F12 = 12) and the current message file name.
  14.     US Mail:    Nick Knight, PO Box 22366, Beachwood, Ohio 44122
  15.     Fidonet:    1:157/2 or 1:/157/200
  16.     Internet:    nick@secant.com
  17.     Compuserve: 76066,1240
  18.     BBS:        Private messages on Nerd's Nook (216) 356-1772 or 1872
  19.  
  20. ** Major Update: 04/16/96, gutted/rewritten using wonderful examples by:
  21.    
  22.    Author.........:  Jason Gottschalk, Internet: os2@tir.com
  23.    Date Written...:  March 15, 1996
  24.  
  25. */
  26. /*
  27. $MENUMAP
  28.     1:Detach files using external utilities
  29.     2:Edit the file with E.EXE
  30.     3:View embedded HTML via Web Browser
  31. $END
  32. */
  33.  
  34. /* USER SELECTABLE OPTIONS */
  35.  
  36. /* if set to 0, Ctrl-F1 will NOT attempt to load viewer */
  37. EnableMimeViewers = 1       
  38.  
  39. Editor = 'e'
  40. Browser = 'netscape.exe'
  41. BitmapViewer = 'ib.exe'
  42. AviViewer = 'vb.exe'
  43. WavPlayer = 'ab.exe'
  44. INFViewer = 'view.exe'
  45. MPGViewer = 'pmmpeg.exe'
  46.  
  47. env = 'OS2ENVIRONMENT'    /* Access environment init variables */
  48.  
  49. /**********************************************************************/
  50. /**   Parameter Section - Message Information Passed from MR/2 ICE     **/
  51. /**********************************************************************/
  52. /* The section below is COMMENTED OUT to save resources.  If you      */
  53. /* wish to use one or more of these variables, just uncomment them      */
  54. /**********************************************************************/
  55. /*
  56.  
  57. Subject     = value("MR2I.SUBJECT",,env)
  58. ReplyTo     = value("MR2I.REPLYTO",,env)
  59. ToName        = value("MR2I.TO",,env)
  60. FromName    = value("MR2I.FROM",,env)
  61. MessageID    = value("MR2I.MESSAGE-ID",,env)
  62. InReplyTo    = value("MR2I.IN-REPLY-TO",,env)
  63. Editor        = value("MR2I.EDITOR",,env)
  64. SerialNumber= value("MR2I.SERIALNUMBER",,env)
  65. CurrLine    = value("MR2I.CURRENTLINE",,env)
  66. CurrColumn    = value("MR2I.CURRENTCOLUMN",,env)
  67.  
  68. Browser     = value("MR2I.BROWSER",,env)
  69. FTPClient    = value("MR2I.FTPCLIENT",,env)
  70. CurrentWord = value("MR2I.CURRENTWORD",,env)
  71. Account     = value("MR2I.ACCOUNT",,env)
  72. Version     = value("MR2I.VERSION",,env)
  73.  
  74. MarkedBlock = value("MR2I.CURRENTBLOCK",,env)
  75. */
  76.  
  77. /*
  78.    NOTE that if markedBlock = "@rexx$txt.tmp", then the block was
  79.    too big to pass in the environment, and it was instead saved to
  80.    the file "rexx@txt.tmp".
  81. */     
  82.  
  83. /**********************************************************************/
  84.  
  85.  
  86. Signal on Syntax        /* Setup event handlers */
  87. Signal on Halt
  88. Signal on Novalue
  89.                        
  90.                        /* Include OS/2 Rexx utilities */
  91.  
  92. if RxFuncQuery('SysLoadFuncs') then
  93.    do
  94.       call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  95.       call SysLoadFuncs
  96.    end
  97.  
  98.  
  99.                            /* Run through some standard setup */
  100.  
  101. '@echo off'               /* turn off display of OS/2 commands */
  102. crlf='0d0a'x              /* Set Carriage Return with LineFeed */
  103.  
  104.  
  105. parse value SysCurPos() with row col   /* Get current cursor position */
  106.  
  107. CMDLineArgs = translate(arg(1))        /* Snag everything from the command line */
  108.  
  109. esc  = '1b'x    /* ESC character */
  110. P = esc'[35m'   /* ANSI.SYS-control for purple foreground */
  111. r = esc'[31m'   /* ANSI.SYS-control for red foreground */
  112. g = esc'[32m'   /* ANSI.SYS-control for green foreground */
  113. y = esc'[33m'   /* ANSI.SYS-control for yellow foreground */
  114. cy = esc'[36m'  /* ANSI.SYS-control for cyan foreground */
  115. wh = esc'[0m'   /* ANSI.SYS-control for resetting attributes to normal */
  116. bl = esc'[5m'   /* ANSI.SYS-control for blinking */
  117. hl = esc'[1m'   /* ANSI.SYS-control for highlight */
  118.  
  119.  
  120. FKey = 0
  121. FHandled = 0
  122.  
  123. parse value CMDLineArgs with FKey filename
  124.  
  125. select
  126.   when FKey = 1 then
  127.   do
  128.     nop
  129.   end
  130.   
  131.   when FKey = 2 then
  132.   do
  133.     nop
  134.   end
  135.  
  136.   when FKey = 3 then
  137.   do
  138.     nop
  139.   end
  140.   
  141.   when FKey = 4 then
  142.   do
  143.     nop
  144.   end
  145.   
  146.   when FKey = 5 then
  147.   do
  148.     nop
  149.   end
  150.   when FKey = 6 then
  151.   do
  152.     nop
  153.   end
  154.   when FKey = 7 then
  155.   do
  156.     MessageID    = value("MR2I.FIRSTREFERENCE",,env)
  157.     browser' "http://search.dejanews.com/dnquery.xp?search=thread&filter=&svcclass=dnserver&threaded=1&recnum='MessageID'#1/1"'
  158.     fHandled = 1
  159.   end
  160.   when FKey = 8 then
  161.   do
  162.     From = value("MR2I.FROM",,env)
  163.     browser' "http://search.dejanews.com/profile.xp?author='From'"'
  164.     fHandled = 1
  165.   end
  166.   when FKey = 10 then
  167.   do
  168.     MessageID = value("MR2I.MESSAGE-ID",,env)
  169.     browser' "http://search.dejanews.com/dnquery.xp?search=thread&filter=&svcclass=dnserver&threaded=1&recnum='MessageID'#1/1"'
  170.     fHandled = 1
  171. /*      
  172.     Subject     = value("MR2I.SUBJECT",,env)
  173.     From = value("MR2I.FROM",,env)
  174.     browser' "http://search.dejanews.com/dnquery.xp?query=~a+'From'+%26+~s+'Subject'"'
  175.     fHandled = 1
  176. */    
  177.   end
  178.   when FKey = 11 then
  179.   do
  180.     nop
  181.   end
  182.   when FKey = 12 then
  183.   do
  184.     nop
  185.   end
  186.  
  187.   otherwise do
  188.     say 'Invalid Function Key passed by MR/2: 'FKey
  189.     exit
  190.   end
  191. end
  192.  
  193. if fHandled == 0 then
  194.     call 'msgutil.cmd' FKey Filename
  195.  
  196. exit
  197.  
  198. Syntax:
  199.    Say 'A SYNTAX condition was raised on line' sigl'!'
  200.    Say '  The error number is' rc', which means "'Errortext(rc)'"'
  201.    problem_line = sigl
  202.    Signal Abnormal_End
  203.  
  204. Halt:
  205.    Say 'A Halt condition was raised on line' sigl'!'
  206.    problem_line = sigl
  207.    Signal Abnormal_End
  208.  
  209. Novalue:
  210.    Say 'Novalue Condition raised on line' sigl'!'
  211.    Say '  The variable which caused it is' Condition('Description')
  212.    problem_line = sigl
  213.    Signal Abnormal_End
  214.  
  215. Abnormal_End:
  216.    Say '  That line is "'Sourceline(problem_line)'"'
  217.    Say '  You can now debug if you want to.'
  218.    Trace ?R
  219.    Nop
  220.  
  221. Exit
  222.  
  223.