home *** CD-ROM | disk | FTP | other *** search
/ YPA: Your Privacy Assured / YPA.ISO / other_goodies / utilities / abcdir.lha / Util / DIR / rexx / parse.rexx < prev    next >
OS/2 REXX Batch file  |  1993-06-30  |  1KB  |  31 lines

  1. /* parse command line */
  2. /* To use this with MegaD, add an ARexx Program Control that will call this
  3.     Drag select a few files in an open directory window, select a ARexx button
  4.     that will call this script.
  5.     
  6.     It will display each selected item in the console window that will open.
  7.     The program has little value except for demonstrating how to parse
  8.     information sent from MegaD.  See @{" OpenSE.rexx " link "OpenSE.rexx"} for 
  9.     another example.
  10. */
  11.  
  12. /* open output to MegaD screen */
  13. CALL CLOSE 'STDOUT'
  14. CALL OPEN 'STDOUT','con:0/12/640/100/MegaD RX/SCREEN MEGAD', 'W'
  15.  
  16. arguments =  ARG(1)
  17. /* test for quote at first of name */
  18. DO WHILE arguments ~= ""
  19.     
  20.     /* if it starts with a Quote it ends with a Quote */
  21.     delim = " " /* default to space as a delimiter */
  22.     IF LEFT(arguments,1) = '"' THEN delim = '"'
  23.     ELSE  arguments = " " || arguments /* add space to front */
  24.     PARSE VAR arguments (delim) filename (delim) arguments
  25.     filename = STRIP(filename)
  26.     arguments = STRIP(arguments,L)
  27.     SAY filename
  28. END
  29.  
  30. value = Delay(5 * 50) /* Five second delay to see window on MegaD screen */
  31.