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

  1. /* Program name:  WPS_TITL.CMD  Title: Figure 6              */
  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_TITL.CMD: show setting a title                               */
  12.  
  13. /* setting a title with SysCreateObject                             */
  14. title = "This is a title,^this is the second line;^this the third !"
  15. objectid     = "<RGF Testfolder for title>"
  16. setup_string = "ICONPOS=15,30;OBJECTID=" || objectid || ";"
  17.  
  18. ok = SysCreateObject("WPFolder",,       /* instance of WPFolder     */
  19.                      title,,            /* object title             */
  20.                      "<WP_DESKTOP>",,   /* location: desktop        */
  21.                      setup_string,,     /* setup string             */
  22.                      "F")               /* fail, if object exists   */
  23. SAY "creating:" objectid "-" worked(ok)
  24. "@PAUSE"
  25.  
  26. /* note how to escape a semi-colon which usually ends a key-value   */
  27. setup_title = "This is a title,^this is the 2nd line^;^this the 3rd!"
  28.  
  29. setup_string = "TITLE=" || setup_title || ";"
  30. ok = SysSetObjectData(objectid, setup_string)       /* change title */
  31. SAY "changing title:" objectid "-" worked(ok)
  32. "@PAUSE"
  33.  
  34. SAY "cleaning up..."
  35. ok = SysDestroyObject(objectid)         /* delete folder            */
  36. SAY "destroying (deleting):" objectid "-" worked(ok)
  37.  
  38. EXIT
  39.  
  40. /* procedure to indicate successful/not successful                  */
  41. WORKED: PROCEDURE
  42.    IF ARG(1) THEN RETURN "successful."
  43.              ELSE RETURN "*** NOT succesful ***"
  44.