home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / addnew.zip / FOLDER.CMD next >
OS/2 REXX Batch file  |  1996-03-30  |  845b  |  28 lines

  1. /* REXX instructions to create a new folder object on the WPShell */
  2. /* Written by Paul Serice serice@sprynet.com (if you have any problems) */
  3.  
  4. /* First, you need to extend the basic REXX function calls to include the one you need */
  5. /* However, the function you want may already be loaded. */
  6.  
  7. HadToAdd=0
  8. IF RxFuncQuery("SysCreateObject")  /* returns TRUE if NOT registered */
  9.    THEN DO
  10.       call RxFuncAdd "SysCreateObject","RexxUtil","SysCreateObject"
  11.       HadToAdd=1
  12.     END
  13.  
  14. count=1
  15. name="New Folder Object"
  16. done=0
  17.  
  18. DO UNTIL done
  19.   CALL SysCreateObject "WPFolder",name,"<WP_DESKTOP>"
  20.   IF result=0 THEN  /* apparently, "result" is a built in variable (?) */
  21.      DO
  22.         name="New Folder Object:"||count
  23.         count=count+1
  24.      END
  25.   ELSE done=1
  26. END
  27.  
  28. IF HadToAdd THEN call RxFuncDrop("SysCreateObject")