REXX Tips & Tricks, Version 2.80


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


Sample code to create a LaunchPad





 
/* sample code to create a LaunchPad                                  */

                    /* load the necessary REXXUTIL function           */
  call rxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs"
  call SysLoadFuncs

/* ------------------------------------ */

                    /* object ID for the new LaunchPad                */
  curObjectID = '<MyNewLaunchPad>'

/* ------------------------------------ */

  say "Creating an additional LaunchPad ..."

                    /* create a new LaunchPad with the objects        */
                    /* <WP_OS2SYS>, <WP_INFO>, <WP_CONFIG>, and       */
                    /* <WP_PROMPTS>.                                  */
                    /* Also change the style of the LaunchPad         */
                    /* (see Setup strings for LaunchPad objects for   */
                    /*  the meaning of the setup strings)             */
                    /*                                                */
                    /* Hint: The drawer 0 is the LaunchPad.           */
                    /*                                                */

  thisRC = SysCreateObject( ,
     "WPLaunchPad"         ,,
     "My new LaunchPad"    ,,
     "<WP_DESKTOP>"        ,,
     "DRAWEROBJECTS=0,<WP_OS2SYS>,<WP_INFO>,<WP_CONFIG>,<WP_PROMPTS>;" || ,
     "LPACTIONSTYLE=MINI;"             || ,
     "LPCLOSEDRAWER=YES;"              || ,
     "LPDRAWERTEXT=YES;"               || ,
     "LPFLOAT=YES;"                    || ,
     "LPHIDECTLS=NO;"                  || ,
     "LPSMALLICONS=YES;"               || ,
     "LPTEXT=YES;"                     || ,
     "LPVERTICAL=YES;"                 || ,
     "OBJECTID=" || curObjectID || ";" || ,
     "" ,,
     "F" )

  say "  Result of SysCreateObject is " || thisRC

  if thisRC <> 1 then
  do
    say "Oops, something went wrong!"
    say ""
    say "If you've already executed this program the LaunchPad already exist."
    say "You should delete the existing Test LaunchPad before"
    say "running this program again"
    say ""
    exit 255
  end /* if thisRC <> 1 then */

/* ------------------------------------ */
  say "Now adding some objects to the drawer 1 ..."

                    /* add some objects to the drawer 1               */
  thisRC = SysSetObjectData( ,
     curObjectID ,,
     "DRAWEROBJECTS=1,<WP_TOOLS>,<WP_SHRED>,<WP_DRIVES>;" )

  say "  Result of SysSetObjectData is " || thisRC

  if thisRC <> 1 then
  do
    say "Oops, something went wrong!"
    exit 255
  end /* if thisRC <> 1 then */

/* ------------------------------------ */
  say "Now adding one object to the drawer 2 ..."

                    /* add one object to the drawer 2                 */
  thisRC = SysSetObjectData( ,
     curObjectID ,,
     "DRAWEROBJECTS=2,<WP_TUTOR>;" )

  say "  Result of SysSetObjectData is " || thisRC

  if thisRC <> 1 then
  do
    say "Oops, something went wrong!"
    exit 255
  end /* if thisRC <> 1 then */

/* ------------------------------------ */
  say "Now adding some objects to the drawer 4 ..."

                    /* add some objects to the drawer 4               */
  thisRC = SysSetObjectData( ,
     curObjectID ,,
     "DRAWEROBJECTS=4,<WP_DOSFS>,<WP_DOSWIN>,<WP_WINFS>,<WP_WIN2WIN>;" )

  say "  Result of SysSetObjectData is " || thisRC

  if thisRC <> 1 then
  do
    say "Oops, something went wrong!"
    exit 255
  end /* if thisRC <> 1 then */

/* ------------------------------------ */
  say "Now adding some further objects to the LaunchPad ..."

                    /* add some objects to the LaunchPad              */
  thisRC = SysSetObjectData( ,
     curObjectID ,,
     "DRAWEROBJECTS=0,<WP_GAMES>,<WP_NOWHERE>,C:\OS2;" )

  say "  Result of SysSetObjectData is " || thisRC

  if thisRC <> 1 then
  do
    say "Oops, something went wrong!"
    exit 255
  end /* if thisRC <> 1 then */

/* ------------------------------------ */
  say "Now adding some further objects to the drawer 4 ..."

                    /* add some objects to the drawer 4               */
  thisRC = SysSetObjectData( ,
     curObjectID ,,
     "DRAWEROBJECTS=4,<WP_DOS_DRV_A>,<WP_OS2WIN>,C:\OS2\FDISKPM.EXE;" )

  say "  Result of SysSetObjectData is " || thisRC

  if thisRC <> 1 then
  do
    say "Oops, something went wrong!"
    exit 255
  end /* if thisRC <> 1 then */

/* ------------------------------------ */
  say "Now changing the style of the LaunchPad ..."

                    /* change the style of the LaunchPad              */
  thisRC = SysSetObjectData( ,
     curObjectID ,,
     "LPTEXT=NO;" )

  say "  Result of SysSetObjectData is " || thisRC

  if thisRC <> 1 then
  do
    say "Oops, something went wrong!"
    exit 255
  end /* if thisRC <> 1 then */

/* ------------------------------------ */
  say "Now opening the LaunchPad ..."

                    /* open the LaunchPad                             */
  thisRC = SysSetObjectData( ,
     curObjectID ,,
     "OPEN=DEFAULT;" )

  say "  Result of SysSetObjectData is " || thisRC

  if thisRC <> 1 then
  do
    say "Oops, something went wrong!"
    exit 255
  end /* if thisRC <> 1 then */

/* ------------------------------------ */


  

Inf-HTML End Run - Successful