home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / lstman.zip / EXAMPLE.CMD next >
OS/2 REXX Batch file  |  1995-01-03  |  2KB  |  57 lines

  1. /* 
  2.    Example.Cmd 
  3.  
  4.    This is an example of a Rexx program that you might write
  5.    to use List Man (an OS/2 program) to create a list
  6.    for use with PKZip (a DOS program) to use as input.
  7.  
  8.    This program will not work on your system if you don't
  9.    have PKZip.  It is included as an example to show
  10.    how to use List Man to create a list and pass the name
  11.    of the list to another program.
  12.  
  13.    When you ask List Man to run a program, it creates a
  14.    temporary file that contains the current list.  It
  15.    then uses the OS/2 "Start" command to start the program
  16.    you selected.  It passes the name of the temporary file
  17.    containing the list to the program started.
  18.  
  19.    In this example, the program contains three statements.
  20.    The first line:
  21.  
  22.       Parse Arg ListName
  23.  
  24.    is a Rexx statement to obtain the name of the temporary
  25.    file containing the list.  The Rexx variable ListName will
  26.    have the name of the file.
  27.  
  28.    The next line:
  29.  
  30.       "C:\PKZip\PKZip Test.Zip @" || ListName
  31.  
  32.    is passed by Rexx to OS/2 for processing.  The left part of
  33.    the line between the quotes is the DOS command to run PKZip
  34.    and some of its parameters.  Before passing the command to OS/2
  35.    Rexx will replace the variable ListName with the name of the 
  36.    list and concatenate it with the rest of the line creating a 
  37.    valid PKZip command call.  The two vertical bars || mean 
  38.    concatenate without an intervening blank, this is known as 
  39.    abuttal.  If the name of the temporary list file was User.Lst, 
  40.    the resultant command would look like this:
  41.  
  42.       C:\PKZip\PKZip Test.Zip @User.Lst
  43.  
  44.    The last line:
  45.  
  46.       Call VRDeleteFile ListName
  47.  
  48.    is a VXRexx Function used to delete the temporary file containing
  49.    the list.
  50.  
  51. */ 
  52.  
  53.    Parse Arg ListName
  54.  
  55.    "C:\PKZip\PKZip Test.Zip @" || ListName
  56.    Call VRDeleteFile ListName 
  57.