home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / RXTCPA.ZIP / BUILDRTR.CMD next >
OS/2 REXX Batch file  |  1993-03-26  |  5KB  |  78 lines

  1. /* FOLDER.CMD: Sample code using REXXUTIL's SysCreateObject function    */           
  2. /* Builds a folder on the DeskTop and places some program objects in it.*/           
  3. /* Mike Lamb: MIKELAMB/KGNVMC                                           */           
  4.  
  5. /*  Modified by George Clark 71242,41  for the purposes of creating program */
  6. /*  objects for IBM TCP/IP.       */           
  7.  
  8.  
  9. /* Load REXXUTIL */                                                                  
  10. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs                                  
  11. call sysloadfuncs                                                                    
  12.                                                                                      
  13. /*The basic call is listed next.                                           */        
  14. /*rc=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>)*/        
  15.                                                                                      
  16. call SysCls                                                                          
  17. Say '';Say 'Using REXXUTILs to Add a Folder and Program Objects...'                  
  18.                                                                                      
  19. Say '';Say 'Press Y to add Routers Folder to Desktop...';Say '';                        
  20. parse upper value SysGetKey('NOECHO') with key                                       
  21. If key<>'Y' Then Exit                                                                
  22.                                                                                      
  23. /* All of the routines pass parameters to a subroutine to perform the call */        
  24. classname='WPFolder'                                                                 
  25. title='Routers'
  26. location='<WP_DESKTOP>'                                                              
  27. setup='OBJECTID=<Routers>;'||,
  28.       'OPEN=DEFAULT;'
  29. Call BldObj                                                                          
  30.                                                                                      
  31.        
  32. Say 'Press ENTER and we will add a few program objects...'                           
  33. key=SysGetKey()                                                                      
  34.                                                                                      
  35. Say 'Place a program object into the folder...';Say '';                              
  36.  
  37. classname='WPProgram'
  38. title='NWR1'
  39. location='<Routers>'
  40. setup='OBJECTID=<RtrNWR1>;'||,
  41.       'EXENAME=VT220.EXE;'||,
  42.       'PARAMETERS=111.222.111.222;'||,
  43.       'PROGTYPE=WINDOWABLEVIO;'
  44. Call BldObj                                                                          
  45.  
  46. title='CTVF1'
  47. location='<Routers>'                   
  48. setup='OBJECTID=<RtrCTVF1>;'||,
  49.       'EXENAME=VT220.EXE;'||,            
  50.       'PARAMETERS=111.222.111.111;'||,
  51.       'PROGTYPE=WINDOWABLEVIO;'          
  52. Call BldObj                              
  53.  
  54. title='NBV1'
  55. location='<Routers>'                   
  56. setup='OBJECTID=<RtrNBV1>;'||,
  57.       'EXENAME=VT220.EXE;'||,            
  58.       'PARAMETERS=111.222.111.1;'||,
  59.       'PROGTYPE=WINDOWABLEVIO;'          
  60. Call BldObj                              
  61.                                                                                                
  62.                                                                                                
  63. Exit                                                                                 
  64.                                                                                      
  65. /* Build Object */                                                                   
  66. BldObj:                                                                              
  67. call charout ,'Building: 'title                                                      
  68.                                                                                      
  69. /* Build object using REPLACE as duplicateflag */                                    
  70. result = SysCreateObject(classname, title, location, setup, 'R')                     
  71.                                                                                      
  72. If result=1 Then call charout ,'...   Object created!'                               
  73. Else             call charout ,'...   Not created! Return code='result               
  74.                                                                                      
  75. Say '';                                                                              
  76. Return                                                                               
  77.  
  78.