home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxtut2.zip / sysutils.txt < prev   
Text File  |  1993-11-17  |  98KB  |  2,209 lines

  1. Subject: REXXUTIL Information and Samples
  2.  
  3. The following attempts to better explain some of the powerful features
  4. provided by OS/2 V2's dynamic link library; REXXUTIL.DLL (Rexx utility
  5. functions). REXXUTIL functions are described in the online 'REXX Information'
  6. reference and the 'OS/2 2.0 Technical Library Procedures Language/2 REXX
  7. Reference' publication (order number S10G-6268). The information following is
  8. intended to provide a more detailed description of some of the functions.
  9.  
  10. Plans for this information
  11. --------------------------
  12. Much of this file has changed since the first few attempts at compiling useful
  13. REXXUTIL information. Plans are to place this information out on an IBM
  14. Internal FORUM, (REXXOS2 FORUM) and the OS2REXX CFORUM which makes its way out
  15. into the external customer world. Hopefully within a month or so of making it
  16. available I've received any corrections/omissions from both IBMer's and
  17. customers. Thereafter I plan to create an OS2EWS package that will contain
  18. this text information with the sample CMD files as separate files. Also
  19. I plan on including an INF formatted file of the information. I really do
  20. want the information to be as accurate as possible before creating the INF
  21. file so please report to me any items of omission or error.
  22.  
  23. Publications
  24. ------------
  25. One should realize that many of the functions provided by REXXUTIL have
  26. origins with Presentation Manager Winxxx calls. These publications are helpful
  27. and be reviewed for more information:
  28.  
  29. S10G-6265 OS/2 PM Programming Reference Vol - 2
  30.           Contains all the Winxxx calls, the Workplace Shell classes, and
  31.           their _wpxxx messages. Also this is available as an online doc
  32.           that comes with the OS/2 Toolkit.
  33. S10G-6309 OS/2 System Object Model Reference
  34.           Also an online doc that comes with the OS/2 Toolkit.
  35. GBOF-2254 OS/2 Technical Redbooks (series of technical documents)
  36.           GG24-3732 OS/2 V2 Volume 3: Presentation Manager & WPS
  37.           GG24-3774 OS/2 V2 Volume 4: Application Development
  38. ZB35-5100 The REXX Language: A Practical Approach to Programming,
  39.           ISBN 0-13-780651-5
  40.  
  41. Some of the functions used/explained herein:
  42.  
  43. SysIni:
  44. -------
  45. Using REXXUTIL's SysIni function one can modify many settings of the WorkPlace
  46. Shell as well as change other applications settings that make use of *.INI
  47. files such as the system OS2.INI and OS2SYS.INI.
  48.  
  49. SysCreateObject: (PM WinCreateObject - Create Workplace Object)
  50. ----------------
  51. Using REXXUTIL's SysCreateObject function one can create various objects;
  52. like folders, programs, and shadow objects using Rexx. This section for the
  53. most part includes parameter information which was gathered together from
  54. various sources of information.
  55.  
  56. SysSetObjectData: (PM WinSetObjectData - Set Object Data)
  57. -----------------
  58. Using REXXUTIL's SysSetObjectData function one can change an objects
  59. characteristics (of an already created object, if you know its objectid).
  60.  
  61. SysDestroyObject: (PM WinDestroyObject - Destroy Workplace Object)
  62. -----------------
  63. Using REXXUTIL's SysDestroyObject one can delete an object created if you
  64. know its objectid.
  65.  
  66. Misc Notes:
  67. If one views the *.RC files located in your bootdrive:\OS2 directory you
  68. can learn a lot about the various INI settings and folder structure.
  69. Review INI.RC and INISYS.RC files, they are used to create your OS2.INI
  70. and OS2SYS.INI files. (Note in the *.RC files "?:" is used to indicate
  71. the boot drive)
  72.  
  73. Some of REXXUTIL's functions are only available when using the very latest
  74. REXX20 PACKAGE which consists of the very latest REXX fixes and enhancements
  75. for GA OS/2 V2.0. Should you have problems running any of the sample programs
  76. you should make sure your system has the vary latest REXX20 updates. In
  77. addition to the REXX fixes, various OS/2 V2 base fixes may be needed as well.
  78. You may need to install/apply the latest 2.0 Service Pack, or even OS/2 2.1 in
  79. order for some of the operations to behave properly.
  80.  
  81. If anyone discovers other parameters or other "hidden" features of
  82. any of the functions discussed, please share your discovery. I'll try to
  83. update the information as I receive it.
  84.  
  85. Thanks...
  86. Michael Lamb MIKELAMB(KGNVMC)         Michael Lamb
  87. Workstation Technical Support         4 Cross Creek Rd
  88. ISSC - MHV Solution Center            New Paltz, NY 12561-3805
  89. 30NC/370 Neighborhood Rd
  90. Kingston NY 12401
  91. (914)385-0666 t/l-695-0666
  92.  
  93. Change Log:
  94.   04/30/92 - Added information about DuplicateFlag parm
  95.            - Added more setup string information from manuals
  96.   06/02/92 - Added information about breaking Title line character "^"
  97.            - Added information about adding multiple DOS_DEVICE statements
  98.            - Added code to SHADOW.CMD to make shadow object of a file
  99.   !!NOTE!! - The REXXOS2 fixes are required to make some of
  100.              the newer samples work properly.
  101.   06/30/92 - Added information regarding two new REXXUTIL functions:
  102.              SysSetObjectData and SysDestroyObject, also two new
  103.              samples STARTDOS, BOOTDOS (Thanks to Rick McGuire)
  104.   07/13/92 - Reorganized the way the material is presented. Also added more
  105.              sample Rexx routines REBUILD, OBJCLASS and LPTADD, descriptions
  106.              follow. Also changed parm CONCURRENTVIEW to CCVIEW (Thanks
  107.              Dan Kehn, Felix Sawicki)
  108.   07/15/92 - Updated entire document as I mistakenly truncated it at 80
  109.              characters. Rewrote some sample Rexx routines so they do not
  110.              extend beyond 80 characters. Also updated the SysSetObjectData
  111.              description to show how can open an object (Thanks Rick). Added
  112.              information about creating multi-line titles, carat works for
  113.              two line titles but not more than 2.
  114.              New samples, OBJECTID and FONTS included, descriptions follow.
  115.   07/29/92 - Corrected an error I made when I broke the setup lines into
  116.              multiple lines. I needed to add ]]'s to make sure they
  117.              concatenated without spaces (Thanks Rick). Also added
  118.              information regarding changing some System Settings (added
  119.              new section after sample Rexx code). Also added warning
  120.              in REBUILD.CMD sample about replacing Folder objects. Also
  121.              added new sample ICONRES.CMD which builds a folder containing
  122.              many of the OS/2 V2 installed icons using system DLL files.
  123.   01/30/93   Added to some examples the use of SysDestroyObject to clean up
  124.              after creating objects, also added the syntax for the call.
  125.              Changed REBUILD.CMD sample to used 'U' for updateifexists as
  126.              the duplicateflag to prevent problems. Added warning about
  127.              the 'R' duplicateflag parameter to field description.
  128.              Added information about changing Background tab, Change color
  129.              button values. Changed OBJECTID.CMD to enclose results in
  130.              double quotes to easier distinguish results.
  131.              Changed descriptions of calls to better match what's found in the
  132.              toolkit documentation for the Winxxx calls.
  133.   04/11/93   Added some information in ASSOCTYPE, ASSOCFILTER section.
  134.              Added new PROGTYPE values. Added ICONVIEWPOS information.
  135.   07/04/93   Too many changes to note. Lots having to do with OS/2 V2.1
  136.  
  137. This append consists of multiple pieces of information:
  138.  
  139. 1) Large block of text containing information that pertains to the subject.
  140.    (TEXT INFORMATION)
  141. 2) Sample Rexx code, some complete programs, others code fragments:
  142.  - (FOLDER.CMD)
  143.    Creates a folder and program objects in the folder
  144.  - (SHADOW.CMD)
  145.    Creates shadows of objects
  146.  - (FLDSHAD.CMD)
  147.    Creates a folder, then program object in the folder, then place a shadow
  148.    of the program object on the desktop.
  149.  - (MKSHAD.CMD)
  150.    Creates a shadow object of an objectid, file or drive/directory.
  151.  - (STARTDOS.CMD)
  152.    Starts a DOS program using specific DOS VDM settings.
  153.  - (BOOTDOS.CMD)
  154.    Starts a DOS session, booting from a specific DOS image with
  155.    specific DOS VDM settings.
  156.  - (REBUILD.CMD)
  157.    Allows one to rebuild OS/2 system objects, kinda like MAKEINI does.
  158.  - (LPTADD.CMD)
  159.    Code using SysIni to add LPT4-9 ports.
  160.  - (OBJECTID.CMD)
  161.    Code using SysIni to list OBJECTIDs known to the WorkPlace Shell
  162.  - (FONTS.CMD)
  163.    Code using SysIni to list installed fonts and verify their existence.
  164.  - ICONRES.CMD
  165.    Code building a folder containing many of the various icons found in
  166.    installed DLL files for OS/2 V2. Demonstrates use of setup string
  167.    parameter ICONRESOURCE.
  168.  - SWAPEDIT.CMD
  169.    Code that allows you to make the Enhanced Editor (EPM) the default open
  170.    action for most data objects instead of the OS/2 Enhanced Editor (E).
  171.  - OPENWPS.CMD
  172.    Code that allows you to open up an objectid or directory using views
  173.    you specify.
  174. 3) Code Fragments
  175.  - (SYSSET)
  176.    Shows using SysIni to toggle various System Settings
  177.  
  178. ((BEGIN TEXT INFORMATION))
  179. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  180.  
  181. -- Information regarding the SysCreateObject function of REXXUTIL --
  182.  
  183. Function: SysCreateObject
  184. Syntax:
  185. result=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>)
  186.  
  187.  classname: The name of the class of which this object is a member.
  188.  
  189.  title:    The object title, as it is to appear when displayed on the user
  190.            interface underneath an icon or on the title bar of an open object.
  191.            (Note this can be changed later using the TITLE keyword)
  192.  
  193.  location: The object location. This can be specified as either an
  194.            object ID (for example, <WP_DESKTOP>) or a file system path
  195.            (for example, C:\bin\mytools).
  196.            (Object ids will be explained later)
  197.  
  198.  setup:    A WinCreateObject setup string. Described more later on.
  199.  
  200.  duplicateflag: This parameter indicates what action should be taken
  201.            when the Setup string specifies an object ID, and an object with
  202.            that object ID already exists. If the setup string does not give
  203.            an object ID, another object will be created.
  204.  
  205.  result    The return code from WinCreateObject. This returns 1 (TRUE) if the
  206.            object was created and 0 (FALSE) if the object was not created.
  207.  
  208.  Purpose:  Create a new instance of an object class.
  209.  
  210. -- Information regarding the SysSetObjectData function of REXXUTIL --
  211.  
  212. Function: SysSetObjectData
  213. Syntax:
  214. result=SysSetObjectData(name, setup)
  215.  
  216.  name:     The object name. This can be specified as an object id (for
  217.            example <WP_DESKTOP>) or as a fully qualified file name.
  218.  
  219.  setup:    A WinCreateObject setup string. Described more later on.
  220.  
  221.  result:   The return code from WinSetObjectData. This will return 1 (TRUE)
  222.            if the object was updated and 0 (FALSE) if the object was not
  223.            updated.
  224.  
  225.  Purpose:  Alter the settings of an existing object.
  226.  
  227.            Can be used to open an instance of an object:
  228.            /* open up the system folder */
  229.            call SysSetObjectData '<WP_OS2SYS>', 'OPEN=DEFAULT;'
  230.  
  231.            Can be used to change the title of an object:
  232.            /* change Information folder name */
  233.            call SysSetObjectData '<WP_INFO>', 'TITLE=InfoFolder'
  234.  
  235. See the description of the SysCreateObject location and setup strings
  236. following for an explanation of the parameters.
  237.  
  238. -- Information regarding the SysDestroyObject function of REXXUTIL --
  239.  
  240. Function: SysDestroyObject
  241. Syntax:
  242. result=SysDestroyObject(name)
  243.  
  244.  name:     The object name. This should be specified as an object id, for
  245.            example <WP_CMDREF>. It can also be a fully specified file name.
  246.  
  247.  result:   The return code from WinDestroyData. This will return 1 (TRUE)
  248.            if the object was destroyed and 0 (FALSE) if the object was
  249.            not destroyed.
  250.  
  251.  Purpose:  Delete an existing workplace object, or file.
  252.  
  253. See the description of the SysCreateObject location parameter
  254. following for an explanation of the object name. See the OBJECTID.CMD sample
  255. for a way to determine the objectid's the system knows about.
  256.  
  257. --Parameters Explained-------------------------------------------------------
  258.  
  259. Parameters to the functions are now explained in more detail.
  260.  
  261. classname:
  262.   A registered object class defined to the system. Of particular interest are
  263.   the WPFolder/WPProgram/WPShadow classes. Note using the sample Rexx code
  264.   included in the SysQueryClassList function help screen one can list all
  265.   of the registered classes:
  266.  
  267.   call SysQueryClassList "list."
  268.   do i = 1 to list.0
  269.      say 'Class' i 'is' list.i
  270.   end
  271.  
  272. title:
  273.   The objects title you want to use. If you wish to break the title line you
  274.   use a comma "," as the line break character. However, there were problems
  275.   with this and it may or may not work depending on whether you have the
  276.   latest REXX and OS/2 V2 fixes installed. You may instead decide to use
  277.   a hex 0A character (line-feed) in the string to separate lines.
  278.  
  279.   Rexx example:  Note: x2c is Rexx's hex to character function.
  280.  
  281.   title='First'x2c(A)'Second'x2c(A)'Third'
  282.  
  283.   Note if you wish to use the special characters; comma or semi-colon in the
  284.   string, prefix the character with the carat symbol.
  285.  
  286.   Example title, you want:
  287.   ] My Activities     ]   you would use...
  288.   ] December 25, 1992 ]     title='My Activities,December 25^,1992'
  289.  
  290. location:
  291.   The objects location can be specified as either an existing object id,
  292.   for example <WP_DESKTOP>, or alternatively a fully qualified file name of
  293.   any file or directory.
  294.  
  295.   An object id string must always start with the '<' character and be
  296.   terminated by the '>' character and is thus an invalid file system name.
  297.  
  298.   By looking at your \OS2\INI.RC file you can see a use of many object ids
  299.   such as <WP_DESKTOP>. If this is used as a location then your object will
  300.   be placed on the WorkPlace Shell desktop.
  301.  
  302.   If you are creating an object you should make sure you use the OBJECTID
  303.   setup string parameter and give that object a unique object id. We'll see
  304.   how this works later.
  305.  
  306.   HINTS: Here are some predefined object ids of system folders. Also if you
  307.          are thinking of placing an object in the Startup Folder <WP_START>,
  308.          make it a shadow of an object.
  309.          <WP_DESKTOP>   Desktop
  310.          <WP_START>     Startup folder
  311.          <WP_OS2SYS>    OS/2 System folder
  312.          <WP_TEMPS>     Templates folder
  313.          <WP_CONFIG>    System Setup folder
  314.          <WP_INFO>      Information folder
  315.          <WP_DRIVES>    Drives folder
  316.          <WP_NOWHERE>   Hidden folder
  317.          <WP_PROMPTS>   Command Prompts folder
  318.          <WP_TOOLS>     Productivity folder
  319.          <WP_GAMES>     Games folder
  320.          ---Some other common OS/2 folder objectids---
  321.          <MAH_FOLDER>   Mahjongg folder
  322.          <MMPM2_FOLDER> Multimedia folder
  323.          <MMPM2_SOUNDS> Multimedia Sound Bites folder
  324.          <MMPM2_MOVIES> Multimedia Movies folder
  325.          <TK_TOOLKIT>   Toolkit 2.1 folder
  326.          <TK_DEVINFO>   Toolkit Information folder
  327.          <TK_DEVTOOLS>  Development Tools folder
  328.          <TK_CSAMPLE>   Sample Programs folder
  329.  
  330. setup:
  331.   This field needs the most explaining. Each object class, WPProgram,
  332.   WPFolder, etc, documents its setup string keynames and parameters.
  333.   A larger section follows that details many of the available keynames and
  334.   parameters. The setup string contains a series of "keyname=value" pairs,
  335.   that change the behavior of the object. "keynames" are separated by
  336.   semicolons, and "values" are separated by commas.
  337.  
  338.     "key=value;key2=value1,value2;"
  339.  
  340.   If you want a literal comma or semicolon inside one of your fields you
  341.   must precede the comma/semi-colon with a carat as in the following:
  342.       ^,   A literal comma
  343.       ^;   A literal semicolon
  344.  
  345.   Note that ALL setup string parameters have safe defaults, so it is never
  346.   necessary to pass unnecessary parameters to an object.
  347.  
  348.   (Note: The setup string was limited to a total length of 255 bytes in the
  349.          2.0 GA code, this limitation is removed if the Service Pack is
  350.          applied or you are using OS/2 2.1) (APAR PJ02271)
  351.  
  352. duplicateflag:
  353.   There are three possible values for this parameter:
  354.   FailIfExists - No object should be created if an object with the
  355.       given object already exists. This is the default and maps to the
  356.       PM creation flag, CO_FAILIFEXISTS
  357.   UpdateIfExists - If an object with the given object ID already exists,
  358.       the existing object will be updated with the new setting information.
  359.       Maps to the creation flag, CO_UPDATEIFEXISTS. If the object does
  360.       not exist, it is created.
  361.   ReplaceIfExists - If an object with the given object ID already exists,
  362.       the existing object should be replaced. Maps to the PM creation
  363.       flag, CO_REPLACEIFEXISTS.
  364.   WARNING: Be careful using the 'R' ReplaceIfExists value. Any attempt to
  365.            rebuild an object first deletes any object that is using that
  366.            same <objectid>. This can be useful if you want to restore an
  367.            object back to its original installed state. This can also be
  368.            bad since if you rebuild a folder it first deletes all objects
  369.            in it since those objects are tied to the folder object.
  370.   Note: Only the first character is required/examined, i.e. F, R, or U
  371.  
  372. --Setup Strings--------------------------------------------------------------
  373.  
  374.   Using WPFolder and WPProgram classes in your SysCreateObject call you can
  375.   build folder and program objects. What follows are setup string parameters.
  376.   Their various key names, values, and a short description follow
  377.   each item. The <<xxx>> items are used to indicate what Workplace Shell
  378.   settings "page" you would find this information on.
  379.  
  380.   An instance of each class is created initially by the system in its
  381.   template form. It has the title "Folder" / "Program", respectively, and
  382.   resides in the systems "Templates" folder.
  383.  
  384. *********************************
  385. ***WPFolder setup string parms***
  386. *********************************
  387. KEYNAME      VALUE           Description
  388. -----------------------------------------------------------------------------
  389. <<View>>
  390. OPEN         ICON            Open icon view when object is created/updated.
  391.              TREE            Open tree view when object is created/updated.
  392.              DETAILS         Open details view when object is created/updated.
  393.            Example:
  394.              /* Open up the tree view of the system folder */
  395.              call SysSetObjectData '<WP_OS2SYS>', 'OPEN=TREE;'
  396. ICONVIEW     s1╒,s2,...snσ   Set icon view to specified style(s).
  397. TREEVIEW     s1╒,s2,...snσ   Set tree view to specified style(s).
  398. DETAILSVIEW  s1╒,s2,...snσ   Set details view to specified style(s).
  399. (styles)     FLOWED          flowed list items
  400.              NONFLOWED       non-flowed list items
  401.              NONGRID         non-gridded icon view
  402.              NORMAL          normal size icons
  403.              MINI            small icons
  404.              INVISIBLE       no icons
  405.              LINES           lines in tree view
  406.              NOLINES         no lines in tree view
  407. ICONFONT     value           Font size and facename. See Font Notes following.
  408. TREEFONT     value           Font size and facename. See Font Notes following
  409. DETAILSFONT  value           Font size and facename. See Font Notes following
  410. (Font Notes)
  411. The format for the value is normally;   size.facename fontstyle hex0
  412.   example:   8.Courier Bold
  413.   Remember the value should end with null zero.
  414.   Example code to change the Information Folder icon view font:
  415.     call SysSetObjectData '<WP_INFO>', 'ICONFONT=8.Courier Bold'x2c(0)
  416.  
  417. We say 'normally' because there are certain circumstances where you must
  418. separate values using a period. Also if you use a font style of 'Normal'
  419. you just leave off the font style (don't use the word 'Normal')
  420. Following is a small table to help.
  421.  
  422. FaceName: Courier FontStyle: Normal
  423.   'ICONFONT=8.Courier'x2c(0)
  424. FaceName: Courier FontStyle: Bold Italic
  425.   'TREEFONT=8.Courier Bold Italic'x2c(0)
  426. 10 FaceName: System Proportional FontStyle: Bold
  427.   'DETAILSFONT=10.System Proportional.Bold'x2c(0)
  428.  
  429. HINT: To find out what the string should look like, create a folder, name it
  430.       simple like MYFOLD, then manually change the font size/name using the
  431.       Open/Settings/Change font button. Close the settings, then from an
  432.       OS/2 command line first determine the name of your desktop, for a
  433.       typical 2.0 FAT file system it would be something like C:\OS!2_2.0_D
  434.       (It gets easier for 2.1 where the Desktop is normally named C:\DESKTOP)
  435.       Then locate the folder you created C:\OS!2_2.0_D\MYFOLD
  436.       Then enter:  EAUTIL C:\OS!2_2.0_D\MYFOLD MYFOLD.EAS /S /P
  437.       This will create a MYFOLD.EAS file, use a browse program to view this
  438.       file and you'll see the values required.
  439. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  440. <<Background>>
  441. BACKGROUND   filename        Sets the folder background. filename is the
  442.                              name of a file in the \OS2\BITMAP directory
  443.                              of the boot drive.
  444. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  445. <<File>>
  446. WORKAREA     YES             Make the folder a Workarea folder
  447.              NO
  448. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  449. <<Window>>
  450. HIDEBUTTON   YES             Views of this object will have a hide button
  451.                              as opposed to a minimize button.
  452.              NO              Views of this object will have a minimize button
  453.                              as opposed to a hide button.
  454. MINWIN       HIDE            Views of this object will hide when their
  455.                              minimize button is selected.
  456.              VIEWER          Views of this object will minimize to the
  457.                              minimized window viewer when their minimize
  458.                              button is selected.
  459.              DESKTOP         Views of this object will minimize to the
  460.                              Desktop when their minimize button is selected.
  461. CCVIEW       YES             New views of this object will be created every
  462.                              time the user selects open.
  463.              NO              Open views of this object will resurface when
  464.                              the user selects open.
  465. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  466. <<General>>
  467.  
  468. ** See General and Miscellaneous section following ***
  469.  
  470. -----------------------------------------------------------------------------
  471.  
  472. **********************************
  473. ***WPProgram setup string parms***
  474. **********************************
  475. KEYNAME      VALUE           Description
  476. -----------------------------------------------------------------------------
  477. <<Program>>
  478. EXENAME      filename        Sets the name of the program
  479. PARAMETERS   params          Sets the parameters list, which may
  480.                              include substitution characters
  481.                              ---Substitution characters---
  482.                              Special substitution parameters are allowed:
  483.                              ╒ σ     :(bracket blank bracket) You are prompted
  484.                                       to type any parameters you want to use.
  485.                              ╒textσ  :Characters placed inside of the brackets
  486.                                       are displayed as the prompt string.
  487.                              no parm :If the program object is started by
  488.                                       clicking on it no parameters are passed.
  489.                                       If you start the program object by
  490.                                       dragging a file over it, the full
  491.                                       filename is passed.
  492.                              %       :No parameters are passed. Useful for
  493.                                       program objects you may want to start
  494.                                       from a folders pop-up menu.
  495.                              %*      :Like passing no parms, but useful if you
  496.                                       need to insert the filename of a dragged
  497.                                       object somewhere other than at the end
  498.                                       of the parameter list.
  499.                              %**P    :Insert drive and path information without
  500.                                       the last backslash (\).
  501.                              %**D    :Insert drive with ':' or UNC name.
  502.                              %**N    :Insert file name without extension.
  503.                              %**F    :Insert file name with extension.
  504.                              %**E    :Insert extension without leading dot. In
  505.                                       HPFS, the extension always comes after
  506.                                       the last dot.
  507.                              REMEMBER: If you specify a parameter in the field
  508.                                        the name of any file being dragged onto
  509.                                        this object is added to the end of the
  510.                                        parameter list.
  511. STARTUPDIR   pathname        Sets the working directory
  512. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  513. <<Sessions>>
  514. PROGTYPE     OS/2 session values:
  515.              PM              Sets the session type to PM
  516.              FULLSCREEN      Sets the session type to OS/2 full screen
  517.              WINDOWABLEVIO   Sets the session type to OS/2 windowed
  518.              DOS session values:
  519.              VDM             Sets the session type to DOS full screen
  520.              WINDOWEDVDM     Sets the session type to DOS windowed
  521.              WIN-OS/2 session values:
  522.              WIN             WIN-OS2 full screen
  523.              WINDOWEDWIN     WIN-OS2 windowed, NOT a separate VDM session
  524.              SEPARATEWIN     WIN-OS2 windowed, Separate VDM session
  525.              -- Values for OS/2 2.1 systems --
  526.              PROG_31_STD     WIN-OS2 full screen, Windows 3.1 Standard mode.
  527.              PROG_31_STDSEAMLESSVDM
  528.                              WIN-OS2 windowed, Separate VDM session,
  529.                              3.1 Standard mode
  530.              PROG_31_STDSEAMLESSCOMMON
  531.                              WIN-OS2 windowed, NOT a separate VDM session,
  532.                              3.1 Standard mode
  533.              PROG_31_ENH     WIN-OS/2 full screen, NOT a separate VDM session,
  534.                              3.1 Enhanced Compatibility
  535.              PROG_31_ENHSEAMLESSVDM
  536.                              WIN-OS2 windowed, Separate VDM session,
  537.                              3.1 Enhanced Compatibility
  538.              PROG_31_ENHSEAMLESSCOMMON
  539.                              WIN-OS2 windowed, NOT a separate VDM session,
  540.                              3.1 Enhanced Compatibility
  541. MINIMIZED    YES             Start program minimized
  542. MAXIMIZED    YES             Start program maximized
  543. NOAUTOCLOSE  YES             Leaves the window open upon program termination.
  544.              NO              Closes the window when the program terminates.
  545. SET          XXX=VVV         XXX is any environment variable. VVV sets the
  546.                              value of the environment variable. When used will
  547.                              wipe out many variables you may have assumed were
  548.                              set. Check environment space closely when using.
  549.                              Also used to specify DOS settings for DOS and
  550.                              Windows programs. --See next section--
  551. ----------------------------
  552. - DOS and WIN-OS2 Settings -
  553. ----------------------------
  554. IMPORTANT NOTES:
  555. 1) To change these values you use SET keyname=
  556.   Example:   SET DOS_FILES=45;SET DOS_HIGH=1;
  557.   Also for some use values of 1 for On, 0 for off
  558.   Example:   SET COM_HOLD=1;     (on, default is off)
  559. 2) To add more than one line to a setting you can use the same technique used
  560.   to have more than one title line. See the discussion previous regarding
  561.   that technique. Here's an example using the DOS_DEVICE keyname:
  562.   Rexx example:
  563.   setup='...;SET DOS_DEVICE=C:\OS2\MDOS\ANSI.SYS'x2c(A)'C:\OS2\MDOS\EGA.SYS...'
  564. 3) Some settings may already have default values, like DOS_VERSION. You must
  565.   be careful since any action against that setting is treated as a
  566.   replacement (even if you are using the updateifexist duplicateflag value).
  567.   So if you wanted to add one item to DOS_VERSION, you should also include all
  568.   of the existing values.
  569. 4) Some settings are new once you've installed the OS/2 V2 Service Pack or
  570.   upgraded to OS/2 V2.1. As well some may not be on your workstation due to
  571.   your hardware configuration, for instance use of VIDEO_8514A_XGA_IOTRAP
  572.   is only available on certain systems.
  573. 5) WIN-OS2 Settings are new to V2 users and appear once the Service Pack is
  574.   installed or you have upgraded to OS/2 V2.1. Refer to the section
  575.   "Global WIN-OS2 Settings" for more information.
  576.  
  577. List of DOS and WIN-OS2 Setting fields
  578. -----------------------------------------------------------------------------
  579. Keyname                   Values and notes about usage
  580.                           (<>'s are used to signify default setting for some)
  581.                           (Remember 1=on and 0=off for those that us on/off)
  582. -----------------------------------------------------------------------------
  583. WIN_RUNMODE               Use the PROGTYPE parameter mentioned previously
  584.                           to define a enhanced mode WIN-OS2 program (Also
  585.                           see note 5 from above)
  586. WIN_DDE                   (See note 5 above)
  587. WIN_CLIPBOARD             (See note 5 above)
  588. AUDIO_ADAPTER_SHARING     On Off
  589. COM_DIRECT_ACCESS         On <Off>
  590. COM_HOLD                  On <Off>
  591. COM_RECEIVE_BUFFER_FLUSH  Valid settings: <NONE>
  592.                                            ALL
  593.                                            RECEIVE DATA INTERRUPT ENABLE
  594.                                            SWITCH TO FOREGROUND
  595. COM_SELECT                Valid settings: <ALL> COM1 COM2 COM3 COM4 NONE
  596. DOS_AUTOEXEC              C:\AUTOEXEC.BAT
  597.                           Use full BATch filename also you can pass parameters
  598. DOS_BACKGROUND_EXECUTION  <On> Off
  599. DOS_BREAK                 On <Off>
  600. DOS_DEVICE                Default: empty
  601.                           Remember to separate any used with "," for newline
  602. DOS_FCBS                  Limits: 0-255, default 16
  603. DOS_FCBS_KEEP             Limits: 0-255, default 8
  604. DOS_FILES                 Limits: 20-255, default 20
  605. DOS_HIGH                  On <Off>
  606. DOS_LASTDRIVE             Limits: last physical drive to Z, default Z
  607. DOS_RMSIZE                Limits: 128-640, default 640, increments of 16
  608. DOS_SHELL                 Default: "?:\OS2\MDOS\COMMAND.COM "
  609.                                    "?:\OS2\MDOS\ /P" where ?
  610.                                     is the boot drive
  611. DOS_STARTUP_DRIVE         Default: empty
  612.                           Accepts text; like A: or C:\DISKS\DRDOS.IMG
  613. DOS_UMB                   On <Off>
  614. DOS_VERSION               Default: DCJSS02.EXE,3,40,255
  615.                                    DFIA0MOD.SYS,3,40,255
  616.                                    DXMA0MOD.SYS,3,40,255
  617.                                    IBMCACHE.COM,3,40,255
  618.                                    IBMCACHE.SYS,3,40,255
  619.                                    ISAM.EXE,3,40,255
  620.                                    ISAM2.EXE,3,40,255
  621.                                    ISQL.EXE,3,40,255
  622.                                    NET3.COM,3,40,255
  623.                                    EXCEL.EXE,10,10,4
  624.                                    PSCPG.COM,3,40,255
  625.                                    SAF.EXE,3,40,255
  626.                                    WIN200.BIN,10,10,4
  627.                           Remember what you put here will replace the existing
  628.                           list of items so be careful, also remember to use
  629.                           carats in front of any commas you need.
  630.                           Example:
  631.                           'SET DOS_VERSION=IBMCACHE.SYS^,3^,40^,255;']],...
  632. DPMI_DOS_API              Valid settings: <AUTO>  ENABLED  DISABLED
  633. DPMI_MEMORY_LIMIT         Limits: 0-512, default 4
  634. DPMI_NETWORK_BUFF_SIZE    Limits: 1-64, default 8
  635. EMS_FRAME_LOCATION        Valid settings: <AUTO> NONE C000 C400 C800 CC00
  636.                                                       D000 D400 D800 DC00
  637.                                                       8000 8400 8800 8C00 9000
  638. EMS_HIGH_OS_MAP_REGION    Limits: 0-96, default 32, note increments of 16
  639. EMS_LOW_OS_MAP_REGION     Limits: 0-576, default 384, note increments of 16
  640. EMS_MEMORY_LIMIT          Limits: 0-32768, default 2048, note increments of 16
  641. HW_NOSOUND                On <Off>
  642. HW_ROM_TO_RAM             On <Off>
  643. HW_TIMER                  On <Off>
  644. IDLE_SECONDS              Limits: 0-60, default 0
  645. IDLE_SENSITIVITY          Limits: 1-100, default 75
  646. INT_DURING_IO             On <Off>
  647. KBD_ALTHOME_BYPASS        On <Off>
  648. KBD_BUFFER_EXTEND         <On> Off
  649. KBD_CTRL_BYPASS           Valid settings: <NONE>  ALT_ESC  CTRL_ESC
  650. KBD_RATE_LOCK             On <Off>
  651. MEM_EXCLUDE_REGIONS       Initially empty, you can specify a range of memory
  652.                           to exclude or you can supply a singe address for the
  653.                           beginning of a 4KB region, if you need several
  654.                           regions separate them with a comma (don't forget to
  655.                           use the carat since commas are special setup string
  656.                           parameters) Example:
  657.                           'SET MEM_EXCLUDE_REGIONS=C0000^,D0000-D8000;']],
  658. MEM_INCLUDE_REGIONS       Initially empty, you can specify a range of memory
  659.                           to include or you can supply a singe address for the
  660.                           beginning of a 4KB region, if you need several
  661.                           regions separate them with a comma (don't forget to
  662.                           use the carat since commas are special setup string
  663.                           parameters) Example:
  664.                           'SET MEM_INCLUDE_REGIONS=C0000^,D0000-D7FFF;']],
  665.                           NOTE: The include region D0000-D80000 will include
  666.                                 the entire memory between D8000 and D8FFFF.
  667. MOUSE_EXCLUSIVE_ACCESS    On <Off>
  668. NETWARE_RESOURCES         Valid settings: NONE  PRIVATE  GLOBAL
  669.                           Special note, you use the words to change the value
  670.                           BUT the string MUST be 7 characters long!
  671.                           Example:
  672.                           'SET NETWARE_RESOURCES=GLOBAL ;'
  673. PRINT_SEPARATE_OUTPUT     <On> Off
  674. PRINT_TIMEOUT             Limits: 0-3600, default 15
  675. TOUCH_EXCLUSIVE_ACCESS    On Off
  676. VIDEO_8514A_XGA_IOTRAP    <On> Off
  677. VIDEO_FASTPASTE           On <Off>
  678. VIDEO_MODE_RESTRICTION    Valid settings: <NONE>  CGA  MONO
  679.                           Special note, you use the words to change the value
  680.                           BUT the string MUST be 15 characters long!
  681.                           Example:
  682.                           'SET VIDEO_MODE_RESTRICTION=CGA            ;'
  683. VIDEO_ONDEMAND_MEMORY     <On> Off
  684. VIDEO_RETRACE_EMULATION   <On> Off
  685. VIDEO_ROM_EMULATION       <On> Off
  686. VIDEO_SWITCH_NOTIFICATION On <Off>
  687. VIDEO_WINDOW_REFRESH      Limits: 1-600, default 1
  688. XMS_HANDLES               Limits: 0-128, default 32
  689. XMS_MEMORY_LIMIT          Limits: 0-16384, default 2048, increment of 4
  690. XMS_MINIMUM_HMA           Limits: 0-63, default 0
  691. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  692. <<Association>>
  693. ASSOCFILTER  filters         Sets the filename filter for files
  694.                              associated to this program.
  695.                              Multiple filters are separated by commas.
  696.                              See notes about preserving existing filter
  697.                              values following.
  698. ASSOCTYPE    type            Sets the type of files associated to this
  699.                              program. Multiple filters are separated
  700.                              by commas.
  701.                              See notes about preserving existing associate
  702.                              types following.
  703. * Preserving existing values *
  704.   When using ASSOCFILTER and/or ASSOCTYPE include two commas at the end of
  705.   your string to preserve any settings that are already applied:
  706.   Example: ... ASSOCTYPE=Metafile,PIF file,,;ASSOCFILTER=*.MET,*.PIF,,; ...
  707. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  708. <<Window>>
  709. MINWIN       HIDE            Views of this object will hide when their
  710.                              minimize button is selected.
  711.              VIEWER          Views of this object will minimize to the
  712.                              minimized window viewer when their minimize
  713.                              button is selected.
  714.              DESKTOP         Views of this object will minimize to the
  715.                              Desktop when their minimize button is selected.
  716. CCVIEW       YES             New views of this object will be created every
  717.                              time the user selects open.
  718.              NO              Open views of this object will resurface when
  719.                              the user selects open.
  720. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  721. <<General>>
  722.  
  723. ** See General and Miscellaneous section following ***
  724.  
  725. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  726. **General and Miscellaneous**
  727.   NOTE: Some keynames are valid for any objects. Here in this section many of
  728.   them are described. These can be used for the WPFolder and WPProgram objects.
  729. ICONFILE     filename        This sets the object's icon.
  730. ICONRESOURCE id,module       This sets the object's icon. 'id' is the
  731.                              identity of an icon resource in the 'module'
  732.                              dynamic link library (DLL). For example:
  733.                              ICONRESOURCE=73 PMWP;
  734.                              This would indicate resource 73 in PMWP.DLL.
  735.                              See a supplied sample command file for more info.
  736. ICONPOS      x,y             This sets the object's initial icon position.
  737.                              The x and y values represent the position in
  738.                              the object's folder in percentage coordinates.
  739. ICONVIEWPOS  w,x,y,z         This sets the object's initial size. The values
  740.                              represent relative position in percentage
  741.                              coordinates. For example: ICONPOS=25 25 50 50
  742.                              Would create a folder whose bottom left corner is
  743.                              25% from the left and 25% from the bottom and half
  744.                              the screen width/height.
  745. TEMPLATE     YES             Creates object as a template.
  746.              NO              Resets objects template property.
  747. TITLE        value           Can be used to assign a name/title to an object.
  748. OBJECTID     <name>          This sets the object's identity. The object
  749.                              id will stay with the object even if it is
  750.                              moved or renamed. An object id is any unique
  751.                              string preceded with a '<' and terminated
  752.                              with a '>'. This may also be a real name
  753.                              specified as a fully qualified path name.
  754.                              IMPORTANT: For any object you create you should
  755.                              use a unique objectid! Do this for two reasons:
  756.                              1) If you use an objectid it signifies a unique
  757.                                 object that will not be recreated if you use
  758.                                 the "FailIfExists" flag in your Rexx call. Not
  759.                                 using an objectid would cause multiple objects
  760.                                 to be created if the same program was run
  761.                                 over and over.
  762.                              2) Should you need to later delete it or change
  763.                                 your object, you can use this objectid in your
  764.                                 Rexx call to refer to it.
  765.                              Also one should not use an objectid that starts
  766.                              with "WP_" as many OS/2 objects use those,
  767.                              consider those reserved characters.
  768. HELPPANEL    id              This sets the object's default help panel.
  769. HELPLIBRARY  filename        This sets the help library.
  770. OPEN         SETTINGS        Open settings view of object when created/updated.
  771.              DEFAULT         Open default view of object when created/updated.
  772.                              Don't forget for folder objects you can use
  773.                              OPEN with these values: ICON, TREE, DETAILS
  774. NODELETE     YES             Will not allow you to delete the object.
  775.              NO              Resets the object's no delete property.
  776. NOCOPY       YES             Will not allow you to make a copy.
  777.              NO              Resets the object's no copy property.
  778. NOMOVE       YES             Will not allow you to move the object to another
  779.                              folder, will create shadow on a move.
  780.              NO              Resets the object's no move property.
  781. NODRAG       YES             Will not allow you to drag the object.
  782.              NO              Resets the object's no drag property.
  783. NOLINK       YES             Will not allow you to create a shadow link.
  784.              NO              Resets the object's no link property.
  785. NOSHADOW     YES             Will not allow you to create a shadow link.
  786.              NO              Resets the object's no shadow property.
  787. NORENAME     YES             Will not allow you to rename the object.
  788.              NO              Resets the object's no rename property.
  789. NOPRINT      YES             Will not allow you to print it.
  790.              NO              Resets the object's no print property.
  791. NOTVISIBLE   YES             Will not display the object.
  792.              NO              Resets the object's not visible property.
  793. -----------------------------------------------------------------------------
  794.  
  795. ****************************
  796. ***WPShadow setup string ***
  797. ****************************
  798. A shadow object is a persistent link or reference to any other object. This
  799. is achieved by storing away the location and identity of the object that it
  800. is linked to and then rerouting all requests for help, context menus, and
  801. open views on to the object that it is linked to. Delete, Copy, and Move are
  802. the only action requests that are handled by the WPShadow object and are not
  803. rerouted to the linked object.
  804.  
  805. When you place objects into your Startup folder you should be placing a
  806. shadow object there. See the SHADOW sample code for an example of its usage.
  807.  
  808. These are the keyname-value pairs supported by the WPShadow class.
  809.  
  810. KEYNAME      VALUE           Description
  811. -----------------------------------------------------------------------------
  812. SHADOWID     <name> or       The value for this is an object's id (OBJECTID)
  813.              filename        or a fully qualified pathname of a directory,
  814.                              program file, or data file.
  815. Note: When creating a shadow object always use the OBJECTID= string to give
  816.       your object a unique id so that later you may refer to it, and
  817.       potentially delete it with SysDestroyObject.
  818.  
  819. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  820. ((END TEXT INFORMATION))
  821.  
  822. ((BEGIN REXX CMD SAMPLES))
  823.  
  824. - (FOLDER.CMD)  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  825.  
  826. /* FOLDER.CMD: Sample code using REXXUTIL function calls                */
  827. /*                                                                      */
  828. /* Builds a folder on the DeskTop and places some program objects in it.*/
  829. /*                                                                      */
  830. /* Demonstrates use of these REXXUTIL functions:                        */
  831. /*   SysCreateObject   - create or update an object                     */
  832. /*   SysDestroyObject  - delete an object                               */
  833. /*   SysSetObjectData  - update an existing object                      */
  834. /*                                                                      */
  835. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  836. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  837. /* Version 1.1                                                          */
  838.  
  839. /* Load REXXUTIL */
  840. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  841. Signal on Syntax Name LoadCheck
  842. Call SysLoadFuncs
  843. LoadCheck: /* rc of 43 means REXXUTILs not found */
  844. If rc=43 Then Do
  845.    Say ''
  846.    Say 'ERROR: Not able to load REXXUTILs. Perhaps REXX not installed or'
  847.    Say '       REXXUTIL.DLL not found in a LIBPATH drive/directory.'
  848.    Exit
  849. End
  850. Signal off Syntax
  851.  
  852. call SysCls
  853. Say '';Say 'Using REXXUTILs to Add a Folder and Program Objects...'
  854.  
  855. Say '';Say 'Press Y to add Test Folder to Desktop...';Say '';
  856. parse upper value SysGetKey('NOECHO') with key
  857. If key<>'Y' Then Signal Exiter
  858.  
  859. /* All of the routines pass parameters to a subroutine to perform the call */
  860. classname='WPFolder'
  861. title    ='Test Folder'
  862. location ='<WP_DESKTOP>'
  863. setup    ='OBJECTID=<TEST_FOLDER>;'
  864. Call BldObj
  865.  
  866. Say '';
  867. Say 'Press ENTER and we will open up that folder and watch as other objects'
  868. Say 'are added into it.'
  869. key=SysGetKey()
  870. Call SysSetObjectData '<TEST_FOLDER>', 'OPEN=DEFAULT;'
  871.  
  872. Say 'Place a program object into the folder...';Say '';
  873. classname='WPProgram'
  874. title    ='SYSLEVEL-FULLSCR'
  875. location ='<TEST_FOLDER>'
  876. setup    ='OBJECTID=<TEST_SYSL>;']],
  877.           'EXENAME=\OS2\SYSLEVEL.EXE;']],
  878.           'PROGTYPE=FULLSCREEN;'
  879. Call BldObj
  880.  
  881. classname='WPProgram'
  882. title    ='CHKDSK-PM'
  883. location ='<TEST_FOLDER>'
  884. setup    ='OBJECTID=<TEST_PMCK>;']],
  885.           'EXENAME=\OS2\PMCHKDSK.EXE;']],
  886.           'MINIMIZED=YES;']],
  887.           'PROGTYPE=PM;'
  888. Call BldObj
  889.  
  890. classname='WPProgram'
  891. title    ='SYSLEVEL-VIO'
  892. location ='<TEST_FOLDER>'
  893. setup    ='OBJECTID=<TEST_SYSLVIO>;']],
  894.           'EXENAME=\OS2\SYSLEVEL.EXE;']],
  895.           'PROGTYPE=WINDOWABLEVIO;'
  896. Call BldObj
  897.  
  898. classname='WPProgram'
  899. title    ='MEM-Fullscreen'
  900. location ='<TEST_FOLDER>'
  901. setup    ='OBJECTID=<TEST_MEMFUL>;']],
  902.           'EXENAME=\OS2\MDOS\MEM.EXE;']],
  903.           'PROGTYPE=VDM;']],
  904.           'PARAMETERS=/?;']],
  905.           'NOAUTOCLOSE=YES;'
  906. Call BldObj
  907.  
  908. classname='WPProgram'
  909. title    ='MEM-WindowVDM'
  910. location ='<TEST_FOLDER>'
  911. setup    ='OBJECTID=<TEST_MEMWIN>;']],
  912.           'EXENAME=\OS2\MDOS\MEM.EXE;']],
  913.           'PROGTYPE=WINDOWEDVDM;']],
  914.           'PARAMETERS=/?;']],
  915.           'NOAUTOCLOSE=YES;'
  916. Call BldObj
  917.  
  918. Say ''
  919. Say 'Okay, now lets change the title of the folder using SysSetObjectData.'
  920. Say 'Press ENTER and watch the folder get renamed...'
  921. key=SysGetKey()
  922. Call SysSetObjectData '<TEST_FOLDER>',  'TITLE=System Stuff';
  923.  
  924. Say ''
  925. Say 'All done, now we will remove the objects by using...'
  926. Say '...the SysDestroyObject call against the folder objectid.'
  927. Say 'Note: If you delete a folder all objects contained within are removed.'
  928. Say 'Press ENTER to watch the objects disappear...'
  929. key=SysGetKey()
  930. Call SysDestroyObject '<TEST_FOLDER>'
  931.  
  932. Exiter:
  933. Call SysDropFuncs
  934. Exit
  935.  
  936. /* Build Object */
  937. BldObj:
  938. call charout ,'Building: 'title
  939.  
  940. /*The basic call is listed next.                                           */
  941. /*rc=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>)*/
  942.  
  943. /* Build object using UPDATEIFEXIST as duplicateflag */
  944. result = SysCreateObject(classname, title, location, setup, 'U')
  945.  
  946. If result=1 Then call charout ,'...   Object created!'
  947. Else             call charout ,'...   Not created! Return code='result
  948.  
  949. Say '';
  950. Return
  951.  
  952. - (SHADOW.CMD)  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  953.  
  954. /* SHADOW.CMD: Sample code using REXXUTIL function calls                */
  955. /*                                                                      */
  956. /* Builds shadows in the DeskTop and Startup Folder                     */
  957. /*                                                                      */
  958. /* Demonstrates use of these REXXUTIL functions:                        */
  959. /*   SysCreateObject   - create or update an object                     */
  960. /*   SysDestroyObject  - delete an object                               */
  961. /*   SysSetObjectData  - update an existing object                      */
  962. /*                                                                      */
  963. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  964. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  965. /* Version 1.1                                                          */
  966.  
  967. /* Load REXXUTIL */
  968. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  969. Signal on Syntax Name LoadCheck
  970. Call SysLoadFuncs
  971. LoadCheck: /* rc of 43 means REXXUTILs not found */
  972. If rc=43 Then Do
  973.    Say ''
  974.    Say 'ERROR: Not able to load REXXUTILs. Perhaps REXX not installed or'
  975.    Say '       REXXUTIL.DLL not found in a LIBPATH drive/directory.'
  976.    Exit
  977. End
  978. Signal off Syntax
  979.  
  980. Call SysCls
  981. Say '';Say 'Demonstration using REXXUTILs to Add Shadow Objects...'
  982.  
  983. /* The titles and objectid's are found from the \OS2\INI.RC file */
  984.  
  985. Say '';Say 'First lets place some items on the Desktop...'
  986. Call AddShad 'Enhanced Editor',,  /* Title */
  987.              '<WP_DESKTOP>',,     /* Location for shadow object */
  988.              '<WP_EPM>',,         /* Value of existing objectid or file */
  989.              '<SHAD_WP_EPM>'      /* New unique value of this shadow object */
  990.  
  991. Call AddShad 'OS/2 Window',,      /* Title */
  992.              '<WP_DESKTOP>',,     /* Location for shadow object */
  993.              '<WP_OS2WIN>',,      /* Value of existing objectid or file */
  994.              '<SHAD_WP_OS2WIN>'   /* New unique value of this shadow object */
  995.  
  996. Call AddShad 'OS/2 DeskTop',,     /* Title */
  997.              '<WP_DESKTOP>',,     /* Location for shadow object */
  998.              '<WP_DESKTOP>',,     /* Value of existing objectid or file */
  999.              '<SHAD_WP_DESKTOP>'  /* New unique value of this shadow object */
  1000.  
  1001. Say '';Say 'You can even make shadow objects of files...'
  1002. Call AddShad 'CONFIG.SYS',,       /* Title */
  1003.              '<WP_DESKTOP>',,     /* Location for shadow object */
  1004.              'C:\CONFIG.SYS',,    /* Value of data file */
  1005.              '<SHAD_CONFIG_SYS>'  /* New unique value of this shadow object */
  1006.  
  1007. Say '';Say 'Now lets place an item in the Startup Folder...'
  1008. Say 'First would you like me to open the Startup Folder so you can see the'
  1009. Say 'object being created? Press Y to open the folder.'
  1010. parse upper value SysGetKey('NOECHO') with key
  1011. If key='Y' Then Call SysSetObjectData '<WP_START>', 'OPEN=DEFAULT;'
  1012.  
  1013. Call AddShad 'System Clock',,     /* Title */
  1014.              '<WP_START>',,       /* Location for shadow object */
  1015.              '<WP_CLOCK>',,       /* Value of existing objectid of file */
  1016.              '<SHAD_WP_CLOCK>'    /* New unique value of this shadow object */
  1017.  
  1018. Say '';Say 'All done, if you would like me to remove the objects press R'
  1019. parse upper value SysGetKey('NOECHO') with key
  1020. If key='R' Then Do
  1021.    Call SysDestroyObject '<SHAD_WP_EPM>'
  1022.    Call SysDestroyObject '<SHAD_WP_OS2WIN>'
  1023.    Call SysDestroyObject '<SHAD_WP_CLOCK>'
  1024.    Call SysDestroyObject '<SHAD_WP_DESKTOP>'
  1025.    Call SysDestroyObject '<SHAD_CONFIG_SYS>'
  1026. End
  1027.  
  1028. Say '';Say 'Demonstration over...'
  1029. Exiter:
  1030. Call SysDropFuncs
  1031. Exit
  1032.  
  1033. /* Routine to create a shadow object when passed arguments: */
  1034. /* Title, Location, ShadowId, and ObjectId                  */
  1035. AddShad:
  1036. Parse arg title,loc,shadowid,objectid
  1037. Say '';Say 'Press Y to add shadow object: 'title' to 'loc
  1038. parse upper value SysGetKey('NOECHO') with key
  1039. If key='Y' Then Do
  1040.    setup='SHADOWID='shadowid';OBJECTID='objectid';'
  1041.  
  1042.    /*The basic call is listed next.                                         */
  1043.    /*rc=SysCreateObject(classname,title,location <,setup>, <,duplicateflag>)*/
  1044.  
  1045.    /* Build object using FAIL as duplicateflag */
  1046.    result=SysCreateObject('WPShadow', title, loc, setup, 'F')
  1047.  
  1048.    If result=1 Then Say 'Object created'
  1049.    Else             Say 'Not created, return code='result
  1050. End
  1051. Return
  1052.  
  1053. - (FLDSHAD.CMD)  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1054.  
  1055. /* FLDSHAD.CMD: Sample code using REXXUTIL function calls               */
  1056. /*                                                                      */
  1057. /* Builds a folder on the DeskTop places a program object in it then    */
  1058. /* places a shadow of the program object on the DeskTop.                */
  1059. /*                                                                      */
  1060. /* Demonstrates use of these REXXUTIL functions:                        */
  1061. /*   SysCreateObject   - create or update an object                     */
  1062. /*   SysDestroyObject  - delete an object                               */
  1063. /*   SysSetObjectData  - update an existing object                      */
  1064. /*                                                                      */
  1065. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  1066. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  1067. /* Version 1.1                                                          */
  1068.  
  1069. /* Load REXXUTIL */
  1070. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  1071. Signal on Syntax Name LoadCheck
  1072. Call SysLoadFuncs
  1073. LoadCheck: /* rc of 43 means REXXUTILs not found */
  1074. If rc=43 Then Do
  1075.    Say ''
  1076.    Say 'ERROR: Not able to load REXXUTILs. Perhaps REXX not installed or'
  1077.    Say '       REXXUTIL.DLL not found in a LIBPATH drive/directory.'
  1078.    Exit
  1079. End
  1080. Signal off Syntax
  1081.  
  1082. /*The basic call is listed next.                                           */
  1083. /*rc=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>)*/
  1084.  
  1085. call SysCls
  1086. Say '';Say 'Using REXXUTILs to Add Folder/Program/Shadow Objects...'
  1087.  
  1088. Say '';Say 'Press Y to add Test Folder to Desktop...';Say '';
  1089. parse upper value SysGetKey('NOECHO') with key
  1090. If key<>'Y' Then Signal Exiter
  1091.  
  1092. classname='WPFolder'
  1093. title    ='Test Folder'
  1094. location ='<WP_DESKTOP>'
  1095. setup    ='OBJECTID=<TEST2_FOLDER>'
  1096. Call BldObj
  1097.  
  1098. Say '';
  1099. Say 'Press ENTER and we will open up that folder and watch as an object'
  1100. Say 'is added into it.'
  1101. key=SysGetKey()
  1102. Call SysSetObjectData '<TEST2_FOLDER>', 'OPEN=DEFAULT;'
  1103.  
  1104. classname='WPProgram'
  1105. title    ='SYSLEVEL-VIO'
  1106. location ='<TEST2_FOLDER>'
  1107. setup    ='OBJECTID=<TEST2_SYSLVIO>;']],
  1108.           'EXENAME=\OS2\SYSLEVEL.EXE;']],
  1109.           'PROGTYPE=WINDOWABLEVIO;'
  1110. Call BldObj
  1111.  
  1112. Say '';
  1113. Say 'Press ENTER and we will place a shadow of the new object on the Desktop.'
  1114. key=SysGetKey()
  1115.  
  1116. classname='WPShadow'
  1117. title    ='SYSLEVEL-VIO'
  1118. location ='<WP_DESKTOP>'
  1119. setup    ='SHADOWID=<TEST2_SYSLVIO>;OBJECTID=<SHAD_TEST2_SYSLVIO>;'
  1120. Call BldObj
  1121.  
  1122. Say ''
  1123. Say 'All done, now we will remove the objects by using...'
  1124. Say '...the SysDestroyObject call.'
  1125. Say 'Note: If you delete a folder all objects contained within are removed.'
  1126. Say 'Press ENTER to watch the objects disappear...'
  1127. key=SysGetKey()
  1128. Call SysDestroyObject '<SHAD_TEST2_SYSLVIO>'
  1129. Call SysDestroyObject '<TEST2_FOLDER>'
  1130.  
  1131. Exiter:
  1132. Call SysDropFuncs
  1133. Exit
  1134.  
  1135. /* Build Object */
  1136. BldObj:
  1137. call charout ,'Building: 'title
  1138.  
  1139. /*The basic call is listed next.                                            */
  1140. /*rc=SysCreateObject(classname, title, location <,setup>, <,duplicateflag>) */
  1141.  
  1142. /* Build object using UPDATEIFEXIST as duplicateflag */
  1143. result = SysCreateObject(classname, title, location, setup, 'U')
  1144.  
  1145. If result=1 Then call charout ,'...   Object created!'
  1146. Else             call charout ,'...   Not created! Return code='result
  1147.  
  1148. Say '';
  1149. Return
  1150.  
  1151. - (MKSHAD.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1152.  
  1153. /* MKSHAD.CMD: Sample code using REXXUTIL function calls                */
  1154. /*                                                                      */
  1155. /* Builds shadows when passed names of files, drive/directories, or     */
  1156. /* existing objectid of WorkPlace Shell objects.                        */
  1157. /*                                                                      */
  1158. /* Enter: MKSHAD ?   for more information                               */
  1159. /*                                                                      */
  1160. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  1161. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  1162. /* Version 1.0                                                          */
  1163. /* Load REXXUTIL */
  1164. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  1165. Signal on Syntax Name LoadCheck
  1166. Call SysLoadFuncs
  1167. LoadCheck: /* rc of 43 means REXXUTILs not found */
  1168. If rc=43 Then Do
  1169.    Say ''
  1170.    Say 'ERROR: Not able to load REXXUTILs. Perhaps REXX not installed or'
  1171.    Say '       REXXUTIL.DLL not found in a LIBPATH drive/directory.'
  1172.    Exit
  1173. End
  1174. Signal off Syntax
  1175. Parse arg name loc how
  1176. If name='?' ] translate(name)='HELP' Then Signal Helper
  1177. yes=1;no=0;
  1178. name=strip(name,'B','"')
  1179. loc=strip(loc,'B','"')
  1180. how=strip(how,'B','"')
  1181. hname=name
  1182. /* Default is to prompt before creating shadow unless /N is passed */
  1183. If translate(how)='/N' Then Do,
  1184.    how=''; quiet=yes;
  1185. End
  1186. Else If translate(loc)='/N' Then Do
  1187.    loc=''; quiet=yes;
  1188. End
  1189. Else If translate(name)='/N' Then Do
  1190.    name=''; quiet=yes;
  1191. End
  1192. Else quiet=no;
  1193. /* If no parm is passed assume need current directory shadowed on desktop */
  1194. If name='' Then name=directory()
  1195. /* Passing an objectid to be shadowed */
  1196. Else If left(name,1)='<' & right(name,1)='>' Then Do
  1197.      /* Check to see if it exists, build a list of all existing objectids */
  1198.      App='PM_Workplace:Location'
  1199.      call SysIni 'USER', App, 'All:', 'ObjIDTab'
  1200.      Do t=1 to ObjIDTab.0
  1201.         If name=ObjIDTab.t Then leave
  1202.      End
  1203.      If name<>ObjIDTab.t Then Do
  1204.         Say 'ERROR! Objectid:' name' not found'
  1205.         Signal Exiter
  1206.      End
  1207. End
  1208. Else Do
  1209.    /* If this file exists then no need to check other possibilities */
  1210.    Fname=stream(name,'C','Q EXISTS')
  1211.    If fname<>'' Then name=fname /* fully qualified name is returned */
  1212.    Else Do /* Must be a drive/directory passed */
  1213.       If right(name,1)<>'\' Then name=name]]'\'
  1214.       name=filespec('drive',name)]]filespec('path',name)
  1215.       name=strip(name,'T','\')
  1216.       If right(name,1)=':' Then name=name]]'\'
  1217.       Call SysFileTree name, mystem, 'D'
  1218.       If mystem.0=0 Then Do
  1219.          Say 'Sorry, cannot tell what should be shadowed.'
  1220.          Say 'The value:' hname
  1221.          Say 'Is not a file nor drive/directory that exists.'
  1222.          Signal Exiter
  1223.       End
  1224.    End
  1225. End
  1226. /* Location processing */
  1227. If loc<>'' Then Do
  1228.    /* Check to see if location exists, build list of all existing objectids */
  1229.    App='PM_Workplace:Location'
  1230.    call SysIni 'USER', App, 'All:', 'ObjIDTab'
  1231.    Do t=1 to ObjIDTab.0
  1232.       If loc=ObjIDTab.t Then leave
  1233.    End
  1234.    If loc<>ObjIDTab.t Then Do
  1235.       Say 'WARNING! Location:' loc' not found'
  1236.       Say 'Will create shadow on DeskTop instead.'
  1237.       loc='<WP_DESKTOP>'
  1238.    End
  1239. End
  1240. Else loc='<WP_DESKTOP>'
  1241. /* If an objectid then strip < character, leave end in */
  1242. If left(name,1)='<' & right(name,1)='>' Then obj='<SHAD_'strip(name,'B','<')
  1243. Else obj='<SHAD_'name'>'
  1244. If quiet=no Then Do
  1245.    Say 'Create a shadow of      :' name
  1246.    Say 'Location to be created  :' loc
  1247.    Say 'Objectid for the object :' obj
  1248.    Say 'To create press C any other key ends the program'
  1249.    parse upper value SysGetKey('NOECHO') with key
  1250.    If key<>'C' Then Signal Exiter
  1251. End
  1252. setup='SHADOWID='name';OBJECTID='obj';'
  1253. result=SysCreateObject('WPShadow', ' ', loc, setup, 'U')
  1254. If quiet=no Then Do
  1255.    If result=1 Then Say 'Shadow object created'
  1256.    Else             Say 'Not created, return code='result
  1257. End
  1258. /* Common exit point */
  1259. Exiter:
  1260. Call SysDropFuncs
  1261. Exit
  1262. /* Help Routine */
  1263. Helper:
  1264. Say '** MKSHAD ** Make a shadow object'
  1265. Say 'Syntax: MKSHAD ╒nameσ ╒locationσ ╒/nσ'
  1266. Say 'If no parameters are passed it is assumed you want the current drive'
  1267. Say 'and directory shadowed to the DeskTop.'
  1268. Say 'Otherwise you can specify the name of an existing objectid, and existing'
  1269. Say 'file, or drive/directory to be shadowed. Followed by the location of'
  1270. Say 'where the shadow should be placed. If no location is specified then the'
  1271. Say 'DeskTop is assumed. The location should be an existing objectid of a'
  1272. Say 'folder and should be enclosed in double quotes, i.e. "<WP_STARTUP>"'
  1273. Say 'Look at your \OS2\INI.RC for many existing objectids for system objects.'
  1274. Say 'If you use /N then you are not prompted for confirmation, the object'
  1275. Say 'will immediately be created.'
  1276. Say '---Examples---'
  1277. Say ' MKSHAD C:\OS2'
  1278. Say ' - Shadow of C:\OS2 directory placed on the DeskTop.'
  1279. Say ' MKSHAD "<WP_OS2WIN>" "<WP_STARTUP>"'
  1280. Say ' - Shadow of OS/2 Window object placed into Startup folder.'
  1281. Say ' MKSHAD C:\CONFIG.SYS /n'
  1282. Say ' - Shadow of CONFIG.SYS placed on the DeskTop, no prompts.'
  1283. Say ' MKSHAD C:\OS2\MDOS\WINOS2\README.ATM "<WP_INFO>"'
  1284. Say ' - Shadow of README.ATM placed in the Information folder.'
  1285. Signal Exiter
  1286.  
  1287. - (STARTDOS.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1288.  
  1289. /* STARTDOS.CMD: Sample code using REXXUTIL's SysCreateObject function  */
  1290. /* Starts a DOS program using specific DOS VDM settings.  This is       */
  1291. /* particularly useful for LAN execution that requires NET USE commands.*/
  1292. /* The example invokes the PKZIP.EXE program using files setting of 45  */
  1293. /* Rick McGuire:  MCGUIRE/GDLVM7                                        */
  1294. /* Load REXXUTIL */
  1295. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  1296. call sysloadfuncs
  1297.  
  1298. /* The basic call is listed next.                                          */
  1299. /* result = SysCreateObject(classname, title, location, setup)             */
  1300.  
  1301. classname='WPProgram'
  1302. title='My DOS Program'
  1303. location='<WP_NOWHERE>'                  /* place in invisible folder      */
  1304. program='EXENAME=C:\PKZIP.EXE;'          /* DOS program name               */
  1305. type='PROGTYPE=WINDOWEDVDM;'             /* type of DOS session (windowed) */
  1306. startup='STARTUPDIR=C:\;'                /* startup directory              */
  1307. settings='SET DOS_FILES=45;'             /* required DOS settings          */
  1308. open='OPEN=DEFAULT;'                     /* open now                       */
  1309.  
  1310. call SysCreateObject classname, title, location,,
  1311.     program]]type]]startup]]settings]]open, 'REPLACE'
  1312. Return
  1313.  
  1314. - (BOOTDOS.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1315.  
  1316. /* BOOTDOS.CMD: Sample code using REXXUTIL's SysCreateObject function   */
  1317. /* Starts a DOS session, booting from a specific DOS image with         */
  1318. /* specific DOS VDM settings.                                           */
  1319. /* Rick McGuire:  MCGUIRE/GDLVM7                                        */
  1320. /* Load REXXUTIL */
  1321. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  1322. call sysloadfuncs
  1323.  
  1324. /* The basic call is listed next.                                          */
  1325. /* result = SysCreateObject(classname, title, location, setup)             */
  1326.  
  1327. classname='WPProgram'
  1328. title='Booted DR DOS'
  1329. location='<WP_NOWHERE>'                  /* place in invisible folder      */
  1330. program='EXENAME=*;'                     /* DOS program name (use shell)   */
  1331. type='PROGTYPE=WINDOWEDVDM;'             /* type of DOS session (windowed) */
  1332. image='C:\DRDOS.VM;'                     /* DOS image file                 */
  1333.                                          /* required DOS settings          */
  1334. settings='SET DOS_BACKGROUND_EXECUTION=ON;'
  1335. open='OPEN=DEFAULT;'                     /* open now                       */
  1336.  
  1337. call SysCreateObject classname, title, location,,
  1338.     program]]type]]image]]settings]]open, 'REPLACE'
  1339. Return
  1340.  
  1341. - (REBUILD.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1342.  
  1343. /* REBUILD.CMD: Sample code using REXXUTIL's SysCreateObject function   */
  1344. /* Can be used to rebuild objects created during the installation of    */
  1345. /* your OS/2 system. The \OS2\INSTALL\INI.RC file contains information  */
  1346. /* that can be used by the SysCreateObject function.                    */
  1347. /* The INI.RC file is used by MAKEINI.EXE to create your OS2.INI file   */
  1348. /*                                                                      */
  1349. /* Syntax:  Enter  "REBUILD ?" for complete syntax                      */
  1350. /*                                                                      */
  1351. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  1352. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  1353. /* Version 1.1                                                          */
  1354.  
  1355. '@ECHO OFF'
  1356. /* Load REXXUTIL */
  1357. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  1358. Signal on Syntax Name LoadCheck
  1359. Call SysLoadFuncs
  1360. LoadCheck: /* rc of 43 means REXXUTILs not found */
  1361. If rc=43 Then Do
  1362.    Say ''
  1363.    Say 'ERROR: Not able to load REXXUTILs. Perhaps REXX not installed or'
  1364.    Say '       REXXUTIL.DLL not found in a LIBPATH drive/directory.'
  1365.    Exit
  1366. End
  1367. Signal off Syntax
  1368.  
  1369. Arg parms
  1370. cmdparms=parms /* Save command line parms for later processing */
  1371.  
  1372. /* Until REXXUTIL offers a function call to retrieve the OS2 boot drive   */
  1373. /* we assume the environment variable COMSPEC has location of boot drive. */
  1374. BtDrv=filespec('drive',value('COMSPEC',,'OS2ENVIRONMENT'))
  1375.  
  1376. parse upper var cmdparms type '(' inifile .
  1377. /* If user does not enter location of *.RC file then try to find it */
  1378. If inifile='' Then inifile=BtDrv]]'\OS2\INI.RC'
  1379. rcx=stream(inifile,'C','Q EXISTS')
  1380. If rcx='' Then Do
  1381.    Say '';Say '';Say inifile 'not found'
  1382.    Signal Exiter
  1383. End
  1384. type=left(type,1)
  1385. If verify(type,'FPOA') Then Signal Helper
  1386.  
  1387. /* Initialize tables and table counters */
  1388. iniftab.=''; iniptab.='' iniotab.=''; /*Folders, Programs, Others */
  1389. iniflns=0;   iniplns=0;  iniolns=0;
  1390. initab.='';  inilns=0;
  1391. Call stream inifile,'C','CLOSE'
  1392. Do while lines(inifile)>0  /* Read RC file into tables */
  1393.    lne=linein(inifile)
  1394.    parse var lne '"PM_InstallObject"' lne
  1395.    If lne\='' Then Do
  1396.       parse var lne '"'rest1'" 'lne
  1397.       parse var lne '"'setup'"'
  1398.       parse var rest1 title';'object';'location';'
  1399.       If object='WPFolder' Then Do
  1400.          iniflns=iniflns+1
  1401.          iniftab.1.iniflns=object;   iniftab.2.iniflns=title;
  1402.          iniftab.3.iniflns=location; iniftab.4.iniflns=setup;
  1403.       End
  1404.       Else If object='WPProgram' Then Do
  1405.          iniplns=iniplns+1
  1406.          iniptab.1.iniplns=object;   iniptab.2.iniplns=title;
  1407.          iniptab.3.iniplns=location; iniptab.4.iniplns=setup;
  1408.       End
  1409.       Else Do
  1410.          iniolns=iniolns+1
  1411.          iniotab.1.iniolns=object;   iniotab.2.iniolns=title;
  1412.          iniotab.3.iniolns=location; iniotab.4.iniolns=setup;
  1413.       End
  1414.    End
  1415. End
  1416. Call stream inifile,'C','CLOSE'
  1417.  
  1418. /* Calculation for screen loop */
  1419. parse value SysTextScreenSize() with row col
  1420. scrsz=row-12
  1421.  
  1422. If type='F' ] type='A' Then Do; /* Folder routine */
  1423.    objt='Folder'; inilns=iniflns;
  1424.    Do i=1 to inilns; Do j=1 to 4;
  1425.       initab.j.i=iniftab.j.i
  1426.    End; End;
  1427.    Call DispSel
  1428. End;
  1429. If type='P' ] type='A' Then Do; /* Program routine */
  1430.    objt='Program'; inilns=iniplns;
  1431.    Do i=1 to inilns; Do j=1 to 4;
  1432.       initab.j.i=iniptab.j.i
  1433.    End; End;
  1434.    Call DispSel
  1435. End;
  1436. If type='O' ] type='A' Then Do; /* Other routine */
  1437.    objt='Other'; inilns=iniolns;
  1438.    Do i=1 to inilns; Do j=1 to 4;
  1439.       initab.j.i=iniotab.j.i
  1440.    End; End;
  1441.    Call DispSel
  1442. End;
  1443.  
  1444. Exiter: /* When get here done with processing */
  1445. Call SysDropFuncs
  1446. Exit
  1447.  
  1448. /* Routine to display objects and allow selection */
  1449. DispSel:
  1450. key=''
  1451. Do while key\='Q'
  1452.    Call SysCls; Say '';Say objt' objects found in: 'inifile;Say '';
  1453.    Do i=1 to inilns
  1454.       If trunc(i/scrsz)==i/scrsz Then Call Promptx 1
  1455.       If key='Q' Then leave
  1456.       n=right('  ']]i,3)]]') ']]left(initab.2.i]]copies(' ',30),30)
  1457.       n=n]]left(initab.3.i]]copies(' ',20),20)
  1458.       Say n
  1459.    End
  1460.    If key\='Q' Then Call Promptx 0
  1461. End
  1462. Return
  1463.  
  1464. /* Screen loop routine also calls object build routine */
  1465. Promptx: Arg scr
  1466. Say '';Say 'To attempt to rebuild an object enter the number of the object'
  1467. If scr=0 Then Say 'or enter Q to quit...'
  1468. Else Say 'or press enter to show next screen...  Or enter Q to Quit...'
  1469. pull key .
  1470. If (key>=1) & (key <=inilns) then Do
  1471.     rcx=BldIt(initab.1.key,initab.2.key,initab.3.key,initab.4.key)
  1472.  
  1473.     /* Ask if want objects in folder rebuilt */
  1474.     If object='WPFolder' Then Do
  1475.        Say '';Say 'Press Y to recreate the program objects in this folder.'
  1476.        parse upper value SysGetKey('NOECHO') with ansr
  1477.        If ansr='Y' Then Do
  1478.           parse var setup 'OBJECTID='obj';'
  1479.           Do ii=1 to iniplns;
  1480.              If iniptab.3.ii=obj Then Do
  1481.                 rcx=BldIt(iniptab.1.ii,iniptab.2.ii,iniptab.3.ii,iniptab.4.ii)
  1482.              End
  1483.           End;
  1484.        End;
  1485.     End;
  1486.  
  1487. End;
  1488. If scr=1 Then Do;
  1489.    Call SysCls;Say '';Say objt' objects found in: 'inifile;Say '';
  1490. End;
  1491. Return
  1492.  
  1493. /* Routine to build object */
  1494. BldIt: Parse Arg object,title,location,setup
  1495. Say 'Command generated:'
  1496. Say 'SysCreateObject('object', 'title', 'location', 'setup', U)'
  1497. /* Build object using UPDATE as duplicateflag */
  1498. result = SysCreateObject(object, title, location, setup, 'U')
  1499. If result=1 Then Say '...   Object created!'
  1500. Else             Say '...   Not created! Return code='result
  1501. Say '';Say 'Press any key to continue...'
  1502. SysGetKey('NOECHO')
  1503. Return result
  1504.  
  1505. /* Syntax help */
  1506. Helper:
  1507. call SysCls
  1508. Say '';Say ''; Say 'REBUILD:'
  1509. Say 'Routine to rebuild system installed objects listed in *.RC files.'
  1510. Say 'Can be used as an alternative to using the MAKEINI command.'
  1511. Say 'Your INI.RC file is used by MAKEINI.EXE during installation to'
  1512. Say 'create your OS2.INI file.'
  1513. Say ''; Say 'Syntax:';Say '';
  1514. Say 'REBUILD object ╒(filespecσ'
  1515. Say '';Say 'Valid objects A(ll), F(olders), P(rograms), O(ther)'
  1516. Say 'Can also can use (filespec for name of *.RC file, default is \OS2\INI.RC'
  1517. Signal Exiter
  1518.  
  1519. - (LPTADD.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1520.  
  1521. /* LPTADD.CMD: Sample code using REXXUTIL's SysIni function.            */
  1522. /* Routine will expand the number of LPT ports the WorkPlace Shell      */
  1523. /* recognizes from LPT1-3 to LPT1-9. Also a routine to add LPT3-9 to    */
  1524. /* the WIN-OS2 WIN.INI file.                                            */
  1525. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  1526. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  1527. /* Version 1.0                                                          */
  1528. '@ECHO OFF'
  1529. /* Load REXXUTIL */
  1530. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  1531. call sysloadfuncs
  1532.  
  1533. /* The basic call for setting a single key value is listed next.        */
  1534. /* result = SysIni(╒inifileσ, app, key, val)                            */
  1535.  
  1536. call SysCls; Say '';
  1537. Say 'Using REXXUTILs SysIni call to add LPT4-9 to the WorkPlace Shell'
  1538. Say '';Say 'Press Y to add/initialize LPT4-9 ports...';Say '';
  1539. parse upper value SysGetKey('NOECHO') with key
  1540. If key='Y' Then Do
  1541.    Say 'LPT Ports: setting up for LPT4-9 ports...'
  1542.    Do n=4 to 9
  1543.       Say ' Setting up PM_LPT'n'...'
  1544.       rx=SysIni('SYSTEM', 'PM_SPOOLER_PORT', 'LPT'n, ';']]'00'x)
  1545.       If rx\='' Then Say 'LPT'n' Bad result='result
  1546.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'DESCRIPTION', 'LPT']]n]]'00'x)
  1547.       If rx\='' Then Say 'LPT'n' Bad result='result
  1548.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'INITIALIZATION', ';']]'00'x)
  1549.       If rx\='' Then Say 'LPT'n' Bad result='result
  1550.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'PORTDRIVER', 'PARALLEL;']]'00'x)
  1551.       If rx\='' Then Say 'LPT'n' Bad result='result
  1552.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'TERMINATION', ';']]'00'x)
  1553.       If rx\='' Then Say 'LPT'n' Bad result='result
  1554.       rx=SysIni('SYSTEM', 'PM_LPT'n,         'TIMEOUT', '45;']]'00'x)
  1555.       If rx\='' Then Say 'LPT'n' Bad result='result
  1556.    End
  1557.    Say 'LPT4-9 added... Press any key to continue...'
  1558.    SysGetKey('NOECHO')
  1559. End
  1560.  
  1561. call SysCls; Say '';
  1562. Say 'Can now attempt to add LPT3-9 to your WIN-OS2 WIN.INI file.'
  1563. Say '';Say 'Press Y to attempt to add LPT3-9 ports to WIN-OS2...';Say '';
  1564. parse upper value SysGetKey('NOECHO') with key
  1565. If key='Y' Then Do
  1566.   /* Change \OS2\MDOS\WINOS2\WIN.INI to add more ports LPT3-LPT9 */
  1567.   win.='';winnew.='';
  1568.   /* Until REXXUTIL offers a function call to retrieve the OS2 boot drive  */
  1569.   /* we assume the environment variable COMSPEC has location of boot drive. */
  1570.   BtDrv=filespec('drive',value('COMSPEC',,'OS2ENVIRONMENT'))
  1571.   fn=BtDrv'\OS2\MDOS\WINOS2\WIN.INI';
  1572.   fnx=stream(fn,'C','QUERY EXISTS')
  1573.   fn=fnx;
  1574.   If fn\='' Then Do /* If file exists then process adding extra ports */
  1575.      Call stream fn,'C','CLOSE'
  1576.      Do i=1 to 10000 while LINES(fn)>0
  1577.         parse value linein(fn) with win.i
  1578.      End
  1579.      Call stream fn,'C','CLOSE'
  1580.      i=i-1; k=0;
  1581.      Do j=1 to i /* Look for FILE:= then if line before = LPT2.OS2= add 3-9 */
  1582.         If win.j='FILE:=' Then Do
  1583.            m=j-1; winchg=no;
  1584.            If win.m='LPT2.OS2=' Then Do
  1585.               Say 'LPT Ports: setting up for Windows LPT3-9 ports...'
  1586.               winchg=yes;
  1587.               Do n=3 to 9
  1588.                  Say ' Setting up: LPT'n'.OS2='
  1589.                  k=k+1; winnew.k='LPT'n'.OS2='
  1590.               End;
  1591.            End;
  1592.         End;
  1593.         k=k+1;
  1594.         winnew.k=win.j;
  1595.      End;
  1596.      If winchg=yes Then Do;
  1597.         parse var fnx fnx'.' .
  1598.         ifn=fnx]]'.???';
  1599.         ifn=SysTempFileName(ifn)
  1600.         '@COPY' fn ifn '1>NUL 2>NUL' /* Copy original to backup name */
  1601.         Say 'Copy of' fn 'saved as' ifn
  1602.         Say 'Writing' fn 'with added lines.'
  1603.         call lineout fn,,1 /* Start writing at first character */
  1604.         Do i=1 to k /* write file back out */
  1605.            call lineout fn,winnew.i
  1606.         End
  1607.         Call stream fn,'C','CLOSE'
  1608.      End;
  1609.      Else Say 'Lines not added, either already done or not what we expect.'
  1610.   End;
  1611.   Else Say 'Could not locate' fn 'program ending...'
  1612. End;
  1613. Say 'LPTADD ending...'
  1614. Call SysDropFuncs
  1615. Exit
  1616.  
  1617. - (OBJECTID.CMD) - - --  - - - - - - - - - - - - - - - - - - - - - - - - - -
  1618.  
  1619. /* OBJECTID.CMD: Sample code using REXXUTIL's SysIni function.          */
  1620. /* Routine will display the OBJECTIDs known to the WorkPlace Shell      */
  1621. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  1622. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  1623. /* Version 1.1                                                          */
  1624. '@ECHO OFF'
  1625. /* Load REXXUTIL */
  1626. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  1627. call sysloadfuncs
  1628.  
  1629. /* List ObjectIds */
  1630. App='PM_Workplace:Location'
  1631. call SysIni 'USER', App, 'All:', 'Keys'
  1632. if Result \= 'ERROR:' then do
  1633.    Call SysCls
  1634.    Say '';Say '';
  1635.    Say 'Listing ObjectId information (value enclosed in quotes)'; Say '';
  1636.    parse value SysTextScreenSize() with row col
  1637.    j=row-10
  1638.    Do i=1 to Keys.0
  1639.       If trunc(i/j)==i/j Then Do
  1640.          Say '';Say 'Press any key to show next screen...'
  1641.          key=SysGetKey()
  1642.          Call SysCls
  1643.          Say '';Say '';
  1644.          Say 'Listing ObjectId information (value enclosed in quotes)'; Say '';
  1645.       End
  1646.       Say '"'Keys.i'"'
  1647.    End
  1648. End
  1649. Else Say 'Error querying for' App
  1650. Call SysDropFuncs
  1651. Exit
  1652.  
  1653. - (FONTS.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1654.  
  1655. /* FONTS.CMD: Sample code using REXXUTIL's SysIni function.             */
  1656. /* Routine will display the FONTS known to the WorkPlace Shell,         */
  1657. /* verifies that the font file exists and also if passed REBUILD as a   */
  1658. /* parameter will rebuild the INI entries based upon INI.RC values.     */
  1659.  
  1660. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  1661. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  1662. /* Version 1.1                                                          */
  1663.  
  1664. '@ECHO OFF'
  1665. /* Load REXXUTIL */
  1666. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  1667. Signal on Syntax Name LoadCheck
  1668. Call SysLoadFuncs
  1669. LoadCheck: /* rc of 43 means REXXUTILs not found */
  1670. If rc=43 Then Do
  1671.    Say ''
  1672.    Say 'ERROR: Not able to load REXXUTILs. Perhaps REXX not installed or'
  1673.    Say '       REXXUTIL.DLL not found in a LIBPATH drive/directory.'
  1674.    Exit
  1675. End
  1676. Signal off Syntax
  1677. Parse upper arg parm
  1678.  
  1679. App='PM_Fonts'
  1680. /* Until REXXUTIL offers a function call to retrieve the OS2 boot drive   */
  1681. /* we assume the environment variable COMSPEC has location of boot drive. */
  1682. BtDrv=filespec('drive',value('COMSPEC',,'OS2ENVIRONMENT'))
  1683. If Parm<>'REBUILD' Then Do
  1684.    call SysIni 'USER', App, 'All:', 'Keys'
  1685.    If Result \= 'ERROR:' then do
  1686.       Do j=1 to Keys.0
  1687.          fname=space(SysIni('USER', App, Keys.j))
  1688.          msg=''
  1689.          If stream(BtDrv]]fname,'C','Q EXISTS')='' Then,
  1690.             msg='**Font file not found***';
  1691.          Keys.j=Keys.j 'Installed as:' fname ]] msg
  1692.       End
  1693.       Call SysCls
  1694.       Say '';Say '';Say 'Listing Installed Fonts';Say '';
  1695.       parse value SysTextScreenSize() with row col
  1696.       j=row-10
  1697.       Do i=1 to Keys.0
  1698.          If trunc(i/j)==i/j Then Do
  1699.             Say '';Say 'Press any key to show next screen...'
  1700.             key=SysGetKey()
  1701.             Call SysCls
  1702.             Say '';Say '';Say 'Listing Installed Fonts';Say '';
  1703.          End
  1704.          Say left(Keys.i,75)
  1705.       End
  1706.    End
  1707.    Else Say 'Error querying for' App
  1708. End
  1709. Else Do /* Requesting to rebuild fonts as listed in INI.RC */
  1710.    inifile=BtDrv]]'\OS2\INI.RC'
  1711.    rcx=stream(inifile,'C','Q EXISTS')
  1712.    If rcx='' Then Do
  1713.       Say '';Say '';
  1714.       Say inifile 'not found, cannot rebuild PM_Fonts INI entries'
  1715.       Signal Exiter
  1716.    End
  1717.    Do while lines(inifile)>0
  1718.       lne=linein(inifile)
  1719.       parse var lne '"PM_Fonts"' lne
  1720.       If lne\='' Then Do
  1721.          parse var lne '"'key'" 'lne
  1722.          parse var lne '"'val'"'
  1723.          msg=''
  1724.          Call charout ,'Building' left(key,13) left(val,25)
  1725.          If stream(BtDrv]]val,'C','Q EXISTS')='' Then,
  1726.             Say ' ** Font file 'BtDrv]]val' not found.'
  1727.          Else Do
  1728.             Call SysIni 'USER', App, key, val
  1729.             If result='' Then Say ' ...Okay...'
  1730.             Else Say ' ...'result
  1731.          End
  1732.       End
  1733.    End
  1734.    Call stream inifile,'C','CLOSE'
  1735. End
  1736. Say ''
  1737. Say 'FONTS completed, will display the FONTS known to the WorkPlace Shell,'
  1738. Say 'and verify that the font file exists. Also if passed REBUILD as a'
  1739. Say 'parameter will rebuild the INI entries based upon INI.RC values.'
  1740. Exiter:
  1741. Call SysDropFuncs
  1742. Exit
  1743.  
  1744. - (ICONRES.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1745.  
  1746. /* ICONRES.CMD: Sample code using REXXUTIL's SysCreateObject function   */
  1747. /* Routine will create a folder containing many icons available in      */
  1748. /* installed DLLs on an OS/2 V2 system. Shows how to use the setup      */
  1749. /* string parm: ICONRESOURCE                                            */
  1750. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  1751. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  1752. /* Version 1.0                                                          */
  1753. '@ECHO OFF'
  1754. /* Load REXXUTIL */
  1755. call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  1756. call sysloadfuncs
  1757.  
  1758. call SysCls
  1759. Say '';
  1760. Say 'Using REXXUTILs to demonstrate use of the ICONRESOURCE parameter.'
  1761. Say 'A folder will be created and populated with various icons found'
  1762. Say 'in some installed DLL files.'
  1763. Say '';
  1764. Say 'ICONRESOURCE is a SysCreateObject setup string parameter, has syntax:'
  1765. Say '';
  1766. Say '  ICONRESOURCE=id module       Ex:  ICONRESOURCE=3 PMWP;'
  1767. Say '  id=number of the icon resource, module=filename of the DLL'
  1768. Say ''; Say 'NOTE: Over 70 icons, program will run for a minute or two.'
  1769. Say '      After program ends the WPS will continue to resolve objects, also'
  1770. Say '      the building of the objects adds approx 100K to your OS2.INI.'
  1771. Say '';Say 'Press Y to add the folder to Desktop and populate...';Say '';
  1772. parse upper value SysGetKey('NOECHO') with key
  1773. If key<>'Y' Then Signal Exiter
  1774.  
  1775. /* Build folder for icons */
  1776. call charout ,'Building: ICONRESOURCE Icon Folder'
  1777. result = SysCreateObject('WPFolder', 'ICONRESOURCE'x2c(A)'Icon Folder',,
  1778.         '<WP_DESKTOP>', 'OBJECTID=<ICN_FOLDER>;', 'U')
  1779. If result=1 Then call charout ,'...   Object created!'
  1780. Else             call charout ,'...   Not created! Return code='result
  1781. Say '';
  1782. classname='WPAbstract'
  1783. location='<ICN_FOLDER>'
  1784. /* WPCONFIG 1-13 WPPRTMRI 3-16 19-23 */
  1785. fn='PMWP'
  1786. Do i=1 to 75
  1787.    If i<5 ] i=13 ] (i>15 & i<21) ] i=22 ] (i>23 & i<30) ] i=32 ] i=33,
  1788.     ] i=44 ] i=46 ] i=48 ] i=52 ] i=53 ] (i>55 & i<73) Then Call BldObj
  1789. End
  1790. fn='WPCONFIG'
  1791. Do i=1 to 13
  1792.    Call BldObj
  1793. End
  1794. fn='WPPRTMRI'
  1795. Do i=3 to 23
  1796.    If (i<17 ] i>18) Then Call BldObj
  1797. End
  1798. Say '';Say 'All done, to remove drag folder to shredder...'
  1799. Exiter:
  1800. Call SysDropFuncs
  1801. Exit
  1802.  
  1803. /* Build Object */
  1804. BldObj:
  1805. if i<10 then j='0']]i
  1806. else j=i
  1807. title=fn'-']]j
  1808. setup='ICONRESOURCE=']]j]]' 'fn';OBJECTID=<ICN-'fn'-']]j]]'>'
  1809. call charout ,'Building: 'title
  1810. result = SysCreateObject(classname, title, location, setup, 'U')
  1811. If result=1 Then call charout ,'...   Object created!'
  1812. Else             call charout ,'...   Not created! Return code='result
  1813. Say '';
  1814. Return
  1815.  
  1816. - (SWAPEDIT.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1817.  
  1818. /* SWAPEDIT.CMD: Sample code using REXXUTIL function calls              */
  1819. /*                                                                      */
  1820. /* Swaps the OS/2 System Editor (E) with the Enhanced Editor (EPM).     */
  1821. /*                                                                      */
  1822. /* Enter: SWAPEDIT  for more information                                */
  1823. /*                                                                      */
  1824. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  1825. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  1826. /* Version 1.0                                                          */
  1827. /* Load REXXUTIL */
  1828. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  1829. Signal on Syntax Name LoadCheck
  1830. Call SysLoadFuncs
  1831. LoadCheck: /* rc of 43 means REXXUTILs not found */
  1832. If rc=43 Then Do
  1833.    Say ''
  1834.    Say 'ERROR: Not able to load REXXUTILs. Perhaps REXX not installed or'
  1835.    Say '       REXXUTIL.DLL not found in a LIBPATH drive/directory.'
  1836.    Exit
  1837. End
  1838. Signal off Syntax
  1839. Parse arg parm
  1840. /* Default is to prompt before swapping unless /N is passed */
  1841. If translate(parm)<>'/N' Then Call Logo
  1842. /* First apply the same associations to EPM as the System Editor */
  1843. setup    ='ASSOCTYPE=Plain Text,OS/2 Command File,DOS Command File,,;']],
  1844.           'ASSOCFILTER=*.DOC,*.TXT,,;'
  1845. result=SysSetObjectData('<WP_EPM>',setup)
  1846. If result=1 Then Say 'EPM object updated...'
  1847. Else             Say 'EPM object NOT updated! Return code='result
  1848.  
  1849. /* Now Replace the System Editor object (gets deleted then recreated) */
  1850. title    ='OS/2 System Editor'
  1851. setup    ='OBJECTID=<WP_SYSED>;']],
  1852.           'EXENAME=E.EXE;']],
  1853.           'ASSOCTYPE=Plain Text,OS/2 Command File,DOS Command File,,;']],
  1854.           'ASSOCFILTER=*.DOC,*.TXT,,;']],
  1855.           'HELPPANEL=9289;']],
  1856.           'PROGTYPE=PM;'
  1857. result=SysCreateObject('WPProgram', title, '<WP_TOOLS>', setup, 'R')
  1858. If result=1 Then Say 'System Editor object recreated...'
  1859. Else             Say 'System Editor object NOT created! Return code='result
  1860. /* Common exit point */
  1861. Exiter:
  1862. Call SysDropFuncs
  1863. Exit
  1864. /* Introductory message and confirmation */
  1865. Logo:
  1866. Call SysCls; Say; Say;
  1867. Say 'SWAPEDIT: Swap OS/2 System Editor (E) with the Enhanced Editor (EPM)'
  1868. Say ''
  1869. Say 'Some users of OS/2 would rather use the EPM editor for default actions'
  1870. Say 'against data file objects. One way to do this is to place the same'
  1871. Say 'associations on EPM as are on E, then delete and recreate the E program'
  1872. Say 'object. Use: SWAPEDIT /N  to perform the operation with no confirmation.'
  1873. Say ''
  1874. Say 'This program will place the same initial associations the OS/2 System'
  1875. Say 'Editor had on the Enhanced Editor. Then recreate the OS/2 System Editor'
  1876. Say 'program object. Afterwards for data file objects you will see the'
  1877. Say 'Enhanced Editor as the default choice and optionally you can use the'
  1878. Say 'OS/2 System Editor if you select the Open setting.'
  1879. Say ''
  1880. Say 'WARNING: Some files are over 255 characters in length and the EPM'
  1881. Say '         editor does not support this, so when editing files such as'
  1882. Say '         your CONFIG.SYS you should probably use the OS/2 System Editor.'
  1883. Say ''
  1884. Say 'Press C to continue or any other key to end the program'
  1885. parse upper value SysGetKey('NOECHO') with key
  1886. If key<>'C' Then Signal Exiter
  1887. Return
  1888.  
  1889. - (OPENWPS.CMD) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  1890.  
  1891. /* OPENWPS.CMD: Sample code using REXXUTIL function calls               */
  1892. /*                                                                      */
  1893. /* REXX Command file that allows you to open various views of objects.  */
  1894. /*                                                                      */
  1895. /* Enter: OPENWPS ?   for more information                              */
  1896. /*                                                                      */
  1897. /* Mike Lamb: MIKELAMB/KGNVMC / 30NC/370 Neighborhood Rd                */
  1898. /* ISSC MHV - Solution Center / Kingston NY 12401                       */
  1899. /* Version 1.0                                                          */
  1900.  
  1901. /* Load REXXUTIL */
  1902. Call RxFuncAdd 'SysLoadFuncs','RexxUtil','SysLoadFuncs'
  1903. Signal on Syntax Name LoadCheck
  1904. Call SysLoadFuncs
  1905. LoadCheck: /* rc of 43 means REXXUTILs not found */
  1906. If rc=43 Then Do
  1907.    Say ''
  1908.    Say 'ERROR: Not able to load REXXUTILs. Perhaps REXX not installed or'
  1909.    Say '       REXXUTIL.DLL not found in a LIBPATH drive/directory.'
  1910.    Exit
  1911. End
  1912. Signal off Syntax
  1913. Parse Arg parm
  1914. If parm='?' ] translate(parm)='HELP' Then Signal Helper
  1915.  
  1916. quiet=0;       /* Set default message display */
  1917. type='DEFAULT' /* Set default open type */
  1918. objid=''       /* Set default object to open */
  1919. Do i=1 to words(parm)
  1920.   prm=word(parm,i)
  1921.   uparm=translate(prm)
  1922.   Select /* See if value is an open type */
  1923.     when uparm='SETTINGS' Then type='SETTINGS'
  1924.     when uparm='DEFAULT'  Then type='DEFAULT'
  1925.     when uparm='DETAILS'  Then type='DETAILS'
  1926.     when uparm='TREE'     Then type='TREE'
  1927.     when uparm='ICON'     Then type='ICON'
  1928.     when uparm='/N'       Then quiet=1
  1929.     otherwise Nop
  1930.   End
  1931.   If objid='' Then Do
  1932.      /* See if this value is an objectid */
  1933.      prm2=strip(prm,'B','"')
  1934.      If left(prm2,1)='<' & right(prm2,1)='>' Then Do
  1935.         /* Check to see if it exists, build list of all existing objectids */
  1936.         App='PM_Workplace:Location'
  1937.         call SysIni 'USER', App, 'All:', 'ObjIDTab'
  1938.         Do t=1 to ObjIDTab.0
  1939.            If prm2=ObjIDTab.t Then leave
  1940.         End
  1941.         If prm2<>ObjIDTab.t Then Do
  1942.            prm3=translate(prm2) /* Maybe need to uppercase value */
  1943.            Do t=1 to ObjIDTab.0
  1944.               If prm3=ObjIDTab.t Then leave
  1945.            End
  1946.            If prm3<>ObjIDTab.t Then Do
  1947.               Say 'ERROR! Objectid:' prm2' not found'
  1948.               Signal Exiter
  1949.            End
  1950.            Else objid=prm3
  1951.         End
  1952.         Else objid=prm2
  1953.      End
  1954.      Else Do
  1955.        If right(prm,1)=':' Then Call SysFileTree prm'\', mystem, 'D'
  1956.        Else Call SysFileTree prm, mystem, 'D'
  1957.        If mystem.0<>0 Then objid=prm
  1958.      End
  1959.   End
  1960. End
  1961. /* If no objectid nor valid directory passed open default directory */
  1962. If objid='' Then objid=Directory()
  1963. If quiet=0 Then Say 'Opening 'type' view of 'objid
  1964. /* Call to open the object */
  1965. Call SysSetObjectData objid, 'OPEN='type
  1966. If quiet=0 Then Do
  1967.    If result=1 Then Say 'Object opened'
  1968.    Else             Say 'Object NOT opened, return code='result
  1969. End
  1970. Exit
  1971.  
  1972. /* Common exit point */
  1973. Exiter:
  1974. Call SysDropFuncs
  1975. Exit
  1976.  
  1977. /* Help Routine */
  1978. Helper:
  1979. Call SysCls; Say; Say;
  1980. Say '** OPENWPS ** Open a WPS object or directory'
  1981. Say ''
  1982. Say 'Syntax: OPENWPS ╒nameσ ╒viewσ ╒/nσ'
  1983. Say ''
  1984. Say 'If no parameters are passed it is assumed you want the current drive'
  1985. Say 'and directory opened using the DEFAULT view.'
  1986. Say 'Otherwise you can specify the name of an existing objectid, or'
  1987. Say 'drive/directory to be opened. Also you can specify the open view:'
  1988. Say 'Valid views:  ICON  TREE  DETAILS  SETTINGS  DEFAULT'
  1989. Say ''
  1990. Say 'When you specify an objectid you must enclosed it in double quotes,'
  1991. Say 'i.e. "<WP_INFO>" Look in \OS2\INI.RC for many existing objectids.'
  1992. Say ''
  1993. Say 'If you use /N then no messages are displayed, unless problems occur.'
  1994. Say ''
  1995. Say '---Examples---'
  1996. Say ' OPENWPS                           OPENWPS D:\ /N  '
  1997. Say ' - Open the default directory.     - Open root of D:, no messages.'
  1998. Say ' OPENWPS "<WP_INFO>"               OPENWPS "<WP_PULSE>" /N'
  1999. Say ' - Open the Information folder.    - Open the Pulse object, no messages.'
  2000. Signal Exiter
  2001.  
  2002. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2003. ((END REXX CMD SAMPLES))
  2004.  
  2005. ((BEGIN CODE FRAGMENTS))
  2006. - (SYSSET)  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2007.  
  2008. System Settings
  2009. ===============
  2010. During our attempts at customizing the shell using REXXUTILs for newly created
  2011. workstations we discovered many items can be controlled. Our first attempt was
  2012. to turn off the default setting for Workplace Shell Print Screen. We wanted it
  2013. disabled instead of enabled (saves our customers from accidentally printing
  2014. the workplace shell screen contents :-)
  2015. From there we learned other items could be changed:
  2016.  
  2017. Remember the basic SysIni call is:
  2018.   result = SysIni(╒inifileσ, app, key, val)
  2019.  
  2020. Note: Some items if changed did not seem to take effect until the next reboot.
  2021.  
  2022. To see the menu items that can be changed go to:
  2023.  OS/2 System / System Setup / System, Confirmation tab
  2024.  
  2025. Confirmation
  2026. ------------
  2027. /* Confirm on folder delete                      0=not checked 1=checked */
  2028. res=SysIni('USER', 'PM_ControlPanel', 'ConfirmSubDelete', '0']]'00'x)
  2029. /* Confirm delete                                0=not checked 1=checked */
  2030. res=SysIni('USER', 'PM_ControlPanel', 'ConfirmDelete', '0']]'00'x)
  2031. /* Confirm on rename of files with extensions    0=not checked 1=checked */
  2032. res=SysIni('USER', 'PM_ControlPanel', 'ConfirmRenameFilesWithExt', '0']]'00'x)
  2033. /* Confirm on copy, move, create shadow          0=not checked 1=checked */
  2034. res=SysIni('USER', 'PM_ControlPanel', 'ConfirmCopyMoveEtc', '0']]'00'x)
  2035. /* Display progress indication dialog            0=not checked 1=checked */
  2036. res=SysIni('USER', 'PM_ControlPanel', 'DisplayProgressInd', '0']]'00'x)
  2037.  
  2038. To see the menu items that can be changed go to:
  2039.  OS/2 System / System Setup / System, Title tab
  2040.  
  2041. Title
  2042. -----
  2043. /* Title clash */
  2044. /* Prompt for appropriate action  16 */
  2045. /* Auto-rename object             2  */
  2046. /* Replace existing object        8  */
  2047. result = SysIni('USER', 'PM_ControlPanel', 'NameClash', '16']]'00'x)
  2048.  
  2049. To see the menu items that can be changed go to:
  2050.  OS/2 System / System Setup / System, Window tab
  2051.  
  2052. Button appearance for windows
  2053. -----------------------------
  2054. /* Hide button = 1 plus hex 0 */
  2055. result = SysIni('USER', 'PM_ControlPanel', 'MinButtonType', '1']]'00'x)
  2056. /* Minimize button = 2 plus hex 0 */
  2057. result = SysIni('USER', 'PM_ControlPanel', 'MinButtonType', '2']]'00'x)
  2058.  
  2059. Animation
  2060. ---------
  2061. /* Enabled = hex 01 00 00 00 */
  2062. result = SysIni('USER', 'PM_ControlPanel', 'Animation', '01000000'x)
  2063. /* Disabled = hex 00 00 00 00 */
  2064. result = SysIni('USER', 'PM_ControlPanel', 'Animation', '00000000'x)
  2065.  
  2066. Minimize button behavior
  2067. ------------------------
  2068. /* Hide Window = 1 plus hex 0 */
  2069. result = SysIni('USER', 'PM_ControlPanel', 'HiddenMinWindows', '1']]'00'x)
  2070. /* Minimize window to viewer = 2 plus hex 0 */
  2071. result = SysIni('USER', 'PM_ControlPanel', 'HiddenMinWindows', '2']]'00'x)
  2072. /* Minimize window to desktop = 3 plus hex 0 */
  2073. result = SysIni('USER', 'PM_ControlPanel', 'HiddenMinWindows', '3']]'00'x)
  2074.  
  2075. Object Open Behavior
  2076. --------------------
  2077. /* Display existing window; delete CCVIEW key */
  2078. result = SysIni('USER', 'PM_Workplace', 'CCVIEW', 'DELETE:')
  2079. /* Create new window; CCVIEW key set to 'ON' */
  2080. result = SysIni('USER', 'PM_Workplace', 'CCVIEW', 'ON']]'00'x)
  2081.  
  2082. To see the menu items that can be changed go to:
  2083.  OS/2 System / System Setup / System, Print Screen tab
  2084.  
  2085. Print Screen
  2086. ------------
  2087. /* Disable print screen */
  2088. result = SysIni('USER', 'PM_ControlPanel', 'PrintScreen', '0']]'00'x)
  2089. /* Enable print screen */
  2090. result = SysIni('USER', 'PM_ControlPanel', 'PrintScreen', '1']]'00'x)
  2091.  
  2092. To see the menu items that can be changed go to:
  2093.  OS/2 System / System Setup / System, Logo tab
  2094.  
  2095. Logo
  2096. ----
  2097. /* Indefinite */
  2098. result = SysIni('USER', 'PM_ControlPanel', 'LogoDisplayTime', '-1']]'00'x)
  2099. /* None */
  2100. result = SysIni('USER', 'PM_ControlPanel', 'LogoDisplayTime', '0']]'00'x)
  2101. /* Timed   Range: Seconds:0-59 Tenths: 0-9 */
  2102. /*  100  = 0 seconds 1 tenths              */
  2103. /* 2000  = 2 seconds 0 tenths (default)    */
  2104. /* 59900 = 59 seconds 9 tenths             */
  2105. result = SysIni('USER', 'PM_ControlPanel', 'LogoDisplayTime', '2000']]'00'x)
  2106.  
  2107. To see the menu items that can be changed hightlight your desktop, then
  2108.    use Open / Settings / Background tab
  2109.  
  2110. Change color button
  2111. -------------------
  2112. Select the Values button to display the numeric values you'll need for the
  2113. INI call. (Use the values when the RGB button is selected)
  2114.  
  2115. /* Setting Desktop background color                  R   G   B          */
  2116. result = SysIni('USER', 'PM_Colors', 'Background', '204 204 204']]'00'x)
  2117.  
  2118. Note: Lots of other colors can be customized as well, review your \OS2\INI.RC
  2119.       file for the correct App and Key fields.
  2120.  
  2121. To see the menu items that can be changed go to:
  2122.  OS/2 System / System Setup / Sound
  2123.  
  2124. Warning Beep
  2125. ------------
  2126. /* Turn off Warning Beep */
  2127. result = SysIni('USER', 'PM_ControlPanel', 'Beep', '0']]'00'x)
  2128. /* Turn on Warning Beep */
  2129. result = SysIni('USER', 'PM_ControlPanel', 'Beep', '1']]'00'x)
  2130.  
  2131. Remember: Most changes will not be reflected automatically. The next reboot
  2132.           should pick up your changes. These calls would be best used when
  2133.           first building a workstation, not for dynamic updates.
  2134.  
  2135. Global WIN-OS2 Settings
  2136. =======================
  2137. With OS/2 V2.1 you are able to control certain WIN-OS/2 session properties
  2138. for all Windows applications. You can locate this new control by going to:
  2139.  
  2140. OS/2 System / System Setup / WIN-OS/2 Setup
  2141.  
  2142. The changes you make here will be reflected for all newly created objects
  2143. that use WIN-OS/2 settings. No setup string exists to change WIN_DDE, nor
  2144. WIN_CLIPBOARD on a program by program basis.
  2145.  
  2146. App WINOS2
  2147. ----------
  2148.  3.1 Session tab
  2149.  ---------------
  2150.    Key PM_Global31SessionType
  2151.    Value 15 - WIN-OS/2 Window separate session (3.1 Standard)
  2152.    Value 16 - WIN-OS/2 Window (3.1 Standard)
  2153.    Value 17 - WIN-OS/2 Window separate session (3.1 Enhanced Compatibility)
  2154.    Value 18 - WIN-OS/2 Window (3.1 Enhanced Compatibility)
  2155.    Value 19 - WIN-OS/2 Full screen (3.1 Enhanced Compatibility)
  2156.    Value 20 - WIN-OS/2 Full screen (3.1 Standard)
  2157.  
  2158. Example:
  2159. /* Set global session type to WIN-OS/2 Full screen (3.1 Standard) */
  2160. result = SysIni('USER', 'WINOS2', 'PM_Global31SessionType', '20']]'00'x)
  2161.  
  2162.  WIN-OS/2 Settings button
  2163.  ------------------------
  2164.    Key PM_GlobalWin31DataExchange
  2165.    Value 0  - WIN_DDE On  WIN_CLIPBOARD On
  2166.    Value 4  - WIN_DDE Off WIN_CLIPBOARD On
  2167.    Value 8  - WIN_DDE On  WIN_CLIPBOARD Off
  2168.    Value 12 - WIN_DDE Off WIN_CLIPBOARD Off
  2169.  
  2170. Example:
  2171. /* Set DDE on, Clipboard off */
  2172. result = SysIni('USER', 'WINOS2', 'PM_GlobalWin31DataExchange', '8']]'00'x)
  2173.  
  2174.    Key PM_GlobalWindows31Settings
  2175.    Need to supply the text of DOS, WIN settings separated by nul 0 character
  2176.    AND the string ends with nul 0 nul 0
  2177.  
  2178. Example:
  2179. /* Default settings */
  2180. setting='DPMI_MEMORY_LIMIT=64']]'00'x]],
  2181.         'PROGTYPE=PROG_31_STD']]'00'x]],
  2182.         'KBD_ALTHOME_BYPASS=1']]'00'x]],
  2183.         'VIDEO_SWITCH_NOTIFICATION=1']]'00'x]],
  2184.         'VIDEO_8514A_XGA_IOTRAP=0']]'00'x]]'00'x
  2185. result = SysIni('USER', 'WINOS2', 'PM_GlobalWindows31Settings', setting)
  2186.  
  2187.  Data Exchange tab
  2188.  -----------------
  2189.  Data exchange between OS/2, DOS and WIN-OS/2 sessions
  2190.    Dynamic data exchange
  2191.      Key PM_DDESupport
  2192.      Value 0 - Public (share with WIN-OS/2)
  2193.      Value 1 - Private (non-share with WIN-OS/2)
  2194.        Example:
  2195.        /* Set DDE Private */
  2196.        result = SysIni('USER', 'WINOS2', 'PM_DDESupport', '1']]'00'x)
  2197.    Clipboard
  2198.      Key PM_ClipboardSupport
  2199.      Value 0 - Public (share with WIN-OS/2)
  2200.      Value 1 - Private (non-share with WIN-OS/2)
  2201.        Example:
  2202.        /* Set Clipboard Private */
  2203.        result = SysIni('USER', 'WINOS2', 'PM_ClipboardSupport', '1']]'00'x)
  2204.  
  2205. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  2206. ((END CODE FRAGMENTS))
  2207.  
  2208. END: REXXUTIL Information and Samples
  2209.