home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / om9701.zip / os2micon.cmd < prev    next >
OS/2 REXX Batch file  |  1994-09-07  |  2KB  |  80 lines

  1. /***************************************************************************/
  2. /* OS2MIcon.Cmd                                                            */
  3. /*                                                                         */
  4. /* Creates an icon for the OS/2 Magazine Article Database                  */
  5. /*                                                                         */
  6. /* Revisions:                                                              */
  7. /*     09/07/94 1.0 - Created.                                             */
  8. /***************************************************************************/
  9.  
  10.    objectid = '<MA9409>'
  11.  
  12. /* Load REXX Utility Functions */
  13.  
  14.    if AddRexxUtil( 'SysCreateObject' ) then signal ERROR
  15.    if AddRexxUtil( 'SysSetObjectData' ) then signal ERROR
  16.  
  17. /* Get arguments */
  18.  
  19.    parse upper arg path location extra
  20.  
  21. /* If no path or "." specified, use current directory */
  22.  
  23.    if path = '' then
  24.       path = '.'
  25.  
  26.    if path = '.' then
  27.       path = directory()
  28.  
  29. /* If no location specified, put it on the desktop */
  30.  
  31.    if location = '' then
  32.       location = '<WP_DESKTOP>'
  33.  
  34. /* Create the program object */
  35.  
  36.    classname = 'WPProgram'
  37.    title     = 'OS/2 Magazine^Article Database'
  38.    setup     = 'OBJECTID='objectid';' || ,
  39.                'EXENAME=VIEW.EXE;' || ,
  40.                'PARAMETERS='path'\OS2MAGS.INF ABOUT;' || ,
  41.                'ICONFILE='path'\OS2MAGS.ICO;' || ,
  42.                'PROGTYPE=PM;'
  43.  
  44.    result = SysCreateObject( classname, title, location, setup, 'f' )
  45.    if result = 1 /* created */ then
  46.       say 'Program object created'
  47.    else do
  48.    /* See if object already exists */
  49.       result = SysSetObjectData( objectid, setup )
  50.       if result = 1 /* updated */ then
  51.          say 'Program object already exists'
  52.       else do
  53.          say 'Unable to create program object'
  54.          signal ERROR
  55.       end  /* Do */
  56.    end  /* Do */
  57.  
  58. /* Exit the REXX procedure */
  59.  
  60.    exit x2d(0000)
  61.  
  62. ERROR:
  63.    exit x2d(1604)
  64.  
  65. /* AddRexxUtil procedure */
  66.  
  67. AddRexxUtil: procedure
  68.  
  69.    parse arg name
  70.  
  71.    if RxFuncQuery( name ) \= 0 /* not registered */ then do
  72.       if RxFuncAdd( name, 'RexxUtil', name ) \= 0 /* not successful */ then do
  73.           say 'Unable to register REXX Utility Function' name
  74.           return 1  /* failure */
  75.       end  /* Do */
  76.    end  /* Do */
  77.  
  78.    return 0  /* success */
  79.  
  80.