home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxwps.zip / wps_ndel.cmd < prev    next >
OS/2 REXX Batch file  |  1995-10-07  |  1KB  |  34 lines

  1. /* Program name:  WPS_NDEL.CMD  Title: Figure 5              */
  2. /* REXX Report              Issue: Summer '95, page 42-51    */
  3. /* Article title: The Workplace Shell: Objects to the Core   */
  4. /* Author: Rony G. Flatscher                                 */
  5. /* Description: utilizing REXX to communicate with the       */
  6. /*              Workplace Shell                              */
  7. /* Program requirements: OS/2 Warp                           */
  8. /*                                                           */
  9.  
  10.  
  11. /* WPS_NDEL.CMD: make all WPS-default objects non-deletable         */
  12.  
  13. /* query all WPS-OBJECTID's (OS2.INI, app; "PM_Workplace:Location") */
  14. CALL SysIni "USER", "PM_Workplace:Location", "ALL:", "object_id"
  15.  
  16. leadin_string = "<WP_"     /* work on WPS-objects only              */
  17. setup = "NODELETE=YES;"    /* setup string: change to not deletable */
  18. SAY "Trying to make all WPS-objects non-deletable:"; SAY
  19.  
  20. DO i = 1 TO object_id.0    /* loop over all entries                 */
  21.    IF ABBREV(object_id.i, leadin_string) THEN   /* WPS-OBJECTID ?   */
  22.    DO
  23.       ok = SysSetObjectData(object_id.i, setup) /* change state     */
  24.       SAY LEFT(object_id.i || " ", 57, ".") WORKED(ok)
  25.    END
  26. END
  27. EXIT                                    /* end of program           */
  28.  
  29.  
  30. /* procedure to indicate successful/not successful                  */
  31. WORKED: PROCEDURE
  32.    IF ARG(1) THEN RETURN "successful."
  33.              ELSE RETURN "*** NOT succesful ***"
  34.