home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / sirexx.zip / REXXSAMP.CMD < prev    next >
OS/2 REXX Batch file  |  1994-07-25  |  7KB  |  117 lines

  1. /******************************************************************************/
  2. /* SAMPLE REXXSAMP.CMD                                                        */
  3. /*                                                                            */
  4. /* ABSTRACT:                                                                  */
  5. /* --------                                                                   */
  6. /* This file a part of a package made available free to all paying Software   */
  7. /* Installer customers.  This package comprises of a .DLL that contains       */
  8. /* entry points for the Software Installer functions getvar and putvar.       */
  9. /* The package also includes a sample using these functions.                  */
  10. /*                                                                            */
  11. /* COPYRIGHT:                                                                 */
  12. /* ----------                                                                 */
  13. /* Copyright (C) International Business Machines Corp., 1991, 1994.           */
  14. /*                                                                            */
  15. /* DISCLAIMER OF WARRANTIES:                                                  */
  16. /* -------------------------                                                  */
  17. /* The following [enclosed] code is sample code created by IBM                */
  18. /* Corporation.  This sample code is not part of any standard IBM product     */
  19. /* and is provided to you solely for the purpose of assisting you in the      */
  20. /* development of your applications.  The code is provided "AS IS",           */
  21. /* without warranty of any kind.  IBM shall not be liable for any damages     */
  22. /* arising out of your use of the sample code, even if they have been         */
  23. /* advised of the possibility of such damages.                                */
  24. /******************************************************************************/
  25. /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
  26. /* Note:                                                                      */
  27. /*                                                                            */
  28. /* In order for this package to work properly you must rename the             */
  29. /* EPFIREXX.DLL to match your prefix.  To rename this .DLL, issue the         */
  30. /* command EPFRCOPY EPFIREXX.DLL ABC  where ABC is your 3 letter prefix.      */
  31. /* EPFRCOPY.EXE is installed in the C:\IBB\BIN directory when you install     */
  32. /* Software Installer.                                                        */
  33. /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
  34. /*  */
  35. Trace on
  36.  
  37. /******************************************************************/
  38. /* Add functions                                                  */
  39. /*                                                                */
  40. /* To call an external function from a REXX program, you must     */
  41. /* load the functions.  This is done through the REXX             */
  42. /* rxfuncadd function.                                            */
  43. /*                                                                */
  44. /* The 2 external functions are putvar and getvar.                */
  45. /******************************************************************/
  46. x = rxfuncadd(putvar,EPFIREXX,putvar)  /* entry points from the DLL */
  47. x = rxfuncadd(getvar,EPFIREXX,getvar)  /* entry points from the DLL */
  48.  
  49. /******************************************************************/
  50. /* Following is an example call to getvar.                        */
  51. /*                                                                */
  52. /* The syntax of getvar is as follows:                            */
  53. /* (See the Software Installer Reference for complete             */
  54. /*  documentation on getvar)                                      */
  55. /*      Parameter 1:   A REXX string indicating the name of the   */
  56. /*                     installation variable, whose value you     */
  57. /*                     wish to retrieve.                          */
  58. /*      Parameter 2:   The buffer to retrieve the value.          */
  59. /*                     After the call to getvar, this buffer will */
  60. /*                     contain the value of the installation      */
  61. /*                     variable specifies by the first parameter. */
  62. /*                     installation variable, whose value you     */
  63. /*                     wish to retrieve.                          */
  64. /*      Parameter 3:   The length of the buffer you specify in    */
  65. /*                     the second parameter.                      */
  66. /*                                                                */
  67. /* Get value of EPFIACTION installation variable                  */
  68. /* (Software Installer has already set this installation          */
  69. /*  variable)                                                     */
  70. /******************************************************************/
  71. buflen = 24
  72.  
  73. rc = getvar("EPFIACTION", buffer, "buflen")
  74.  
  75. say 'getvar indicates current action is : ' buffer
  76. say 'Buffer length is                   : ' buflen
  77. say ''
  78.  
  79. /******************************************************************/
  80. /* Query user for their name                                      */
  81. /******************************************************************/
  82. say '=============================================================='
  83. say 'Enter your name   :'
  84. pull name .
  85. say ''
  86.  
  87. /******************************************************************/
  88. /* Following is an example call to putvar.                        */
  89. /*                                                                */
  90. /* The syntax of putvar is as follows:                            */
  91. /* (See the Software Installer Reference for complete             */
  92. /*  documentation on putvar)                                      */
  93. /*      Parameter 1:   A REXX string indicating the name of the   */
  94. /*                     installation variable, whose value you     */
  95. /*                     wish to set.                               */
  96. /*      Parameter 2:   The buffer containing the value to set.    */
  97. /*                                                                */
  98. /* Set value of MYREXXVAR to name entered                         */
  99. /******************************************************************/
  100. rc = putvar("MYREXXVAR", name)
  101.  
  102. say '=============================================================='
  103. say 'Called putvar() to set MYREXXVAR to: ' name
  104. say 'Return Code of putvar() is :         ' rc
  105. say ''
  106. say ''
  107. '@pause'
  108.  
  109. /******************************************************************/
  110. /* Drop functions                                                 */
  111. /*                                                                */
  112. /* Drop the external functions through the REXX rxfuncdrop        */
  113. /* function.                                                      */
  114. /******************************************************************/
  115. x = rxfuncdrop(putvar)
  116. x = rxfuncdrop(getvar)
  117.