home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxvim.zip / REXXVIM.INF (.txt) < prev    next >
OS/2 Help File  |  1994-09-08  |  156KB  |  7,571 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. RexxVIM ΓòÉΓòÉΓòÉ
  3.  
  4. RexxVIM allows programs written in Rexx to communicate with Vendor Independent 
  5. Messaging (VIM) enabled mail systems.  This includes cc:Mail and Lotus Notes. 
  6. This toolkit provides the functionality of the Lotus VIM Developer'sToolkit to 
  7. Rexx applications. 
  8.  
  9. The additional functions provided by this toolkit are usable with the base Rexx 
  10. support provided in Operating System/2 (OS/2). The toolkit extensions have also 
  11. been tested with Rexx extension products, such as VX-Rexx from Watcom, 
  12. VisPro/Rexx from Hockware, and GpfRexx from Gpf Systems. 
  13.  
  14.  
  15. ΓòÉΓòÉΓòÉ 2. What is limited in this demo? ΓòÉΓòÉΓòÉ
  16.  
  17. This package contains the full features of the RexxVIM product.  This version 
  18. allows applications to be created that use any of the functions of the toolkit. 
  19. The demo version does have the following limiatations: 
  20.  
  21. - Copyright prompt is displayed upon program execution and enter
  22.   must be pressed to continue
  23.  
  24. - All enumeration functions are limited to a maximum of two items
  25.   per call
  26.  
  27. - Messages are limited to 1K for send and receive (over 1K will be ignored)
  28.  
  29.  
  30. ΓòÉΓòÉΓòÉ 3. License Agreement and Limited Product Warranty ΓòÉΓòÉΓòÉ
  31.  
  32. YOU SHOULD CAREFULLY READ THE FOLLOWING TERMS AND CONDITIONS. USING THIS 
  33. PROGRAM INDICATES YOUR ACCEPTANCE OF THEM.  IF YOU DO NOT AGREE WITH THEM, 
  34. PROMPTLY RETURN THE PACKAGE AND YOUR MONEY WILL BE REFUNDED. 
  35.  
  36. Innovative Business Technologies, Inc. provides this Program and licenses its 
  37. use to you.  You are responsible for selecting the Program to achieve your 
  38. intended results and for the installation, use and results obtained form this 
  39. program. 
  40.  
  41. THE PROGRAM, INCLUDING ITS STRUCTURE AND ORGANIZATION, AS WELL AS, ITS CODE, IS 
  42. A PROPRIETARY PRODUCT OF INNOVATIVE BUSINESS TECHNOLOGIES AND IS PROTECTED BY 
  43. COPYRIGHT LAWS.  TITLE TO THE PROGRAM, OR ANY COPY, MODIFICATION OR MERGED 
  44. PORTION OF THE PROGRAM, SHALL AT ALL TIMES REMAIN WITH INNOVATIVE BUSINESS 
  45. TECHNOLOGIES, INC. 
  46.  
  47. LICENSE
  48.  
  49. You may: 
  50.  
  51. Use the Program for development only on a single computer.  Even though two 
  52. copies of the program may be provided in this package, on diskettes of 
  53. different sizes, you may not use both sizes of diskettes simultaneously on 
  54. different computers.  This Program may not under any circumstances be used for 
  55. development on more than one computer system at a time. 
  56.  
  57. Distribute without cost the RexxVIM.dll runtime program file to allow programs 
  58. created with the Program to operate on other computer systems. 
  59.  
  60. Make one copy of the Program into any computer readable or printed form for 
  61. backup or modification purposes in support of your use of the Program for 
  62. development on a single computer. 
  63.  
  64. Transfer the Program together with this License to another party, but only if 
  65. the other party agrees to accept the terms and condidtions of theis Agreement. 
  66. If you transfer the Program and License, you must at the same time either 
  67. transfer all copies, modifications or merged portions of the Program to the 
  68. same party or destroy those note transferred.  Any such transfer terminates 
  69. your License. 
  70.  
  71.  You may not: 
  72.  
  73. TRANSFER OR RENT THE PROGRAM OF USE, COPY MODIFY OR MERGE THE PROGRAM, IN WHOLE 
  74. OR IN PART, EXCEPT AS EXPRESSLY PERMITTED IN THIS LICENSE. 
  75.  
  76. DECOMPILE, REVERSE ASSEMBLE OR OTHERWISE REVERSE ENGINEER THE PROGRAM. 
  77.  
  78. REPRODUCE, DISTRIBUTE OR REVISE THE PROGRAM DOCUMENTATION. 
  79.  
  80. IF YOU DO ANY OF THE FOREGOING, YOUR LICENSE AND THIS AGREEMENT ARE 
  81. AUTOMATICALLY TERMINATED.  SUCH TERMINATION SHALL BE IN ADDTION TO AND NOT IN 
  82. LIEU OF ANY CRIMIANL, CIVAL, OR OTHER REMEDIES AVAILABLE TO INNOVATIVE BUSINESS 
  83. TECHNOLOGIES. 
  84.  
  85. TERM
  86.  
  87. You may terminate your License and this Agreement at any time by destroying the 
  88. Program and the Program documentation together with all copies in any form. 
  89. They will also terminate automatically if you fail to comply with any term or 
  90. condition of this Agreement, in which event you agree to destroy the Program 
  91. together with all copies in any form, and to provide us upon our request with 
  92. written certification of such destruction. 
  93.  
  94. LIMITED PRODUCT WARRANTY
  95.  
  96. EXCEPT AS SPECIFICALLY STATED IN THIS AGREEMENT, THE PROGRAM IS PROVIDED AND 
  97. LICENSED "AS IS" WITHOUT WARRANTY OR ANY KIND, EITHER EXPRESS OR IMPLIED, 
  98. INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
  99. FITNESS FOR A PARTICULAR PURPOSE. 
  100.  
  101. Innovative Business Technologies warrants that the Program will substantially 
  102. perform the functions or generally conforms to the Program's specifications 
  103. published by Innovative Business Technologies. 
  104.  
  105. Innovative Business Technologies warrants that the diskettes on which the 
  106. Program is furnished will be free for defects in materials and workmanship 
  107. under normal use for a period of ninety days from the date of delivery to you. 
  108.  
  109. Innovative Business Technologies DOES NOT WARRANT that the functions contained 
  110. in the Program will meet your requirements or that the operation of the Program 
  111. will be entirely error free or appear precisely as described in the Program 
  112. documentation. 
  113.  
  114. LIMITATION OF REMIDIES AND LIABILITY
  115.  
  116. The remedies described below are accepted by you as your only remedies, and 
  117. shall be available to you only if you or your dealer returns the enclosed 
  118. registration card to Innovative Business Technologies within ten days after 
  119. delivery of the Program to you.  Innovative Business Technologies' entire 
  120. liability and your exclusive remedies shall be: 
  121.  
  122. If the Program does not substantially perform the functions or generally 
  123. conform to the Program's specifications published by Innovative Business 
  124. Technologies, you may within siz months after delivery write to Innovative 
  125. Business Technologies to report a significant defect.  If Innovative Business 
  126. Technologies is unable to correct that defect within 90 days after receiving 
  127. your report, you may terminate your License and this Agreement by returning the 
  128. Program with your original receipts and your money will be refunded. 
  129.  
  130. If the Program diskette is defective, you may return it with a copy of your 
  131. receipt, and Innovative Business Technologies with either replace it or, if a 
  132. replacement cannot soon be delivered, you may terminate your License and this 
  133. Agreement by returning the Program with your original receipts and your money 
  134. will be refunded. 
  135.  
  136. IN NO EVENT WILL INNOVATIVE BUSINESS TECHNOLOGIES BE LIABLE TO YOU FOR ANY 
  137. DAMAGES, INCLUDING LOST PROFITS, LOST SAVINGS, OR OTHER INCIDENTAL OR 
  138. CONSEQUENTIAL DAMAGES, ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM, 
  139. EVEN IF INNOVATIVE BUSINESS TECHNOLOGIES OR DEALER HAS BEEN ADVISED OR THE 
  140. POSSIBILITY OF SUCH DAMAGES. 
  141.  
  142. GENERAL
  143.  
  144. If any provision of this Agreement is held to be unenforceable, the 
  145. enforceability of the remianing provisions shall in no way be affected or 
  146. impaired thereby. 
  147.  
  148. The prevailing party in any action or proceeding brought in connection with a 
  149. breach of this Agreement will be entitled to reimbursement by the other party 
  150. for costs and resonable attorney's fees.  This Agreement shall be governed by 
  151. the laws of the State of Ohio. 
  152.  
  153. Any questions concerning this Agreement should be referred in writing to 
  154. Innovative Business Technologies, Inc. at 7137 Shady Nelms Drive, Suite #204, 
  155. Columbus, OH 43017. 
  156.  
  157. YOU ACKNOWLEDGE THAT YOU HAVE READ THIS AGREEMENT, AND BY OPERATING THIS 
  158. PROGRAM INDICATE YOUR ACCEPTANCE OF ITS TERMS AND CONDITIONS. 
  159.  
  160.  
  161. ΓòÉΓòÉΓòÉ 4. Contacts and Order Form ΓòÉΓòÉΓòÉ
  162.  
  163. This section contains company contact and product ordering information. 
  164.  
  165.  
  166. ΓòÉΓòÉΓòÉ 4.1. Contact Information ΓòÉΓòÉΓòÉ
  167.  
  168. RexxVIM is copyrighted by Innovative Business Technologies, Inc.  All 
  169. copyrights and trademarks referenced in this material are the properties of 
  170. their respective corporations. 
  171.  
  172. If you have any questions, problems, or bug reports, please send them to: 
  173.  
  174.         Innovative Business Technologies, Inc.
  175.         7137 Shady Nelms Drive
  176.         Suite 204
  177.         Columbus, OH 43017
  178.  
  179. or
  180.  
  181.         CompuServe:     74563,1530
  182.  
  183. or
  184.  
  185.         OS/2 Vendor Forum A (OS2AVEND), Other vendors section
  186.  
  187. or
  188.  
  189.         Voice/Fax:      614-791-9055
  190.  
  191.  
  192. ΓòÉΓòÉΓòÉ 4.2. Product Ordering Information ΓòÉΓòÉΓòÉ
  193.  
  194. RexxVIM is available directly from Innovative Business Technologies, Inc.  The 
  195. software is licensed per developer, with unlimited rights to distribute the 
  196. runtime dll.  Each user developing RexxVIM applications will require a copy of 
  197. the development environment.  For multiple unit and site license pricing, 
  198. contact IBT.  The development environment includes: 
  199.  
  200. RexxVIM.dll    -    Runtime dynamic link library
  201. RexxVIM.inf    -    Full online documentation
  202.  
  203. RexxPack.exe   -    Program to compact a Rexx command file for
  204.                     faster execution and limited change
  205.  
  206. Example apps   -    Example applications that demonstrate the
  207.                     use of all of the RexxVIM functions
  208.  
  209.  
  210. ΓòÉΓòÉΓòÉ 4.3. Order Form ΓòÉΓòÉΓòÉ
  211.  
  212. INNOVATIVE BUSINESS TECHNOLOGIES, INC.    ++++++++++++++++++++++
  213. 7137 SHADY NELMS DRIVE, SUITE #204        | RexxVIM Order Form |
  214. COLUMBUS, OH 43017                        ++++++++++++++++++++++
  215. VOICE/FAX: (614) 791-9055
  216.  
  217.                                           Date:  _______________
  218.  
  219. Company Name:  _________________________________________________
  220.  
  221. Name:          _________________________________________________
  222.  
  223. Address:       _________________________________________________
  224.  
  225. City:          ________________________   State:    ____________
  226.  
  227. Zip Code:      ________________________   Country:  ____________
  228.  
  229. Telephone:     ________________________
  230.  
  231. Fax:           ________________________
  232.  
  233. ================================================================
  234. Version of ccMail or Lotus Notes currently in use: ____________
  235.  
  236. For electronic distribution, please list your e-mail address -
  237.  
  238. CompuServe        Internet         Prodigy        America Online
  239.  
  240. Address:       _________________________________________________
  241.  
  242. ================================================================
  243.  
  244.   Quantity   Product Description           Cost           Total
  245.  
  246.   ________   RexxVIM for OS/2           $295.00      __________
  247.  
  248.      Shipping and Handling                                 4.00
  249.  
  250.      Ohio Residents add 5.75% Sales Tax              __________
  251.  
  252.   TOTAL ORDER
  253.                                                      ==========
  254.  
  255. Please send your completed order form, including a check or
  256. money order (U.S. Funds only) payable to: Innovative Business
  257. Technologies, Inc.
  258.  
  259. ================================================================
  260. For faster service, fax us your order by including your credit
  261. card information:
  262.  
  263. CREDIT CARD:   VISA      MASTERCARD
  264.  
  265.  
  266. CREDIT CARD NUMBER: ____________________________________________
  267.  
  268. EXPIRATION DATE:    ____________/_______________/_______________
  269.  
  270. SIGNATURE:          ____________________________________________
  271. ================================================================
  272.  
  273.  
  274. ΓòÉΓòÉΓòÉ 5. Installation ΓòÉΓòÉΓòÉ
  275.  
  276. The RexxVIM files should be installed into a RexxVIM directory.  The install 
  277. program will unzip the files, and place them into a RexxVIM directory on the 
  278. specified drive. 
  279.  
  280. The directory where the RexxVIM files are copied must be added to the LIBPATH 
  281. statement in the config.sys.  The directory which containes the VIM.dll must 
  282. also be in the config.sys. 
  283.  
  284. NOTE:  Your VIM files must be dated 11/93 or later!  If the
  285.        VIM.dll is dated earlier than 11/93, contact Lotus
  286.        for the VIM OS/2 updates.
  287.  
  288.  
  289. ΓòÉΓòÉΓòÉ 5.1. File Descriptions ΓòÉΓòÉΓòÉ
  290.  
  291. The REXXVIM.zip file contains the following files: 
  292.  
  293.       RexxVIM.dll          The dynamic link library that adds
  294.                            VIM functions to Rexx
  295.  
  296.       RexxVIM.inf          The help file for the toolkit
  297.  
  298.       RexxPack.exe         Program to compact a Rexx command file for
  299.                            faster execution and limited change
  300.  
  301.       Demo.cmd             Rexx program to demonstrate the basic
  302.                            RexxVIM functions
  303.  
  304.       VIMcap.cmd           Rexx program to demonstrate querying
  305.                            the VIM subsystem for supported features
  306.  
  307.       Message.cmd          Rexx program to demonstrate sending
  308.                            a message using RexxVIM
  309.  
  310.       MSGCont.cmd          Rexx program to demonstrate using the
  311.                            message container.  Allows each message
  312.                            in the Inbox to be deleted, stored in
  313.                            a folder, or left in the Inbox.
  314.  
  315.       MSGActs.cmd          Rexx program to demonstrate the use
  316.                            of the message access functions.
  317.  
  318.       AddrBook.cmd         Rexx program to demonstrate the use
  319.                            of the address book functions for
  320.                            opening, closing, and enumerating.
  321.  
  322.       ABEdemo.cmd          Rexx program to demonstrate the use
  323.                            of the address book functions that
  324.                            provide access to the address book
  325.                            entries and group members.
  326.  
  327.  
  328. ΓòÉΓòÉΓòÉ 6. Base Functions ΓòÉΓòÉΓòÉ
  329.  
  330. This section describes each of the functions available in the RexxVIM product 
  331. that address base RexxVIM features. 
  332.  
  333.  
  334. ΓòÉΓòÉΓòÉ 6.1. RxVIMLoadFuncs ΓòÉΓòÉΓòÉ
  335.  
  336. The RxVIMLoadFuncs function loads all of the VIM extensions using one call. 
  337.  
  338.  
  339. ΓòÉΓòÉΓòÉ 6.1.1. Syntax ΓòÉΓòÉΓòÉ
  340.  
  341. RxVIMLoadFuncs is called with no parameters. 
  342.  
  343. call RxVIMLoadFuncs
  344.  
  345. or
  346.  
  347. rc = RxVIMLoadFuncs()
  348.  
  349.  
  350. ΓòÉΓòÉΓòÉ 6.1.2. Return Codes ΓòÉΓòÉΓòÉ
  351.  
  352. The RxVIMLoadFuncs function returns the following values: 
  353.  
  354.         0 - Successful load of all functions
  355.         1 - Load of functions failed
  356.  
  357.         NOTE:  The load will fail if a previous program did
  358.                not execute the RxVIMDropFuncs function.
  359.  
  360.  
  361. ΓòÉΓòÉΓòÉ 6.1.3. Example ΓòÉΓòÉΓòÉ
  362.  
  363. /* Example to load all of the VIM extensions */
  364.  
  365. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  366. call RxVIMLoadFuncs
  367.  
  368.  
  369. ΓòÉΓòÉΓòÉ 6.2. RxVIMDropFuncs ΓòÉΓòÉΓòÉ
  370.  
  371. The RxVIMDropFuncs function unloads all of the VIM extensions using one call. 
  372.  
  373.  
  374. ΓòÉΓòÉΓòÉ 6.2.1. Syntax ΓòÉΓòÉΓòÉ
  375.  
  376. RxVIMDropFuncs is called with no parameters. 
  377.  
  378. call RxVIMDropFuncs
  379.  
  380. or
  381.  
  382. rc = RxVIMDropFuncs()
  383.  
  384.  
  385. ΓòÉΓòÉΓòÉ 6.2.2. Return Codes ΓòÉΓòÉΓòÉ
  386.  
  387. The RxVIMDropFuncs function returns the following values: 
  388.  
  389.         0 - Successful unload of all functions
  390.         1 - Unload of functions failed
  391.  
  392.  
  393. ΓòÉΓòÉΓòÉ 6.2.3. Example ΓòÉΓòÉΓòÉ
  394.  
  395. /* Example to unload all of the VIM extensions */
  396.  
  397. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  398. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  399. call RxVIMLoadFuncs
  400.  
  401.  
  402. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  403. call RxVIMDropFuncs
  404.  
  405.  
  406. ΓòÉΓòÉΓòÉ 7. Session Management Functions ΓòÉΓòÉΓòÉ
  407.  
  408. This section describes each of the functions available in the RexxVIM product 
  409. that address VIM session management. 
  410.  
  411.  
  412. ΓòÉΓòÉΓòÉ 7.1. RxVIMInitialize ΓòÉΓòÉΓòÉ
  413.  
  414. The RxVIMInitialize function establishes a connection to the underlying VIM 
  415. sub-system.  This function must be called prior to any of the other functions 
  416. that interact with the VIM system.  This function should only be called once 
  417. for any command file that interacts with a VIM system. 
  418.  
  419.  
  420. ΓòÉΓòÉΓòÉ 7.1.1. Syntax ΓòÉΓòÉΓòÉ
  421.  
  422. RxVIMInitialize is called with no parameters. 
  423.  
  424. call RxVIMInitialize
  425.  
  426. or
  427.  
  428. rc = RxVIMInitialize()
  429.  
  430.  
  431. ΓòÉΓòÉΓòÉ 7.1.2. Return Codes ΓòÉΓòÉΓòÉ
  432.  
  433. The RxVIMInitialize function returns the following values: 
  434.  
  435.         0 - Successful initialization
  436.  
  437. The return values from all of the function calls return a zero for success, and 
  438. non-zero for failure.  To retrieve the actual failure reason, use the 
  439. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  440. value to the actual failure text.  Using RxVIMStatus, the following values may 
  441. be returned by RxVIMInitialize: 
  442.  
  443.         VIMSTS_SUCCESS          Successful Initialization
  444.         VIMSTS_FAILURE          Initialization Failed
  445.  
  446.  
  447. ΓòÉΓòÉΓòÉ 7.1.3. Example ΓòÉΓòÉΓòÉ
  448.  
  449. /* Example of using RxVIMInitialize */
  450.  
  451. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  452. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  453. call RxVIMLoadFuncs
  454.  
  455.  
  456. /* This will establish a connection to the VIM system */
  457. rc = RxVIMInitialize()
  458.  
  459. /* Show return code to user */
  460. Say 'The return code from the Initialize was =' rc
  461.  
  462.  
  463. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  464. call RxVIMDropFuncs
  465.  
  466.  
  467. ΓòÉΓòÉΓòÉ 7.2. RxVIMQueryCapability ΓòÉΓòÉΓòÉ
  468.  
  469. The RxVIMQueryCapability function allows the application to determine supported 
  470. features in the underlying VIM system.  This function should be used to 
  471. determine what features are supported in the particular VIM system be used, 
  472. prior to using the feature. 
  473.  
  474.  
  475. ΓòÉΓòÉΓòÉ 7.2.1. Syntax ΓòÉΓòÉΓòÉ
  476.  
  477. RxVIMQueryCapability is called with two parameters. The first parameter is a 
  478. selector of the item to be queried, and the second is the Rexx variable to 
  479. contain the result. 
  480.  
  481. call RxVIMQueryCapability 'Selector' , 'variable'
  482.  
  483. or
  484.  
  485. rc = RxVIMQueryCapability('Selector' , 'variable')
  486.  
  487. Listed below are the valid selectors to query, and the possible return values: 
  488.  
  489. VIMSEL_VERSION                  Indicates the VIM version number
  490.  
  491. VIMSEL_IMPLEMENTATION           Indicates the product that is providing the database
  492.  
  493. VIMSEL_IMPLEMENTATION_VERSION   Indicates the version of the VIM implementation
  494.  
  495. VIMSEL_PRODUCT                  Indicates the name of the product
  496.  
  497.                                    ccMail will return CCMAIL
  498.                                    Notes will return NOTES
  499.  
  500. VIMSEL_MAX_SUBJECT_LEN          This is the maximum limit for a subject line
  501.  
  502. VIMSEL_MAX_TYPE_LEN             This is the maximum limit for an item of type VIMSEL_TYPE
  503.  
  504. VIMSEL_MAX_TEXT_LEN             This is the maximum limit for a text item
  505.  
  506. VIMSEL_RTF                      Returns level of support for Rich Text Format
  507.  
  508.                                    VIMSEL_NOT_SUPPORTED - Not supported
  509.                                    VIMSEL_SUPP_WITH_CONV - Support with conversion at source
  510.                                    VIMSEL_SUPP_WITHOUT_CONV - Support without conversion at source
  511.  
  512. VIMSEL_FAX                      Returns level of support for FAX
  513.  
  514.                                    VIMSEL_NOT_SUPPORTED - Not supported
  515.                                    VIMSEL_SUPP_WITH_CONV - Support with conversion at source
  516.                                    VIMSEL_SUPP_WITHOUT_CONV - Support without conversion at source
  517.  
  518. VIMSEL_STYLED                   Returns level of support for Macintosh styled text
  519.  
  520.                                    VIMSEL_NOT_SUPPORTED - Not supported
  521.                                    VIMSEL_SUPP_WITH_CONV - Support with conversion at source
  522.                                    VIMSEL_SUPP_WITHOUT_CONV - Support without conversion at source
  523.  
  524. VIMSEL_PICT                     Returns level of support for Macintosh PICT note parts
  525.  
  526.                                    VIMSEL_NOT_SUPPORTED - Not supported
  527.                                    VIMSEL_SUPP_WITH_CONV - Support with conversion at source
  528.                                    VIMSEL_SUPP_WITHOUT_CONV - Support without conversion at source
  529.  
  530. VIMSEL_MOVIE                    Returns level of support for Quicktime movie parts
  531.  
  532.                                    VIMSEL_NOT_SUPPORTED - Not supported
  533.                                    VIMSEL_SUPP_WITH_CONV - Support with conversion at source
  534.                                    VIMSEL_SUPP_WITHOUT_CONV - Support without conversion at source
  535.  
  536. VIMSEL_IMAG                     Returns level of support for Macintosh FAX note parts
  537.  
  538.                                    VIMSEL_NOT_SUPPORTED - Not supported
  539.                                    VIMSEL_SUPP_WITH_CONV - Support with conversion at source
  540.                                    VIMSEL_SUPP_WITHOUT_CONV - Support without conversion at source
  541.  
  542. VIMSEL_UNWRAPPED_TEXT           Returns level of support for unwrapped text
  543.  
  544.                                    VIMSEL_NOT_SUPPORTED - Not supported
  545.                                    VIMSEL_SUPP_WITH_CONV - Support with conversion at source
  546.                                    VIMSEL_SUPP_WITHOUT_CONV - Support without conversion at source
  547.  
  548. VIMSEL_ALL_NOTE_PARTS_SUPP      Returns TRUE if all notes part types are supported
  549.                                 without conversion
  550.  
  551. VIMSEL_ATTACH_TYPE_SUPP         Returns TRUE if types are supported for file attachment
  552.  
  553. VIMSEL_ATTACH_DIRS              Returns level of support for attaching directories
  554.  
  555.                                    VIMSEL_NOT_SUPPORTED - Not supported
  556.                                    VIMSEL_SUPP_WITH_CONV - Support with conversion at source
  557.                                    VIMSEL_SUPP_WITHOUT_CONV - Support without conversion at source
  558.  
  559. VIMSEL_ENCRYPT                  Returns TRUE if key-based encryption is supported
  560.  
  561. VIMSEL_ENCRYPT_WITH_KEY         Returns TRUE if explicit key-based encryption is
  562.                                 supported
  563.  
  564. VIMSEL_SIGN                     Returns TRUE if signatures are supported
  565.  
  566. VIMSEL_NSTD_DERIVED_REPLIES     Returns TRUE if replies are generated as nested
  567.                                 messages
  568.  
  569. VIMSEL_NSTD_DERIVED_FORWRDS     Returns TRUE if forwarded message are generated
  570.                                 as nested messages
  571.  
  572. VIMSEL_CP850                    Returns TRUE if the IBM 850 code page is supported
  573.  
  574. VIMSEL_CP1252                   Returns TRUE if the IBM 1252 code page is supported
  575.  
  576. VIMSEL_CP437                    Returns TRUE if the IBM 437 code page is supported
  577.  
  578. VIMSEL_LMBSC                    Returns TRUE if Lotus Multi-Byte Character Set is
  579.                                 supported
  580.  
  581. VIMSEL_ISTRING                  Returns TRUE if Apple International strings are
  582.                                 supported
  583.  
  584. VIMSEL_UNICODE                  Returns TRUE if Unicode multi-byte characters are
  585.                                 supported
  586.  
  587. VIMSEL_APPLESINGLE              Returns TRUE if AppleSingle file attachments are
  588.                                 supported
  589.  
  590. VIMSEL_PATH_REQUIRED            Returns TRUE if database path must be specified
  591.                                 during a RxVIMOpenSession
  592.  
  593. VIMSEL_NAME_REQUIRED            Returns TRUE if user name must be specified
  594.                                 during a RxVIMOpenSession
  595.  
  596. VIMSEL_PASS_REQUIRED            Returns TRUE if the password must be specified
  597.                                 during a RxVIMOpenSession
  598.  
  599.  
  600. ΓòÉΓòÉΓòÉ 7.2.2. Return Codes ΓòÉΓòÉΓòÉ
  601.  
  602. The RxVIMQueryCapability function returns the following values 
  603.  
  604.         0 - Successful initialization
  605.  
  606. The return values from all of the function calls return a zero for success, and 
  607. non-zero for failure.  To retrieve the actual failure reason, use the 
  608. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  609. value to the actual failure text.  Using RxVIMStatus, the following values may 
  610. be returned by RxVIMQueryCapability: 
  611.  
  612.         VIMSTS_SUCCESS          Successful Initialization
  613.         VIMSTS_FAILURE          Initialization Failed
  614.  
  615.         VIMSTS_BAD_PARAM        Bad parameter passed to function
  616.         VIMSTS_BUF_TOO_SMALL    Results exceed size of return variable
  617.         VIMSTS_INVALID_SELECTOR Selector is unknown
  618.  
  619.  
  620. ΓòÉΓòÉΓòÉ 7.2.3. Example ΓòÉΓòÉΓòÉ
  621.  
  622. /* Example of using RxVIMQueryCapability */
  623.  
  624. /* The RxLoadFuncs function loads all of the VIM extensions */
  625. call RxFuncAdd 'RxLoadFuncs', 'RexxVIM', 'RxLoadFuncs'
  626. call RxLoadFuncs
  627.  
  628. /* This will establish a connection to the VIM system */
  629. rc = RxVIMInitialize()
  630.  
  631.  
  632. /* Query the VIM system for product version level */
  633. rc = RxVIMQueryCapability('VIMSEL_VERSION', 'Version')
  634. Say 'VIM Version is' Version
  635. Say
  636. /* Query the VIM system for Max Subject Line Length */
  637. rc = RxVIMQueryCapability('VIMSEL_MAX_SUBJECT_LEN', 'Subject_Length')
  638. Say 'The maximum subject line length is' Subject_Length
  639. Say
  640.  
  641.  
  642. /* The RxDropFuncs function unloads all of the VIM extensions */
  643. call RxDropFuncs
  644.  
  645.  
  646. ΓòÉΓòÉΓòÉ 7.3. RxVIMDefaultSessionInfo ΓòÉΓòÉΓòÉ
  647.  
  648. The RxVIMDefaultSessionInfo function obtains the default user name and database 
  649. path name.  This information can then be passed to the VIM system during a 
  650. RxVIMOpenSession. 
  651.  
  652.  
  653. ΓòÉΓòÉΓòÉ 7.3.1. Syntax ΓòÉΓòÉΓòÉ
  654.  
  655. RxVIMDefaultSessionInfo is called with two parameters. The first parameter is 
  656. the variable to return the default path, and the second is the variable to 
  657. return the default name.  This function will return a null value if no default 
  658. session information exists. 
  659.  
  660. call RxVIMDefaultSessionInfo 'path_variable', 'name_variable'
  661.  
  662. or
  663.  
  664. rc = RxVIMDefaultSessionInfo('path_variable', 'name_variable')
  665.  
  666.  
  667. ΓòÉΓòÉΓòÉ 7.3.2. Return Codes ΓòÉΓòÉΓòÉ
  668.  
  669. The RxVIMDefaultSessionInfo function returns the following values: 
  670.  
  671.         0 - Successful initialization
  672.  
  673. The return values from all of the function calls return a zero for success, and 
  674. non-zero for failure.  To retrieve the actual failure reason, use the 
  675. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  676. value to the actual failure text.  Using RxVIMStatus, the following values may 
  677. be returned by RxVIMDefaultSessionInfo: 
  678.  
  679.         VIMSTS_SUCCESS                  Successful return
  680.         VIMSTS_FAILURE                  Function Failed
  681.  
  682.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  683.         VIMSTS_BUF_TOO_SMALL            Results exceed size of return variable
  684.         VIMSTS_INVALID_CONFIGURATION    Underlying configuration is incorrectly configured
  685.  
  686.  
  687. ΓòÉΓòÉΓòÉ 7.3.3. Example ΓòÉΓòÉΓòÉ
  688.  
  689. /* Example of using RxVIMDefaultSessionInfo */
  690.  
  691. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  692. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  693. call RxVIMLoadFuncs
  694.  
  695.  
  696. /* This will establish a connection to the VIM system */
  697. rc = RxVIMInitialize()
  698.  
  699. /* Obtain the default session information */
  700. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  701.  
  702. Say 'Default path:' db_path
  703. Say 'Default name:' user_name
  704.  
  705. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  706. call RxVIMDropFuncs
  707.  
  708.  
  709. ΓòÉΓòÉΓòÉ 7.4. RxVIMOpenSession ΓòÉΓòÉΓòÉ
  710.  
  711. The RxVIMOpenSession function establishes an active session with the VIM 
  712. system. 
  713.  
  714.  
  715. ΓòÉΓòÉΓòÉ 7.4.1. Syntax ΓòÉΓòÉΓòÉ
  716.  
  717. RxVIMOpenSession is called with four parameters. The first parameter is the 
  718. location of the postoffice. The second is the name of the user opening the 
  719. session.  The third parameter is the password of the user opening the session. 
  720. If all of the parameters are not required, then a NULL string ('') is required 
  721. in its location.  The fourth parameter which will contain the Session handle is 
  722. required.  The session handle will be used in other calls to allow multiple 
  723. sessions to be opened concurrently. 
  724.  
  725. call RxVIMOpenSession 'location', 'username', 'password', 'Session'
  726.  
  727. or
  728.  
  729. rc = RxVIMOpenSession('location', 'username', 'password', 'Session')
  730.  
  731.  
  732. ΓòÉΓòÉΓòÉ 7.4.2. Return Codes ΓòÉΓòÉΓòÉ
  733.  
  734. The RxVIMOpenSession function returns the following values: 
  735.  
  736.         0 - Successful session established
  737.  
  738. The return values from all of the function calls return a zero for success, and 
  739. non-zero for failure.  To retrieve the actual failure reason, use the 
  740. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  741. value to the actual failure text.  Using RxVIMStatus, the following values may 
  742. be returned by RxVIMOpenSession: 
  743.  
  744.         VIMSTS_SUCCESS                  Successful return
  745.         VIMSTS_FAILURE                  Function Failed
  746.  
  747.         VIMSTS_ALL_PARAMS_REQUIRED      All values are required
  748.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  749.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory to open session
  750.         VIMSTS_INVALID_CONFIGURATION    Underlying configuration is incorrectly configured
  751.         VIMSTS_INVALID_PASSWORD         Password is incorrect
  752.         VIMSTS_OPEN_FAILURE             Message system could not be opened
  753.         VIMSTS_PASS_REQUIRED            A Password is required
  754.         VIMSTS_UNSUP_VERSION            VIM version not supported
  755.  
  756.  
  757. ΓòÉΓòÉΓòÉ 7.4.3. Example ΓòÉΓòÉΓòÉ
  758.  
  759. /* Example of using RxVIMOpenSession */
  760.  
  761. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  762. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  763. call RxVIMLoadFuncs
  764.  
  765.  
  766. /* This will establish a connection to the VIM system */
  767. rc = RxVIMInitialize()
  768.  
  769. /* Obtain the default session information */
  770. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  771.  
  772. Say 'Default path:' db_path
  773. Say 'Default name:' user_name
  774.  
  775. /* Opening a session with the mail subsystem */
  776. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  777.  
  778. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  779. call RxVIMDropFuncs
  780.  
  781.  
  782. ΓòÉΓòÉΓòÉ 7.5. RxVIMOpenGatewaySession ΓòÉΓòÉΓòÉ
  783.  
  784. The RxVIMOpenGatewaySession function establishes an active session with the VIM 
  785. system with special gateway capabilities. 
  786.  
  787. **THIS FUNCTION IS AN EXTENSION TO VIM, AND IS CURRENTLY NOT SUPPORTED** 
  788.  
  789.  
  790. ΓòÉΓòÉΓòÉ 7.6. RxVIMGetEntityName ΓòÉΓòÉΓòÉ
  791.  
  792. The RxVIMGetEntityName function obtains the current name associated with the 
  793. active session.  It also retrieves the type of entity, and the associated 
  794. addressbook. 
  795.  
  796.  
  797. ΓòÉΓòÉΓòÉ 7.6.1. Syntax ΓòÉΓòÉΓòÉ
  798.  
  799. RxVIMGetEntityName is called with two parameters.  The first parameter is the 
  800. session handle returned from the RxVIMOpenSession function. The second 
  801. parameter is a Rexx variable that will be used as a stem variable for the three 
  802. portions of the return information. The type of the entity will be returned in 
  803. the stem_variable.Type location. The name of the entity will be returned in the 
  804. stem_variable.Name location. The addressbook of the entity will be returned in 
  805. the stem_variable.AddressBook location. 
  806.  
  807. call RxVIMGetEntityName session, 'stem_variable'
  808.  
  809. or
  810.  
  811. rc = RxVIMGetEntityName(session, 'stem_variable'))
  812.  
  813.  
  814. ΓòÉΓòÉΓòÉ 7.6.2. Return Codes ΓòÉΓòÉΓòÉ
  815.  
  816. The RxVIMGetEntityName function returns the following values: 
  817.  
  818.         0 - Successful session termination
  819.  
  820. The return values from all of the function calls return a zero for success, and 
  821. non-zero for failure.  To retrieve the actual failure reason, use the 
  822. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  823. value to the actual failure text.  Using RxVIMStatus, the following values may 
  824. be returned by RxVIMGetEntityName: 
  825.  
  826.         VIMSTS_SUCCESS                  Successful return
  827.         VIMSTS_FAILURE                  Function Failed
  828.  
  829.         VIMSTS_BAD_PARAM                Invalid parameter
  830.         VIMSTS_BUF_TOO_SMALL            Name or Address too large for buffer
  831.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory for function
  832.         VIMSTS_INVALID_CONFIGURATION    VIM subsystem is incorrectly configured
  833.         VIMSTS_INVALID_OBJECT           The session handle is bad
  834.         VIMSTS_NO_DEFAULT               NULL session is not supported
  835.  
  836.  
  837. ΓòÉΓòÉΓòÉ 7.6.3. Example ΓòÉΓòÉΓòÉ
  838.  
  839. /* Example of using RxVIMGetEntityName */
  840.  
  841. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  842. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  843. call RxVIMLoadFuncs
  844.  
  845.  
  846. /* This will establish a connection to the VIM system */
  847. rc = RxVIMInitialize()
  848.  
  849. /* Opening a session with the mail subsystem */
  850. rc = RxVIMOpenSession('db_path', 'Mark Stevens', 'SNOOPY', 'Sess')
  851.  
  852. /* Display the type, name, and addressbook of active session */
  853. rc = RXVIMGetEntityName(Sess, 'Entity.')
  854. Say 'Active VIM Session'
  855. Say
  856. Say 'Type:        ' Entity.Type
  857. Say 'Name:        ' Entity.Name
  858. Say 'Addressbook: ' Entity.AddressBook
  859.  
  860. /* Closing the session with the mail subsystem */
  861. rc = RxVIMCloseSession()
  862.  
  863. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  864. call RxVIMDropFuncs
  865.  
  866.  
  867. ΓòÉΓòÉΓòÉ 7.7. RxVIMCloseSession ΓòÉΓòÉΓòÉ
  868.  
  869. The RxVIMCloseSession function closes the current session with the VIM system 
  870. and frees all resources.  This function should be called in any program that 
  871. issues an RxVIMOpenSession function. 
  872.  
  873.  
  874. ΓòÉΓòÉΓòÉ 7.7.1. Syntax ΓòÉΓòÉΓòÉ
  875.  
  876. RxVIMCloseSession is called with with the session handle of the session to 
  877. close. 
  878.  
  879. call RxVIMCloseSession session
  880.  
  881. or
  882.  
  883. rc = RxVIMCloseSession(session)
  884.  
  885.  
  886. ΓòÉΓòÉΓòÉ 7.7.2. Return Codes ΓòÉΓòÉΓòÉ
  887.  
  888. The RxVIMCloseSession function returns the following values: 
  889.  
  890.         0 - Successful session termination
  891.  
  892. The return values from all of the function calls return a zero for success, and 
  893. non-zero for failure.  To retrieve the actual failure reason, use the 
  894. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  895. value to the actual failure text.  Using RxVIMStatus, the following values may 
  896. be returned by RxVIMCloseSession: 
  897.  
  898.         VIMSTS_SUCCESS                  Successful return
  899.         VIMSTS_FAILURE                  Function Failed
  900.  
  901.         VIMSTS_INVALID_OBJECT           The session handle is bad
  902.  
  903.  
  904. ΓòÉΓòÉΓòÉ 7.7.3. Example ΓòÉΓòÉΓòÉ
  905.  
  906. /* Example of using RxVIMCloseSession */
  907.  
  908. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  909. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  910. call RxVIMLoadFuncs
  911.  
  912.  
  913. /* This will establish a connection to the VIM system */
  914. rc = RxVIMInitialize()
  915.  
  916. /* Obtain the default session information */
  917. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  918.  
  919. Say 'Default path:' db_path
  920. Say 'Default name:' user_name
  921.  
  922. /* Opening a session with the mail subsystem */
  923. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  924.  
  925. /* Closing the session with the mail subsystem */
  926. rc = RxVIMCloseSession( Sess )
  927.  
  928. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  929. call RxVIMDropFuncs
  930.  
  931.  
  932. ΓòÉΓòÉΓòÉ 7.8. RxVIMTerminate ΓòÉΓòÉΓòÉ
  933.  
  934. The RxVIMTerminate function ends the connection to the VIM system.  This 
  935. function must be the last RexxVIM function called. 
  936.  
  937.  
  938. ΓòÉΓòÉΓòÉ 7.8.1. Syntax ΓòÉΓòÉΓòÉ
  939.  
  940. RxVIMTerminate is called with no parameters. 
  941.  
  942. call RxVIMTerminate
  943.  
  944. or
  945.  
  946. rc = RxVIMTerminate()
  947.  
  948.  
  949. ΓòÉΓòÉΓòÉ 7.8.2. Return Codes ΓòÉΓòÉΓòÉ
  950.  
  951. The RxVIMTerminate function returns the following values: 
  952.  
  953.         0 - Successful session termination
  954.  
  955. The return values from all of the function calls return a zero for success, and 
  956. non-zero for failure.  To retrieve the actual failure reason, use the 
  957. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  958. value to the actual failure text.  Using RxVIMStatus, the following values may 
  959. be returned by RxVIMTerminate: 
  960.  
  961.         VIMSTS_SUCCESS                  Successful return
  962.         VIMSTS_FAILURE                  Function Failed
  963.  
  964.  
  965. ΓòÉΓòÉΓòÉ 7.8.3. Example ΓòÉΓòÉΓòÉ
  966.  
  967. /* Example of using RxVIMTerminate */
  968.  
  969. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  970. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  971. call RxVIMLoadFuncs
  972.  
  973. /* This will establish a connection to the VIM system */
  974. rc = RxVIMInitialize()
  975.  
  976. /* This will terminate the connection to the VIM system */
  977. rc = RxVIMTerminate()
  978.  
  979. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  980. call RxVIMDropFuncs
  981.  
  982.  
  983. ΓòÉΓòÉΓòÉ 7.9. RxVIMStatusText ΓòÉΓòÉΓòÉ
  984.  
  985. The RxVIMStatusText function converts RexxVIM return values into the 
  986. corresponding text message.  The function allows the program to operate on the 
  987. VIM Status messages without decoding the actual return value. 
  988.  
  989.  
  990. ΓòÉΓòÉΓòÉ 7.9.1. Syntax ΓòÉΓòÉΓòÉ
  991.  
  992. RxVIMStatusText is called with three parameters. The first parameter is the 
  993. session handle for the session to use for the function call. The second 
  994. parameter is the status code in which text information is desired.  The third 
  995. parameter is a Rexx variable that will be used as a stem variable for the two 
  996. portions of the return text.  The VIM status code will be returned in the 
  997. stem_variable.1 location.  The extended text will be returned in the 
  998. stem_variable.2 location.  Not all status code have both parts, in which case a 
  999. null will be returned for extended text. 
  1000.  
  1001. call RxVIMStatusText session, 'Status', 'stem_variable'
  1002.  
  1003. or
  1004.  
  1005. rc = RxVIMStatusText(session, 'Status', 'stem_variable')
  1006.  
  1007.  
  1008. ΓòÉΓòÉΓòÉ 7.9.2. Return Codes ΓòÉΓòÉΓòÉ
  1009.  
  1010. The RxVIMStatusText function returns the following values: 
  1011.  
  1012.         0 - Successful session termination
  1013.  
  1014. The return values from all of the function calls return a zero for success, and 
  1015. non-zero for failure.  To retrieve the actual failure reason, use the 
  1016. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  1017. value to the actual failure text.  Using RxVIMStatus, the following values may 
  1018. be returned by RxVIMStatusText: 
  1019.  
  1020.         VIMSTS_SUCCESS                  Successful return
  1021.         VIMSTS_FAILURE                  Function Failed
  1022.  
  1023.         VIMSTS_NOT_SUPPORTED            Error text strings are not supported
  1024.  
  1025.  
  1026. ΓòÉΓòÉΓòÉ 7.9.3. Example ΓòÉΓòÉΓòÉ
  1027.  
  1028. /* Example of using RxVIMStatusText */
  1029.  
  1030. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  1031. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  1032. call RxVIMLoadFuncs
  1033.  
  1034.  
  1035. /* This will establish a connection to the VIM system */
  1036. rc = RxVIMInitialize()
  1037.  
  1038. /* Opening a session with the mail subsystem */
  1039. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  1040.  
  1041. /* Display the type, name, and addressbook of active session */
  1042. Init = RXVIMGetEntityName(Sess, 'Entity.')
  1043.  
  1044. /* This will print the text associated with the return code */
  1045. /* from the above function call.  It will also print the    */
  1046. /* extended status if it exists.                            */
  1047.  
  1048. rc = RxVIMStatusText(Sess, Init, 'status')
  1049.  
  1050. Say 'Return Status:   ' status.1
  1051. if LENGTH(status.2) > 0 then do
  1052.    Say 'Extended Status: ' status.2
  1053. end
  1054.  
  1055. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  1056. call RxVIMDropFuncs
  1057.  
  1058.  
  1059. ΓòÉΓòÉΓòÉ 8. Message Creation and Submission Functions ΓòÉΓòÉΓòÉ
  1060.  
  1061. This section describes each of the functions available in the RexxVIM product 
  1062. that address message creation and submission features. 
  1063.  
  1064.  
  1065. ΓòÉΓòÉΓòÉ 8.1. RxVIMCreateMessage ΓòÉΓòÉΓòÉ
  1066.  
  1067. The RxVIMCreateMessage function creates a new message area and prepares it for 
  1068. composition. 
  1069.  
  1070.  
  1071. ΓòÉΓòÉΓòÉ 8.1.1. Syntax ΓòÉΓòÉΓòÉ
  1072.  
  1073. RxVIMCreateMessage is called with three parameters.  The first parameter is the 
  1074. session handle. The second parameter is the type of message being created. 
  1075. VIM_MAIL will be used for all mail messages.  The third parameter is the 
  1076. variable to contain the message handle. 
  1077.  
  1078. call RxVIMCreateMessage session, 'VIM_MAIL', 'Message'
  1079.  
  1080. or
  1081.  
  1082. rc = RxVIMCreateMessage(session, 'VIM_MAIL', 'Message')
  1083.  
  1084.  
  1085. ΓòÉΓòÉΓòÉ 8.1.2. Return Codes ΓòÉΓòÉΓòÉ
  1086.  
  1087. The RxVIMCreateMessage function returns the following values: 
  1088.  
  1089.         0 - Successful session termination
  1090.  
  1091. The return values from all of the function calls return a zero for success, and 
  1092. non-zero for failure.  To retrieve the actual failure reason, use the 
  1093. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  1094. value to the actual failure text.  Using RxVIMStatus, the following values may 
  1095. be returned by RxVIMCreateMessage: 
  1096.  
  1097.         VIMSTS_SUCCESS                  Successful return
  1098.         VIMSTS_FAILURE                  Function Failed
  1099.  
  1100.         VIMSTS_BAD_PARAM                Invalid parameter
  1101.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory for function
  1102.         VIMSTS_INVALID_OBJECT           The session handle is bad
  1103.         VIMSTS_UNSUP_TYPE               The type passed is not supported
  1104.  
  1105.  
  1106. ΓòÉΓòÉΓòÉ 8.1.3. Example ΓòÉΓòÉΓòÉ
  1107.  
  1108. /* Example of using RxVIMCreateMessage */
  1109.  
  1110. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  1111. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  1112. call RxVIMLoadFuncs
  1113.  
  1114.  
  1115. /* This will establish a connection to the VIM system */
  1116. rc = RxVIMInitialize()
  1117.  
  1118. /* Opening a session with the mail subsystem */
  1119. rc = RxVIMOpenSession('db_path', 'Mark Stevens', 'SNOOPY', 'Sess')
  1120.  
  1121. /* Create a new message for composition */
  1122. rc = RxVIMCreateMessage(Sess, 'VIM_MAIL', 'Message')
  1123.  
  1124. /* NOTE:                                                   */
  1125. /* Message will be discarded, since the program is closing */
  1126. /* the session without processing the message              */
  1127.  
  1128. /* Closing the session with the mail subsystem */
  1129. rc = RxVIMCloseSession()
  1130.  
  1131. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  1132. call RxVIMDropFuncs
  1133.  
  1134.  
  1135. ΓòÉΓòÉΓòÉ 8.2. RxVIMCreateDerivedMailMessage ΓòÉΓòÉΓòÉ
  1136.  
  1137. The RxVIMCreateDerivedMailMessage function uses the contents of an existing 
  1138. message to create a new message.  This function can be used to create forwarded 
  1139. messages, and replies that include the original message content. 
  1140.  
  1141.  
  1142. ΓòÉΓòÉΓòÉ 8.2.1. Syntax ΓòÉΓòÉΓòÉ
  1143.  
  1144. RxVIMCreateDerivedMailMessage is called with four parameters.  The first 
  1145. parameter is the handle of the original message to create the derived message. 
  1146. The second parameter is the type of message being created. The third parameter 
  1147. is a flag to indicate options for the message.  The fourth parameter is the 
  1148. variable to contain the message handle of the derived message. 
  1149.  
  1150. call RxVIMCreateDerivedMailMessage MsgPtr, 'type', 'flags', 'Message'
  1151.  
  1152. or
  1153.  
  1154. rc = RxVIMCreateDerivedMailMessage(session, 'type', 'flags', 'Message')
  1155.  
  1156. Listed below are the valid selectors to indicate the type of derived message: 
  1157.  
  1158. VIMSEL_FORWARD                  Message will be directed to new recipients
  1159.  
  1160. VIMSEL_REPLY                    Message will be returned to sender
  1161.  
  1162. Listed below are the valid flags to indicate the style of derived message: 
  1163.  
  1164. VIM_NO_FLAGS                    No flags specified
  1165.  
  1166. VIM_HISTORY                     Previous forwarding history to be maintained
  1167.                                 (For VIMSEL_FORWARD)
  1168.  
  1169. VIM_INHERIT_CONTENTS            Previous contents will be maintained with new
  1170.                                 message (For VIMSEL_REPLY)
  1171.  
  1172. VIM_ALL_RECIPIENTS              New message will be returned to all recipients,
  1173.                                 not just the sender (For VIMSEL_REPLY)
  1174.  
  1175.  
  1176. ΓòÉΓòÉΓòÉ 8.2.2. Return Codes ΓòÉΓòÉΓòÉ
  1177.  
  1178. The RxVIMCreateDerivedMailMessage function returns the following values: 
  1179.  
  1180.         0 - Successful session termination
  1181.  
  1182. The return values from all of the function calls return a zero for success, and 
  1183. non-zero for failure.  To retrieve the actual failure reason, use the 
  1184. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  1185. value to the actual failure text.  Using RxVIMStatus, the following values may 
  1186. be returned by RxVIMCreateDerivedMailMessage: 
  1187.  
  1188.         VIMSTS_SUCCESS                  Successful return
  1189.         VIMSTS_FAILURE                  Function Failed
  1190.  
  1191.         VIMSTS_BAD_PARAM                Invalid parameter
  1192.         VIMSTS_INVALID_OBJECT           The message handle is bad
  1193.         VIMSTS_INVALID_SELECTOR         The type is bad
  1194.  
  1195.  
  1196. ΓòÉΓòÉΓòÉ 8.2.3. Example ΓòÉΓòÉΓòÉ
  1197.  
  1198. /* Example of using RxVIMCreateDerivedMailMessage */
  1199.  
  1200. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  1201. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  1202. call RxVIMLoadFuncs
  1203.  
  1204.  
  1205. /* This will establish a connection to the VIM system */
  1206. rc = RxVIMInitialize()
  1207.  
  1208. /* Opening a session with the mail subsystem */
  1209. rc = RxVIMOpenSession('db_path', 'Mark Stevens', 'SNOOPY', 'Sess')
  1210.  
  1211. /* Open the default message container (Inbox) */
  1212. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  1213.  
  1214. /* Retrieve the first message from the container pulling the */
  1215. /* message reference number only                             */
  1216. attrDesc.0 = 1
  1217. attrDesc.selector = 'VIMSEL_REF'
  1218. attrDesc.buffer   = 'refno'
  1219.  
  1220. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  1221.                             '','VIM_NO_FLAGS','more')
  1222.  
  1223. /* Open the first message */
  1224. rc = RxVIMOpenMessage(MsgCont,refno.1,'','OldMsg')
  1225.  
  1226.  
  1227.  
  1228. /* Create a forward message for composition */
  1229. rc = RxVIMCreateDerivedMailMessage(OldMsg, 'VIM_FORWARD', 'VIM_NO_FLAGS', 'Message')
  1230.  
  1231.  
  1232.  
  1233. /* NOTE:                                                   */
  1234. /* Message will be discarded, since the program is closing */
  1235. /* the session without processing the message              */
  1236.  
  1237. /* Closing the session with the mail subsystem */
  1238. rc = RxVIMCloseSession()
  1239.  
  1240. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  1241. call RxVIMDropFuncs
  1242.  
  1243.  
  1244. ΓòÉΓòÉΓòÉ 8.3. RxVIMSetMessageHeader ΓòÉΓòÉΓòÉ
  1245.  
  1246. The RxVIMSetMessageHeader function sets the value of message attributes.  This 
  1247. function is used to set attributes such as subject, priority, and return 
  1248. receipt. 
  1249.  
  1250.  
  1251. ΓòÉΓòÉΓòÉ 8.3.1. Syntax ΓòÉΓòÉΓòÉ
  1252.  
  1253. The RxVIMSetMessageHeader function is called with three parameters.  The first 
  1254. parameter is the message handle from the RxVIMCreateMessage function call.  The 
  1255. second parameter is the selector for the attribute to set, and the third is the 
  1256. value for the attribute. 
  1257.  
  1258. call RxVIMSetMessageHeader message, 'selector', 'value'
  1259.  
  1260. or
  1261.  
  1262. rc = RxVIMSetMessageHeader(message, 'selector', 'value')
  1263.  
  1264. Listed below are the valid selectors to use to set message header attributes: 
  1265.  
  1266. VIMSEL_SUBJECT                  Sets the text for the subject up to
  1267.                                 the maximum supported.  Use the
  1268.                                 RxVIMQueryCapability to determine
  1269.                                 maximum length.
  1270.  
  1271. VIMSEL_PRIORITY                 Sets the importance of the message.
  1272.                                 Valid options are:
  1273.  
  1274.                                 VIMSEL_LOW_PRIORITY
  1275.                                 VIMSEL_NORMAL_PRIORITY  (default value)
  1276.                                 VIMSEL_HIGH_PRIORITY
  1277.  
  1278. VIMSEL_DELIVERY_REPORT          If supported, this attribute will
  1279.                                 report the delivery for each recipient
  1280.                                 a successful delivery is made.  Valid
  1281.                                 options to pass are:
  1282.  
  1283.                                 VIM_TRUE
  1284.                                 VIM_FALSE
  1285.  
  1286. VIMSEL_NONDELIVERY_REPORT       If supported, this attribute will
  1287.                                 report the delivery for each recipient
  1288.                                 a unsuccessful delivery is made.  Valid
  1289.                                 options to pass are:
  1290.  
  1291.                                 VIM_TRUE
  1292.                                 VIM_FALSE
  1293.  
  1294. VIMSEL_NONDELIVERY_CONTENTS     If supported, this attribute will
  1295.                                 report the delivery for each recipient
  1296.                                 a unsuccessful delivery is made. The
  1297.                                 report will include the contents of
  1298.                                 the original message. Valid options to
  1299.                                 pass are:
  1300.  
  1301.                                 VIM_TRUE
  1302.                                 VIM_FALSE
  1303.  
  1304. VIMSEL_ENCRYPT                  If supported, this attribute will
  1305.                                 cause the message to be encrypted with
  1306.                                 an implicit key.  Valid options to
  1307.                                 pass are:
  1308.  
  1309.                                 VIM_TRUE
  1310.                                 VIM_FALSE
  1311.  
  1312. VIMSEL_ENCRYPT_WITH_KEY         If supported, this attribute will
  1313.                                 cause the message to be encrypted with
  1314.                                 an explicit key.  Valid options to
  1315.                                 pass are:
  1316.  
  1317.                                 VIM_TRUE
  1318.                                 VIM_FALSE
  1319.  
  1320. VIMSEL_SIGN                     If supported, this attribute will
  1321.                                 cause the message to be signed.
  1322.                                 Valid options to pass are:
  1323.  
  1324.                                 VIM_TRUE
  1325.                                 VIM_FALSE
  1326.  
  1327. VIMSEL_CONVERSATION_ID          If supported, this attribute will
  1328.                                 set the conversation id.
  1329.  
  1330. VIMSEL_SENSITIVITY              If supported, this attribute will
  1331.                                 set the sensitivity of the message.
  1332.                                 Valid options to pass are:
  1333.  
  1334.                                 VIMSEL_NORMAL_SENS
  1335.                                 VIMSEL_PRIVATE_SENS
  1336.                                 VIMSEL_PERSONAL_SENS
  1337.                                 VIMSEL_CO_CONFID_SENS
  1338.  
  1339. VIMSEL_IN_REPLY_TO              If supported, this attribute will
  1340.                                 set id of the message that the current
  1341.                                 message is in reply to.
  1342.  
  1343. VIMSEL_RESPOND_BY               If supported, this attribute will
  1344.                                 set date the message must responded to.
  1345.  
  1346. VIMSEL_KEYWORD                  If supported, this attribute will
  1347.                                 set a keyword for the current message.
  1348.  
  1349. VIMSEL_RETURN_RECEIPT           This attribute sets the request for
  1350.                                 a return receipt on/off.  Valid
  1351.                                 options to pass are:
  1352.  
  1353.                                 VIM_TRUE
  1354.                                 VIM_FALSE
  1355.  
  1356. VIMSEL_SAVE                     This attribute sets the request for
  1357.                                 a copy of the message to be saved
  1358.                                 when it is sent. Valid options to
  1359.                                 pass are:
  1360.  
  1361.                                 VIM_TRUE
  1362.                                 VIM_FALSE
  1363.  
  1364. VIMSEL_DRAFT                    This attribute sets the message to
  1365.                                 a draft.  If the session is closed
  1366.                                 without the message being sent, a
  1367.                                 copy will be saved. Valid options to
  1368.                                 pass are:
  1369.  
  1370.                                 VIM_TRUE
  1371.                                 VIM_FALSE
  1372.  
  1373.  
  1374. ΓòÉΓòÉΓòÉ 8.3.2. Return Codes ΓòÉΓòÉΓòÉ
  1375.  
  1376. The RxVIMSetMessageHeader function returns the following values: 
  1377.  
  1378.         0 - Successful return
  1379.  
  1380. The return values from all of the function calls return a zero for success, and 
  1381. non-zero for failure.  To retrieve the actual failure reason, use the 
  1382. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  1383. value to the actual failure text.  Using RxVIMStatus, the following values may 
  1384. be returned by RxVIMSetMessageHeader: 
  1385.  
  1386.         VIMSTS_SUCCESS                  Successful return
  1387.         VIMSTS_FAILURE                  Function Failed
  1388.  
  1389.         VIMSTS_BAD_PARAM                Invalid parameter
  1390.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory for function
  1391.         VIMSTS_INVALID_OBJECT           The session handle is bad
  1392.         VIMSTS_INVALID_SELECTOR         The selector passed is not valid
  1393.         VIMSTS_NOT_SUPPORTED            The selector passed is not supported
  1394.  
  1395.  
  1396. ΓòÉΓòÉΓòÉ 8.3.3. Example ΓòÉΓòÉΓòÉ
  1397.  
  1398. /* Example of using RxVIMSetMessageHeader */
  1399.  
  1400. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  1401. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  1402. call RxVIMLoadFuncs
  1403.  
  1404.  
  1405. /* This will establish a connection to the VIM system */
  1406. rc = RxVIMInitialize()
  1407.  
  1408. /* Opening a session with the mail subsystem */
  1409. rc = RxVIMOpenSession('db_path', 'Mark Stevens', 'SNOOPY', 'Sess')
  1410.  
  1411. /* Create a new message */
  1412. rc = RxVIMCreateMessage(Sess, 'VIM_MAIL', 'Message')
  1413.  
  1414. /* Set the subject of the message */
  1415. rc = RxVIMSetMessageHeader(Message, 'VIMSEL_SUBJECT', 'This will be the subject')
  1416.  
  1417. /* NOTE:                                                   */
  1418. /* Message will be discarded, since the program is closing */
  1419. /* the session without processing the message              */
  1420.  
  1421. /* Closing the session with the mail subsystem */
  1422. rc = RxVIMCloseSession( Sess )
  1423.  
  1424. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  1425. call RxVIMDropFuncs
  1426.  
  1427.  
  1428. ΓòÉΓòÉΓòÉ 8.4. RxVIMSetMessageRecipient ΓòÉΓòÉΓòÉ
  1429.  
  1430. The RxVIMSetMessageRecipient function adds values to the list of addressees for 
  1431. the active message. 
  1432.  
  1433.  
  1434. ΓòÉΓòÉΓòÉ 8.4.1. Syntax ΓòÉΓòÉΓòÉ
  1435.  
  1436. The RxVIMSetMessageRecipient function is called with eight parameters.  The 
  1437. first parameter is the message handle. The second parameter is the selector for 
  1438. the class of the recipient of the message.  The third parameter is the type of 
  1439. recipient. 
  1440.  
  1441. The recipient of the message can be specified in one of two ways, either a name 
  1442. entry or an addressbook entry.  If both are specified, the VIM system will use 
  1443. the addressbook entry only.  The fourth, fifth and sixth parameters are used to 
  1444. specify a name entry.  The seventh and eighth parameters are used to specify an 
  1445. adressbook entry. 
  1446.  
  1447. The fourth paramter is the type of entity, the fifth paramter is the 
  1448. addressbook for the entity, and the sixth parameter is the value of the entity. 
  1449.  
  1450. To specify the recipient as an addressbook entry, the seventh paramter is the 
  1451. type of address, and the eighth is the value of the entry. 
  1452.  
  1453. call RxVIMSetMessageRecipient message,'selector','entity_type','','',,
  1454.                               'user_name','',''
  1455.  
  1456. or
  1457.  
  1458. rc = RxVIMSetMessageRecipient(message,'selector','entity_type','','',,
  1459.                               'user_name','','')
  1460.  
  1461. Listed below are the valid selectors to use to set message class attributes: 
  1462.  
  1463. VIMSEL_TO                       Sets the recipient as a primary
  1464.                                 addressee for the message.
  1465.  
  1466. VIMSEL_CC                       Sets the recipient to receive a
  1467.                                 copy of the message.
  1468.  
  1469. VIMSEL_BCC                      Sets the recipient to receive
  1470.                                 a copy of the message, and not
  1471.                                 appear as a listed recipient.
  1472.  
  1473. Listed below are the valid selectors to use to set recipient type: 
  1474.  
  1475. VIMSEL_ENTITY                   Sets the type to a person entity
  1476.  
  1477. VIMSEL_GROUP                    Sets the type to a collection of
  1478.                                 entities.
  1479.  
  1480. VIMSEL_UNKNOWN_RECIP_TYPE       Sets the type to unknown.
  1481.  
  1482.  
  1483. ΓòÉΓòÉΓòÉ 8.4.2. Return Codes ΓòÉΓòÉΓòÉ
  1484.  
  1485. The RxVIMSetMessageRecipient function returns the following values: 
  1486.  
  1487.         0 - Successful return
  1488.  
  1489. The return values from all of the function calls return a zero for success, and 
  1490. non-zero for failure.  To retrieve the actual failure reason, use the 
  1491. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  1492. value to the actual failure text.  Using RxVIMStatus, the following values may 
  1493. be returned by RxVIMSetMessageRecipient: 
  1494.  
  1495.         VIMSTS_SUCCESS                  Successful return
  1496.         VIMSTS_FAILURE                  Function Failed
  1497.  
  1498.         VIMSTS_BAD_PARAM                Invalid parameter
  1499.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory for function
  1500.         VIMSTS_INVALID_OBJECT           The session handle is bad
  1501.         VIMSTS_INVALID_SELECTOR         The selector passed is not valid
  1502.         VIMSTS_NAME_NOT_FOUND           The name passed was not found
  1503.         VIMSTS_WRITE_FAILURE            Could not write to the disk
  1504.  
  1505.  
  1506. ΓòÉΓòÉΓòÉ 8.4.3. Example ΓòÉΓòÉΓòÉ
  1507.  
  1508. /* Example of using RxVIMSetMessageRecipient */
  1509.  
  1510. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  1511. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  1512. call RxVIMLoadFuncs
  1513.  
  1514.  
  1515. /* This will establish a connection to the VIM system */
  1516. rc = RxVIMInitialize()
  1517.  
  1518. /* Opening a session with the mail subsystem */
  1519. rc = RxVIMOpenSession('db_path', 'Mark Stevens', 'SNOOPY', 'Sess')
  1520.  
  1521. /* Create a new message */
  1522. rc = RxVIMCreateMessage(Sess, 'VIM_MAIL', 'Message')
  1523.  
  1524. /* Set the message to send back to creator id */
  1525. rc = RxVIMSetMessageRecipient(Message,'VIMSEL_TO','VIMSEL_ENTITY','','',,
  1526.                               'Mark Stevens','','')
  1527.  
  1528. /* NOTE:                                                   */
  1529. /* Message will be discarded, since the program is closing */
  1530. /* the session without processing the message              */
  1531.  
  1532. /* Closing the session with the mail subsystem */
  1533. rc = RxVIMCloseSession( Sess )
  1534.  
  1535. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  1536. call RxVIMDropFuncs
  1537.  
  1538.  
  1539. ΓòÉΓòÉΓòÉ 8.5. RxVIMSetMessageItem ΓòÉΓòÉΓòÉ
  1540.  
  1541. The RxVIMSetMessageItem function adds an item to the list of attachments for 
  1542. the active message.  This function allows items such as text, file attachments, 
  1543. etc. to be added to the content of the current message. 
  1544.  
  1545.  
  1546. ΓòÉΓòÉΓòÉ 8.5.1. Syntax ΓòÉΓòÉΓòÉ
  1547.  
  1548. The RxVIMSetMessageItem function is called with seven parameters.  The first 
  1549. parameter is the message handle. The second parameter is the selector for the 
  1550. class of the item being added to the message.  The third parameter is the type 
  1551. of the item being added to the message.  The fourth paramter is a selector 
  1552. value to set flags for the message item if it is a file attachment.  The fifth 
  1553. parameter is the name of the message item. For note parts, this will be the 
  1554. title of the item.  For file attachments, this will be the name that is used to 
  1555. specify the attachment. 
  1556.  
  1557. An item being added to a message can be specified in one of two ways, either by 
  1558. passing the contents of the item, or a filename. 
  1559.  
  1560. To specify the item contents directly, the sixth parameter is used to pass the 
  1561. contents.  If the item will be specified as a file, the sixth parameter should 
  1562. be set to NULL. 
  1563.  
  1564. To specify the item as a file, the seventh parameter is the name of the file. 
  1565. If the item will be passed directly, this parameter should be set to NULL. 
  1566.  
  1567. call RxVIMSetMessageItem message,'selector','item_type','flag','title',,
  1568.                               'content_buffer','filename'
  1569.  
  1570. or
  1571.  
  1572. call RxVIMSetMessageItem(message,'selector','item_type','flag','title',,
  1573.                               'content_buffer','filename')
  1574.  
  1575. Listed below are the valid selectors to use to set item class attributes: 
  1576.  
  1577. VIMSEL_NOTE_PART                Sets the item as part of a text note
  1578.  
  1579. VIMSEL_ATTACH                   Sets the item as an attachment, item
  1580.                                 type is ignored
  1581.  
  1582. VIMSEL_APP_DEFINED              Sets the item to be determined by
  1583.                                 the application
  1584.  
  1585. Listed below are the valid selectors to use to set item type: 
  1586.  
  1587. VIM_TEXT                        Sets the type to ASCII text
  1588.  
  1589. VIM_UNWRAPPED_TEXT              Sets the type to unwrapped text which
  1590.                                 terminates each paragraph with CR/LF.
  1591.  
  1592. VIM_RTF                         Sets the type to Microsoft rich-text
  1593.  
  1594. VIM_STYLED                      Sets the type to Macintosh text
  1595.  
  1596. VIM_FAX                         Sets the type to PCX-format fax image
  1597.  
  1598. VIM_PICT                        Sets the type to Macintosh picture
  1599.  
  1600. VIM_MOVIE                       Sets the type to QuickTime sound/video
  1601.  
  1602. VIM_IMAGE                       Sets the type to Macintosh-fax-image
  1603.  
  1604. Listed below are the valid selectors to use to set item flag attributes: 
  1605.  
  1606. VIMSEL_NATIVE                   Flag to indicate that file is in the
  1607.                                 native format of the system
  1608.  
  1609. VIMSEL_APPLESINGLE              Flag to indicate that file is in the
  1610.                                 Apple stream format
  1611.  
  1612.  
  1613. ΓòÉΓòÉΓòÉ 8.5.2. Return Codes ΓòÉΓòÉΓòÉ
  1614.  
  1615. The RxVIMSetMessageItem function returns the following values: 
  1616.  
  1617.         0 - Successful return
  1618.  
  1619. The return values from all of the function calls return a zero for success, and 
  1620. non-zero for failure.  To retrieve the actual failure reason, use the 
  1621. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  1622. value to the actual failure text.  Using RxVIMStatus, the following values may 
  1623. be returned by RxVIMSetMessageItem: 
  1624.  
  1625.         VIMSTS_SUCCESS                  Successful return
  1626.         VIMSTS_FAILURE                  Function Failed
  1627.  
  1628.         VIMSTS_ATTACHMENT_NOT_FOUND     File attachment not avialable
  1629.         VIMSTS_BAD_PARAM                Invalid parameter
  1630.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory for function
  1631.         VIMSTS_INVALID_OBJECT           The session handle is bad
  1632.         VIMSTS_INVALID_SELECTOR         The selector passed is not valid
  1633.         VIMSTS_OPEN_FAILURE             Cannot open specified file
  1634.         VIMSTS_READ_FAILURE             Cannot read from the disk
  1635.         VIMSTS_UNSUP_TYPE               Type value unknown
  1636.         VIMSTS_WRITE_FAILURE            Could not write to the disk
  1637.  
  1638.  
  1639. ΓòÉΓòÉΓòÉ 8.5.3. Example ΓòÉΓòÉΓòÉ
  1640.  
  1641. /* Example of using RxVIMSetMessageItem */
  1642.  
  1643. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  1644. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  1645. call RxVIMLoadFuncs
  1646.  
  1647.  
  1648. /* This will establish a connection to the VIM system */
  1649. rc = RxVIMInitialize()
  1650.  
  1651. /* Opening a session with the mail subsystem */
  1652. rc = RxVIMOpenSession('db_path', 'Mark Stevens', 'SNOOPY', 'Sess')
  1653.  
  1654. /* Create a new message */
  1655. rc = RxVIMCreateMessage(Sess, 'VIM_MAIL', 'Message')
  1656.  
  1657. /* Add text to the message */
  1658. rc = RxVIMSetMessageItem(Message,'VIMSEL_NOTE_PART','VIM_TEXT','VIMSEL_NATIVE',,
  1659.          'Test Text','Hey!  This is text passed directly....', '')
  1660.  
  1661. /* NOTE:                                                   */
  1662. /* Message will be discarded, since the program is closing */
  1663. /* the session without processing the message              */
  1664.  
  1665. /* Closing the session with the mail subsystem */
  1666. rc = RxVIMCloseSession( Sess )
  1667.  
  1668. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  1669. call RxVIMDropFuncs
  1670.  
  1671.  
  1672. ΓòÉΓòÉΓòÉ 8.6. RxVIMSendMessage ΓòÉΓòÉΓòÉ
  1673.  
  1674. The RxVIMSendMessage function submits the active message to the VIM system for 
  1675. processing and closes the message. 
  1676.  
  1677.  
  1678. ΓòÉΓòÉΓòÉ 8.6.1. Syntax ΓòÉΓòÉΓòÉ
  1679.  
  1680. RxVIMSendMessage is called with the message handle to send. 
  1681.  
  1682. call RxVIMSendMessage Message
  1683.  
  1684. or
  1685.  
  1686. rc = RxVIMSendMessage( Message )
  1687.  
  1688.  
  1689. ΓòÉΓòÉΓòÉ 8.6.2. Return Codes ΓòÉΓòÉΓòÉ
  1690.  
  1691. The RxVIMSendMessage function returns the following values: 
  1692.  
  1693.         0 - Successful session termination
  1694.  
  1695. The return values from all of the function calls return a zero for success, and 
  1696. non-zero for failure.  To retrieve the actual failure reason, use the 
  1697. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  1698. value to the actual failure text.  Using RxVIMStatus, the following values may 
  1699. be returned by RxVIMSendMessage: 
  1700.  
  1701.         VIMSTS_SUCCESS                  Successful return
  1702.         VIMSTS_FAILURE                  Function Failed
  1703.  
  1704.         VIMSTS_BAD_PARAM                Invalid parameter
  1705.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory for function
  1706.         VIMSTS_INVALID_OBJECT           The session handle is bad
  1707.         VIMSTS_NOT_SUPPORTED            Callbacks not supported
  1708.         VIMSTS_WRITE_FAILURE            Could not write to the disk
  1709.  
  1710.  
  1711. ΓòÉΓòÉΓòÉ 8.6.3. Example ΓòÉΓòÉΓòÉ
  1712.  
  1713. /* Example of using RxVIMSendMessage */
  1714.  
  1715. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  1716. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  1717. call RxVIMLoadFuncs
  1718.  
  1719.  
  1720. /* This will establish a connection to the VIM system */
  1721. rc = RxVIMInitialize()
  1722.  
  1723. /* Opening a session with the mail subsystem */
  1724. rc = RxVIMOpenSession('db_path', 'Mark Stevens', 'SNOOPY', 'Sess')
  1725.  
  1726. /* Create a new message for composition */
  1727. rc = RxVIMCreateMessage(Sess, 'VIM_MAIL', 'Message')
  1728.  
  1729. /* Set the message to send back to creator id */
  1730. rc = RxVIMSetMessageRecipient(Message,'VIMSEL_TO','VIMSEL_ENTITY','','',,
  1731.                               'Mark Stevens','','')
  1732.  
  1733. /* Add text to the message */
  1734. rc = RxVIMSetMessageItem(Message,'VIMSEL_NOTE_PART','VIM_TEXT','VIMSEL_NATIVE',,
  1735.          'Test Text','Hey!  This is text passed directly....', '')
  1736.  
  1737. /* Send the message */
  1738. rc = RxVIMSendMessage( Message )
  1739.  
  1740. /* Closing the session with the mail subsystem */
  1741. rc = RxVIMCloseSession( Sess )
  1742.  
  1743. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  1744. call RxVIMDropFuncs
  1745.  
  1746.  
  1747. ΓòÉΓòÉΓòÉ 8.7. RxVIMCloseMessage ΓòÉΓòÉΓòÉ
  1748.  
  1749. The RxVIMCloseMessage function closes the active message and frees any 
  1750. associated resources.  If the message type is not VIMSEL_DRAFT, the message is 
  1751. discarded.  VIMSEL_DRAFT messages are saved for later retrieval as a draft 
  1752. message. 
  1753.  
  1754.  
  1755. ΓòÉΓòÉΓòÉ 8.7.1. Syntax ΓòÉΓòÉΓòÉ
  1756.  
  1757. RxVIMCloseMessage is called with the message handle to close. 
  1758.  
  1759. call RxVIMCloseMessage Message
  1760.  
  1761. or
  1762.  
  1763. rc = RxVIMCloseMessage( Message )
  1764.  
  1765.  
  1766. ΓòÉΓòÉΓòÉ 8.7.2. Return Codes ΓòÉΓòÉΓòÉ
  1767.  
  1768. The RxVIMCloseMessage function returns the following values: 
  1769.  
  1770.         0 - Successful session termination
  1771.  
  1772. The return values from all of the function calls return a zero for success, and 
  1773. non-zero for failure.  To retrieve the actual failure reason, use the 
  1774. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  1775. value to the actual failure text.  Using RxVIMStatus, the following values may 
  1776. be returned by RxVIMCloseMessage: 
  1777.  
  1778.         VIMSTS_SUCCESS                  Successful return
  1779.         VIMSTS_FAILURE                  Function Failed
  1780.  
  1781.         VIMSTS_INVALID_OBJECT           The message handle is bad
  1782.  
  1783.  
  1784. ΓòÉΓòÉΓòÉ 8.7.3. Example ΓòÉΓòÉΓòÉ
  1785.  
  1786. /* Example of using RxVIMCloseMessage */
  1787.  
  1788. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  1789. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  1790. call RxVIMLoadFuncs
  1791.  
  1792.  
  1793. /* This will establish a connection to the VIM system */
  1794. rc = RxVIMInitialize()
  1795.  
  1796. /* Opening a session with the mail subsystem */
  1797. rc = RxVIMOpenSession('db_path', 'Mark Stevens', 'SNOOPY', "Sess')
  1798.  
  1799. /* Create a new message for composition */
  1800. rc = RxVIMCreateMessage(Sess, 'VIM_MAIL', 'Message')
  1801.  
  1802. /* Set the message to send back to creator id */
  1803. rc = RxVIMSetMessageRecipient(Message,'VIMSEL_TO','VIMSEL_ENTITY','','',,
  1804.                               'Mark Stevens','','')
  1805.  
  1806. /* Add text to the message */
  1807. rc = RxVIMSetMessageItem(Message,'VIMSEL_NOTE_PART','VIM_TEXT','VIMSEL_NATIVE',,
  1808.          'Test Text','Hey!  This is text passed directly....','')
  1809.  
  1810. /* Close the message without sending .... message will be discarded */
  1811. rc = RxVIMCloseMessage( Message )
  1812.  
  1813. /* Closing the session with the mail subsystem */
  1814. rc = RxVIMCloseSession( Sess )
  1815.  
  1816. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  1817. call RxVIMDropFuncs
  1818.  
  1819.  
  1820. ΓòÉΓòÉΓòÉ 9. Message Container Functions ΓòÉΓòÉΓòÉ
  1821.  
  1822. This section describes each of the functions available in the RexxVIM product 
  1823. that address message container features. 
  1824.  
  1825.  
  1826. ΓòÉΓòÉΓòÉ 9.1. RxVIMOpenMessageContainer ΓòÉΓòÉΓòÉ
  1827.  
  1828. The RxVIMOpenMessageContainer function opens the specified message container 
  1829. with the VIM system. 
  1830.  
  1831.  
  1832. ΓòÉΓòÉΓòÉ 9.1.1. Syntax ΓòÉΓòÉΓòÉ
  1833.  
  1834. RxVIMOpenMessageContainer is called with three parameters. The first parameter 
  1835. is the session to be used to open the message container. The second is the name 
  1836. of the message container to open.  A null ('') for the name will cause the 
  1837. system to open the default message container.  The third parameter is the 
  1838. variable name for the call to return a pointer to the message container. 
  1839.  
  1840. call RxVIMOpenMessageContainer Session, 'container', 'MsgPtr'
  1841.  
  1842. or
  1843.  
  1844. rc = RxVIMOpenMessageContainer(Session,'container','MsgPtr')
  1845.  
  1846.  
  1847. ΓòÉΓòÉΓòÉ 9.1.2. Return Codes ΓòÉΓòÉΓòÉ
  1848.  
  1849. The RxVIMOpenMessageContainer function returns the following values: 
  1850.  
  1851.         0 - Successful return
  1852.  
  1853. The return values from all of the function calls return a zero for success, and 
  1854. non-zero for failure.  To retrieve the actual failure reason, use the 
  1855. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  1856. value to the actual failure text.  Using RxVIMStatus, the following values may 
  1857. be returned by RxVIMOpenMessageContainer: 
  1858.  
  1859.         VIMSTS_SUCCESS                  Successful return
  1860.         VIMSTS_FAILURE                  Function Failed
  1861.  
  1862.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  1863.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory to open container
  1864.         VIMSTS_INVALID_OBJECT           The container handle is bad
  1865.         VIMSTS_NOT_SUPPORTED            Null container name not supported
  1866.         VIMSTS_OPEN_FAILURE             Container could not be opened
  1867.  
  1868.  
  1869. ΓòÉΓòÉΓòÉ 9.1.3. Example ΓòÉΓòÉΓòÉ
  1870.  
  1871. /* Example of using RxVIMOpenMessageContainer */
  1872.  
  1873. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  1874. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  1875. call RxVIMLoadFuncs
  1876.  
  1877.  
  1878. /* This will establish a connection to the VIM system */
  1879. rc = RxVIMInitialize()
  1880.  
  1881. /* Obtain the default session information */
  1882. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  1883.  
  1884. Say 'Default path:' db_path
  1885. Say 'Default name:' user_name
  1886.  
  1887. /* Opening a session with the mail subsystem */
  1888. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  1889.  
  1890. /* Open the default message container (Inbox) */
  1891. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  1892.  
  1893. /* Close the session with the mail subsystem */
  1894. rc = RxVIMCloseSession( Sess )
  1895.  
  1896. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  1897. call RxVIMDropFuncs
  1898.  
  1899.  
  1900. ΓòÉΓòÉΓòÉ 9.2. RxVIMEnumerateMessages ΓòÉΓòÉΓòÉ
  1901.  
  1902. The RxVIMEnumerateMessages function retrieves specified information regarding 
  1903. one or many messages in the container.  This function is used to obtain 
  1904. reference pointers to messages in the container.  Once a pointer has been 
  1905. retrieved for a message, that message can be deleted, filed in a folder, or 
  1906. operated on using the message access functions. 
  1907.  
  1908.  
  1909. ΓòÉΓòÉΓòÉ 9.2.1. Syntax ΓòÉΓòÉΓòÉ
  1910.  
  1911. RxVIMEnumerateMessages is called with nine parameters. The first parameter is 
  1912. the pointer to the open message container, which was returned from the open of 
  1913. the container. 
  1914.  
  1915. The second is a variable containing the starting position within the message 
  1916. container.  To start at the beginning, the value of the variable should be set 
  1917. to null ('').  For subsequent calls, this value will contain the return value 
  1918. from the previous call.  This entry MUST be a variable name, since the function 
  1919. returns the value of the next starting position. 
  1920.  
  1921. The third parameter is the number of entries to skip before or after the 
  1922. starting position.  To start at the beginning,and move forward, this should be 
  1923. set to a value of 1.  To start at the end, and move in reverse, this should be 
  1924. set to a value of -1. 
  1925.  
  1926. The fourth parameter is a stem variable name that contains the number of 
  1927. attributes to retrieve at the root, and a Selector and Buffer entry for each 
  1928. attribute.  The Selector entry contains the selector to retrieve, and the 
  1929. Buffer entry contains the name of the variable to return the values. 
  1930.  
  1931. An example of a properly formated attribute description buffer is shown below: 
  1932.  
  1933.       attrDesc.0 = 2
  1934.       attrDesc.1.Selector = 'VIMSEL_REF'
  1935.       attrDesc.1.Buffer   = 'MsgRefNo'
  1936.       attrDesc.2.Selector = 'VIMSEL_SUBJECT'
  1937.       attrDesc.2.Buffer   = 'Subject'
  1938.  
  1939. The fifth parameter is a variable that contains the number of messages to read 
  1940. for the call.  Upon return, the variable contains the number of messages 
  1941. actually read.  This entry MUST be a variable name, since the function returns 
  1942. the number of messages actually read. 
  1943.  
  1944. The sixth parameter is a selector indicating the type of filtering to be done 
  1945. on the messages prior to being included in the return information.  Filtering 
  1946. can allow messages to be filtered based on subject, category, type of message, 
  1947. or other values.  To return all messages in the container without filtering, 
  1948. specify 'VIMSEL_NO_FILTER'. The seventh parameter is the value to be used for 
  1949. filtering, if specified. If no filtering is indicated, this parameter should be 
  1950. null (''). 
  1951.  
  1952. The eighth parameter is used to specify flags to be used as extended filter 
  1953. values.  To return all messages in the container, specify 'VIM_NO_FLAGS' for 
  1954. this parameter. 
  1955.  
  1956. The ninth parameter is the name of a variable to return a boolean value 
  1957. indicating if additional messages exist in the message container.  This value 
  1958. can be used to indicate that another call to RxVIMEnumerateMessages is 
  1959. necessary to process remaining messages in the container. 
  1960.  
  1961. Pos     = ''
  1962. Skipcnt = 1
  1963. Mcount  = 1
  1964. attrDesc.0 = 1
  1965. attrDesc.1.Selector = 'VIMSEL_REF'
  1966. attrDesc.1.Buffer   = 'MsgRefNo'
  1967. filter  = 'VIMSEL_NO_FILTER'
  1968. fdata   = ''
  1969. flags   = 'VIM_NO_FLAGS'
  1970. more    = ''
  1971.  
  1972.  
  1973.  
  1974. call RxVIMEnumerateMessages MsgCont,'Pos',Skipcnt,'attrDesc','MCount',filter,fdata,flags,'more'
  1975.  
  1976. or
  1977.  
  1978. rc = RxVIMEnumerateMessages(MsgCont,'Pos',Skipcnt,'attrDesc','MCount',filter,fdata,flags,'more')
  1979.  
  1980. Listed below are the valid selectors to use to request specific attributes to 
  1981. be returned for each message: 
  1982.  
  1983. VIMSEL_REF                      Retrieves the message reference value
  1984.  
  1985. VIMSEL_TYPE                     Retrieves the message type
  1986.  
  1987. VIMSEL_FROM_NAME                Retrieves the name of the sender
  1988.  
  1989. VIMSEL_SUBJECT                  Retrieves the subject of the message
  1990.  
  1991. VIMSEL_PRIORITY                 Retrieves the priority of the message
  1992.  
  1993. VIMSEL_MSG_LEN                  Retrieves the size of the message in bytes
  1994.  
  1995. VIMSEL_UNREAD_MAIL              Returns 'True' if messge is unread, or
  1996.                                 'False' if it has been read
  1997.  
  1998. VIMSEL_ENCRYPT_WITH_KEY         Returns 'True' if messge was encrypted
  1999.                                 or  'False' if it was not
  2000.  
  2001. Listed below are the valid selectors to use to request filtering for each 
  2002. message (parameter five): 
  2003.  
  2004. VIMSEL_TYPE                     Filter on the message type
  2005.  
  2006.                                    Pass one of following in filter data:
  2007.  
  2008.                                    VIM_MAIL  -  normal mail messages
  2009.                                    VIM_RTRC  -  return receipts requested
  2010.                                    VIM_DLR   -  delivery reports
  2011.                                    VIM_NDLR  -  non-delivery reports
  2012.  
  2013.                                    Notes also supports user-defined types.
  2014.  
  2015.  
  2016.  
  2017. VIMSEL_CATEGORY                 Filter on the message category or folder
  2018.  
  2019.                                    Pass name of category in filter data
  2020.  
  2021.  
  2022.  
  2023. VIMSEL_FROM                     Filter on the name of the sender
  2024.  
  2025.                                    Pass name of sender in filter data
  2026.  
  2027.  
  2028.  
  2029. VIMSEL_SENT                     Retrive messages from message log (ccMail only)
  2030.  
  2031.                                    Pass null ('') in filter data
  2032.  
  2033.  
  2034.  
  2035. VIMSEL_SUBJECT                  Filter on the subject of the message
  2036.  
  2037.                                    Pass subject in filter data
  2038.  
  2039. Listed below are the valid values for the enumeration flags for this function 
  2040. (parameter eight): 
  2041.  
  2042. VIM_NO_FLAGS                    Retrieve all messages
  2043.  
  2044. VIM_UNREADONLY                  Retrieve only unread messages
  2045.  
  2046. The function will return the requested attribute values in the specified buffer 
  2047. as stem values with the following format: 
  2048.  
  2049.          'Subject' specified to receive message subject
  2050.          5 messages are retreived
  2051.  
  2052.          Subject.0 = 5
  2053.          Subject.1 = 'Subject from first  message'
  2054.          Subject.2 = 'Subject from second message'
  2055.          Subject.3 = 'Subject from third  message'
  2056.          Subject.4 = 'Subject from fourth message'
  2057.          Subject.5 = 'Subject from fifth  message'
  2058.  
  2059.  
  2060. ΓòÉΓòÉΓòÉ 9.2.2. Return Codes ΓòÉΓòÉΓòÉ
  2061.  
  2062. The RxVIMEnumerateMessages function returns the following values: 
  2063.  
  2064.         0 - Successful return
  2065.  
  2066. The return values from all of the function calls return a zero for success, and 
  2067. non-zero for failure.  To retrieve the actual failure reason, use the 
  2068. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2069. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2070. be returned by RxVIMEnumerateMessages: 
  2071.  
  2072.         VIMSTS_SUCCESS                  Successful return
  2073.         VIMSTS_FAILURE                  Function Failed
  2074.  
  2075.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  2076.         VIMSTS_BUF_TOO_SMALL            Return buffer is too small
  2077.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  2078.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2079.         VIMSTS_INVALID_SELECTOR         The requested selector is bad
  2080.         VIMSTS_READ_FAILURE             Error reading from disk
  2081.  
  2082.  
  2083. ΓòÉΓòÉΓòÉ 9.2.3. Example ΓòÉΓòÉΓòÉ
  2084.  
  2085. /* Example of using RxVIMEnumerateMessages */
  2086.  
  2087. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2088. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2089. call RxVIMLoadFuncs
  2090.  
  2091.  
  2092. /* This will establish a connection to the VIM system */
  2093. rc = RxVIMInitialize()
  2094.  
  2095. /* Obtain the default session information */
  2096. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2097.  
  2098. Say 'Default path:' db_path
  2099. Say 'Default name:' user_name
  2100.  
  2101. /* Opening a session with the mail subsystem */
  2102. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2103.  
  2104. /* Open the default message container (Inbox) */
  2105. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2106.  
  2107. /* Retrieve the first message from the container pulling the */
  2108. /* message reference number only                             */
  2109. pos = ''                                  /* Start at beginning */
  2110. skipcnt = 1                               /* Start at beginning */
  2111. mcount  = 1                               /* Return one message */
  2112. filter  = 'VIMSEL_NO_FILTER'              /* No filtering       */
  2113. fdata   = ''                              /* No filter data     */
  2114. flags   = 'VIM_NO_FLAGS'                  /* No flags           */
  2115. more = ''                                 /* more messages?     */
  2116.  
  2117. attrDesc.0 = 2                            /* retrieve 2 attributes    */
  2118. attrDesc.1.Selector = 'VIMSEL_REF'        /* reference value          */
  2119. attrDesc.1.Buffer   = 'refno'             /* buffer to return refno   */
  2120. attrDesc.2.Selector = 'VIMSEL_SUBJECT'    /* message subject          */
  2121. attrDesc.2.Buffer   = 'Subject'           /* buffer to return subject */
  2122.  
  2123.  
  2124. rc = RxVIMEnumerateMessages(MsgCont,'pos',skipcnt,'attrDesc','mcount',filter,,
  2125.                             fdata,flags,'more')
  2126.  
  2127. Say 'The first message has the following values'
  2128. Say
  2129. Say 'Message No -' refno.1
  2130. Say 'Subject    -' Subject.1
  2131.  
  2132.  
  2133. /* Close the specified message container */
  2134. rc = RxVIMCloseMessageContainer( MsgCont )
  2135.  
  2136. /* Close the session with the mail subsystem */
  2137. rc = RxVIMCloseSession( Sess )
  2138.  
  2139. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2140. call RxVIMDropFuncs
  2141.  
  2142.  
  2143. ΓòÉΓòÉΓòÉ 9.3. RxVIMSetMessageCategory ΓòÉΓòÉΓòÉ
  2144.  
  2145. The RxVIMSetMessageCategory function creates the association of the message 
  2146. with the specified category.  If the message is the first for a category, the 
  2147. new folder is created. 
  2148.  
  2149.  
  2150. ΓòÉΓòÉΓòÉ 9.3.1. Syntax ΓòÉΓòÉΓòÉ
  2151.  
  2152. RxVIMSetMessageCategory is called with three parameters. The first parameter is 
  2153. the pointer to the open message container, which was returned from the open of 
  2154. the container. The second is the pointer to the message to act upon, which can 
  2155. be retrieve by using the RxVIMEnumerateMessage function..  The third parameter 
  2156. is the name of the category to add the message. 
  2157.  
  2158. call RxVIMSetMessageCategory MsgCont, MsgtoAdd, 'Category Name'
  2159.  
  2160. or
  2161.  
  2162. rc = RxVIMSetMessageCategory(MsgCont, MsgtoAdd, 'Category Name')
  2163.  
  2164.  
  2165. ΓòÉΓòÉΓòÉ 9.3.2. Return Codes ΓòÉΓòÉΓòÉ
  2166.  
  2167. The RxVIMSetMessageCategory function returns the following values: 
  2168.  
  2169.         0 - Successful return
  2170.  
  2171. The return values from all of the function calls return a zero for success, and 
  2172. non-zero for failure.  To retrieve the actual failure reason, use the 
  2173. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2174. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2175. be returned by RxVIMSetMessageCategory: 
  2176.  
  2177.         VIMSTS_SUCCESS                  Successful return
  2178.         VIMSTS_FAILURE                  Function Failed
  2179.  
  2180.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  2181.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2182.         VIMSTS_WRITE_FAILURE            Error writing to disk
  2183.  
  2184.  
  2185. ΓòÉΓòÉΓòÉ 9.3.3. Example ΓòÉΓòÉΓòÉ
  2186.  
  2187. /* Example of using RxVIMSetMessageCategory */
  2188.  
  2189. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2190. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2191. call RxVIMLoadFuncs
  2192.  
  2193.  
  2194. /* This will establish a connection to the VIM system */
  2195. rc = RxVIMInitialize()
  2196.  
  2197. /* Obtain the default session information */
  2198. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2199.  
  2200. Say 'Default path:' db_path
  2201. Say 'Default name:' user_name
  2202.  
  2203. /* Opening a session with the mail subsystem */
  2204. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2205.  
  2206. /* Open the default message container (Inbox) */
  2207. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2208.  
  2209. /* Retrieve the first message from the container pulling the */
  2210. /* message reference number only                             */
  2211. attrDesc.0 = 1
  2212. attrDesc.selector = 'VIMSEL_REF'
  2213. attrDesc.buffer   = 'refno'
  2214.  
  2215. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  2216.                             '','VIM_NO_FLAGS','more')
  2217.  
  2218. /* Assign the first message to the Temporary folder */
  2219. rc = RxVIMSetMessageCategory(MsgCont,refno.1,'Temporary')
  2220.  
  2221. /* Close the specified message container */
  2222. rc = RxVIMCloseMessageContainer( MsgCont )
  2223.  
  2224. /* Close the session with the mail subsystem */
  2225. rc = RxVIMCloseSession( Sess )
  2226.  
  2227. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2228. call RxVIMDropFuncs
  2229.  
  2230.  
  2231. ΓòÉΓòÉΓòÉ 9.4. RxVIMRemoveMessageCategory ΓòÉΓòÉΓòÉ
  2232.  
  2233. The RxVIMRemoveMessageCategory function deletes the association of the message 
  2234. from the specified category.  When the message has been removed from all 
  2235. categories, the message itself will be deleted. If the message is the last in 
  2236. the category, the folder itself will be deleted. 
  2237.  
  2238.  
  2239. ΓòÉΓòÉΓòÉ 9.4.1. Syntax ΓòÉΓòÉΓòÉ
  2240.  
  2241. RxVIMRemoveMessageCategory is called with three parameters. The first parameter 
  2242. is the pointer to the open message container, which was returned from the open 
  2243. of the container. The second is the pointer to the message to act upon, which 
  2244. can be retrieve by using the RxVIMEnumerateMessage function..  The third 
  2245. parameter is the name of the category from which to remove the message. 
  2246.  
  2247. call RxVIMRemoveMessageCategory MsgCont, MsgtoDel, 'Category Name'
  2248.  
  2249. or
  2250.  
  2251. rc = RxVIMRemoveMessageCategory(MsgCont, MsgtoDel, 'Category Name')
  2252.  
  2253.  
  2254. ΓòÉΓòÉΓòÉ 9.4.2. Return Codes ΓòÉΓòÉΓòÉ
  2255.  
  2256. The RxVIMRemoveMessageCategory function returns the following values: 
  2257.  
  2258.         0 - Successful return
  2259.  
  2260. The return values from all of the function calls return a zero for success, and 
  2261. non-zero for failure.  To retrieve the actual failure reason, use the 
  2262. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2263. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2264. be returned by RxVIMRemoveMessageCategory: 
  2265.  
  2266.         VIMSTS_SUCCESS                  Successful return
  2267.         VIMSTS_FAILURE                  Function Failed
  2268.  
  2269.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2270.         VIMSTS_WRITE_FAILURE            Error writing to disk
  2271.  
  2272.  
  2273. ΓòÉΓòÉΓòÉ 9.4.3. Example ΓòÉΓòÉΓòÉ
  2274.  
  2275. /* Example of using RxVIMRemoveMessageCategory */
  2276.  
  2277. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2278. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2279. call RxVIMLoadFuncs
  2280.  
  2281.  
  2282. /* This will establish a connection to the VIM system */
  2283. rc = RxVIMInitialize()
  2284.  
  2285. /* Obtain the default session information */
  2286. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2287.  
  2288. Say 'Default path:' db_path
  2289. Say 'Default name:' user_name
  2290.  
  2291. /* Opening a session with the mail subsystem */
  2292. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2293.  
  2294. /* Open the default message container (Inbox) */
  2295. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2296.  
  2297. /* Retrieve the first message from the container pulling the */
  2298. /* message reference number only                             */
  2299. attrDesc.0 = 1
  2300. attrDesc.selector = 'VIMSEL_REF'
  2301. attrDesc.buffer   = 'refno'
  2302.  
  2303. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_CATEGORY',,
  2304.                             'Temporary','VIM_NO_FLAGS','more')
  2305.  
  2306. /* Delete the first message from the Temporary folder */
  2307. rc = RxVIMRemoveMessageCategory(MsgCont,refno.1,'Temporary')
  2308.  
  2309. /* Close the specified message container */
  2310. rc = RxVIMCloseMessageContainer( MsgCont )
  2311.  
  2312. /* Close the session with the mail subsystem */
  2313. rc = RxVIMCloseSession( Sess )
  2314.  
  2315. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2316. call RxVIMDropFuncs
  2317.  
  2318.  
  2319. ΓòÉΓòÉΓòÉ 9.5. RxVIMRemoveMessage ΓòÉΓòÉΓòÉ
  2320.  
  2321. The RxVIMRemoveMessage function deletes the specified message from the message 
  2322. container. 
  2323.  
  2324.  
  2325. ΓòÉΓòÉΓòÉ 9.5.1. Syntax ΓòÉΓòÉΓòÉ
  2326.  
  2327. RxVIMRemoveMessage is called with two parameters. The first parameter is the 
  2328. pointer to the open message container, which was returned from the open of the 
  2329. container. The second is the pointer to the message to delete, which can be 
  2330. retrieve by using the RxVIMEnumerateMessage function.. 
  2331.  
  2332. call RxVIMRemoveMessage MsgCont, MsgtoDel
  2333.  
  2334. or
  2335.  
  2336. rc = RxVIMRemoveMessage(MsgCont, MsgtoDel)
  2337.  
  2338.  
  2339. ΓòÉΓòÉΓòÉ 9.5.2. Return Codes ΓòÉΓòÉΓòÉ
  2340.  
  2341. The RxVIMRemoveMessage function returns the following values: 
  2342.  
  2343.         0 - Successful return
  2344.  
  2345. The return values from all of the function calls return a zero for success, and 
  2346. non-zero for failure.  To retrieve the actual failure reason, use the 
  2347. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2348. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2349. be returned by RxVIMRemoveMessage: 
  2350.  
  2351.         VIMSTS_SUCCESS                  Successful return
  2352.         VIMSTS_FAILURE                  Function Failed
  2353.  
  2354.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  2355.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  2356.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2357.         VIMSTS_WRITE_FAILURE            Error writing to disk
  2358.  
  2359.  
  2360. ΓòÉΓòÉΓòÉ 9.5.3. Example ΓòÉΓòÉΓòÉ
  2361.  
  2362. /* Example of using RxVIMRemoveMessage */
  2363.  
  2364. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2365. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2366. call RxVIMLoadFuncs
  2367.  
  2368.  
  2369. /* This will establish a connection to the VIM system */
  2370. rc = RxVIMInitialize()
  2371.  
  2372. /* Obtain the default session information */
  2373. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2374.  
  2375. Say 'Default path:' db_path
  2376. Say 'Default name:' user_name
  2377.  
  2378. /* Opening a session with the mail subsystem */
  2379. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2380.  
  2381. /* Open the default message container (Inbox) */
  2382. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2383.  
  2384. /* Retrieve the first message from the container pulling the */
  2385. /* message reference number only                             */
  2386. attrDesc.0 = 1
  2387. attrDesc.selector = 'VIMSEL_REF'
  2388. attrDesc.buffer   = 'refno'
  2389.  
  2390. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  2391.                             '','VIM_NO_FLAGS','more')
  2392.  
  2393. /* Delete the first message */
  2394. rc = RxVIMRemoveMessage(MsgCont,refno.1)
  2395.  
  2396. /* Close the specified message container */
  2397. rc = RxVIMCloseMessageContainer( MsgCont )
  2398.  
  2399. /* Close the session with the mail subsystem */
  2400. rc = RxVIMCloseSession( Sess )
  2401.  
  2402. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2403. call RxVIMDropFuncs
  2404.  
  2405.  
  2406. ΓòÉΓòÉΓòÉ 9.6. RxVIMQueryNewMessages ΓòÉΓòÉΓòÉ
  2407.  
  2408. The RxVIMQueryNewMessages function returns a value of True or False to indicate 
  2409. if new messages are in the container. 
  2410.  
  2411.  
  2412. ΓòÉΓòÉΓòÉ 9.6.1. Syntax ΓòÉΓòÉΓòÉ
  2413.  
  2414. RxVIMQueryNewMessages is called with two parameters. The first parameter is the 
  2415. pointer to the open message container, which was returned from the open of the 
  2416. container. The second is the name of the variable to return the a boolean value 
  2417. to indicate if new messages are in the container. 
  2418.  
  2419. call RxVIMQueryNewMessages MsgCont, 'NewMsgs'
  2420.  
  2421. or
  2422.  
  2423. rc = RxVIMQueryNewMessages(MsgCont, 'NewMsgs')
  2424.  
  2425.  
  2426. ΓòÉΓòÉΓòÉ 9.6.2. Return Codes ΓòÉΓòÉΓòÉ
  2427.  
  2428. The RxVIMQueryNewMessages function returns the following values: 
  2429.  
  2430.         0 - Successful return
  2431.  
  2432. The return values from all of the function calls return a zero for success, and 
  2433. non-zero for failure.  To retrieve the actual failure reason, use the 
  2434. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2435. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2436. be returned by RxVIMQueryNewMessages: 
  2437.  
  2438.         VIMSTS_SUCCESS                  Successful return
  2439.         VIMSTS_FAILURE                  Function Failed
  2440.  
  2441.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  2442.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  2443.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2444.         VIMSTS_READ_FAILURE             Error reading from disk
  2445.  
  2446.  
  2447. ΓòÉΓòÉΓòÉ 9.6.3. Example ΓòÉΓòÉΓòÉ
  2448.  
  2449. /* Example of using RxVIMQueryNewMessages */
  2450.  
  2451. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2452. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2453. call RxVIMLoadFuncs
  2454.  
  2455.  
  2456. /* This will establish a connection to the VIM system */
  2457. rc = RxVIMInitialize()
  2458.  
  2459. /* Obtain the default session information */
  2460. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2461.  
  2462. Say 'Default path:' db_path
  2463. Say 'Default name:' user_name
  2464.  
  2465. /* Opening a session with the mail subsystem */
  2466. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2467.  
  2468. /* Open the default message container (Inbox) */
  2469. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2470.  
  2471.  
  2472.  
  2473. /* Check for new messages in container */
  2474. rc = RxVIMQueryNewMessages( MsgCont, 'NewMsgs' )
  2475.  
  2476. if NewMsgs = 'True'
  2477.    Say 'Your Inbox has new messages'
  2478. else
  2479.    Say 'Your Inbox does not have new messages'
  2480.  
  2481.  
  2482. /* Close the specified message container */
  2483. rc = RxVIMCloseMessageContainer( MsgCont )
  2484.  
  2485. /* Close the session with the mail subsystem */
  2486. rc = RxVIMCloseSession( Sess )
  2487.  
  2488. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2489. call RxVIMDropFuncs
  2490.  
  2491.  
  2492. ΓòÉΓòÉΓòÉ 9.7. RxVIMQueryUnreadMailCount ΓòÉΓòÉΓòÉ
  2493.  
  2494. The RxVIMQueryUnreadMailCount function returns the number of new messages in 
  2495. the message container. 
  2496.  
  2497.  
  2498. ΓòÉΓòÉΓòÉ 9.7.1. Syntax ΓòÉΓòÉΓòÉ
  2499.  
  2500. RxVIMQueryUnreadMailCount is called with two parameters. The first parameter is 
  2501. the pointer to the open message container, which was returned from the open of 
  2502. the container. The second is the name of the variable to return the count 
  2503. value. 
  2504.  
  2505. call RxVIMQueryUnreadMailCount MsgCont, 'msgcount'
  2506.  
  2507. or
  2508.  
  2509. rc = RxVIMQueryUnreadMailCount(MsgCont, 'msgcount')
  2510.  
  2511.  
  2512. ΓòÉΓòÉΓòÉ 9.7.2. Return Codes ΓòÉΓòÉΓòÉ
  2513.  
  2514. The RxVIMQueryUnreadMailCount function returns the following values: 
  2515.  
  2516.         0 - Successful return
  2517.  
  2518. The return values from all of the function calls return a zero for success, and 
  2519. non-zero for failure.  To retrieve the actual failure reason, use the 
  2520. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2521. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2522. be returned by RxVIMQueryUnreadMailCount: 
  2523.  
  2524.         VIMSTS_SUCCESS                  Successful return
  2525.         VIMSTS_FAILURE                  Function Failed
  2526.  
  2527.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  2528.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2529.         VIMSTS_READ_FAILURE             Error reading from disk
  2530.         VIMSTS_NOT_SUPPORTED            This function is not supported
  2531.  
  2532.  
  2533. ΓòÉΓòÉΓòÉ 9.7.3. Example ΓòÉΓòÉΓòÉ
  2534.  
  2535. /* Example of using RxVIMQueryUnreadMailCount */
  2536.  
  2537. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2538. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2539. call RxVIMLoadFuncs
  2540.  
  2541.  
  2542. /* This will establish a connection to the VIM system */
  2543. rc = RxVIMInitialize()
  2544.  
  2545. /* Obtain the default session information */
  2546. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2547.  
  2548. Say 'Default path:' db_path
  2549. Say 'Default name:' user_name
  2550.  
  2551. /* Opening a session with the mail subsystem */
  2552. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2553.  
  2554. /* Open the default message container (Inbox) */
  2555. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2556.  
  2557.  
  2558.  
  2559. /* Retrieve the number of new messages in container */
  2560. rc = RxVIMQueryUnreadMailCount( MsgCont, 'NewMsgs' )
  2561.  
  2562. Say 'Your Inbox has' NewMsgs 'new messages'
  2563.  
  2564.  
  2565.  
  2566. /* Close the specified message container */
  2567. rc = RxVIMCloseMessageContainer( MsgCont )
  2568.  
  2569. /* Close the session with the mail subsystem */
  2570. rc = RxVIMCloseSession( Sess )
  2571.  
  2572. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2573. call RxVIMDropFuncs
  2574.  
  2575.  
  2576. ΓòÉΓòÉΓòÉ 9.8. RxVIMCloseMessageContainer ΓòÉΓòÉΓòÉ
  2577.  
  2578. The RxVIMCloseMessageContainer function closes the specified message container 
  2579. with the VIM system. 
  2580.  
  2581.  
  2582. ΓòÉΓòÉΓòÉ 9.8.1. Syntax ΓòÉΓòÉΓòÉ
  2583.  
  2584. RxVIMCloseMessageContainer is called with one parameter. The parameter is the 
  2585. variable which contains a pointer to the message container to close.  The 
  2586. pointer to the message container is returned from the call to 
  2587. RxVIMOpenMessageContainer. 
  2588.  
  2589. call RxVIMCloseMessageContainer MsgCont
  2590.  
  2591. or
  2592.  
  2593. rc = RxVIMCloseMessageContainer( MsgCont )
  2594.  
  2595.  
  2596. ΓòÉΓòÉΓòÉ 9.8.2. Return Codes ΓòÉΓòÉΓòÉ
  2597.  
  2598. The RxVIMCloseMessageContainer function returns the following values: 
  2599.  
  2600.         0 - Successful function return
  2601.  
  2602. The return values from all of the function calls return a zero for success, and 
  2603. non-zero for failure.  To retrieve the actual failure reason, use the 
  2604. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2605. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2606. be returned by RxVIMCloseMessageContainer: 
  2607.  
  2608.         VIMSTS_SUCCESS                  Successful return
  2609.         VIMSTS_FAILURE                  Function Failed
  2610.  
  2611.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2612.  
  2613.  
  2614. ΓòÉΓòÉΓòÉ 9.8.3. Example ΓòÉΓòÉΓòÉ
  2615.  
  2616. /* Example of using RxVIMCloseMessageContainer */
  2617.  
  2618. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2619. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2620. call RxVIMLoadFuncs
  2621.  
  2622. /* This will establish a connection to the VIM system */
  2623. rc = RxVIMInitialize()
  2624.  
  2625. /* Obtain the default session information */
  2626. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2627.  
  2628. Say 'Default path:' db_path
  2629. Say 'Default name:' user_name
  2630.  
  2631. /* Opening a session with the mail subsystem */
  2632. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2633.  
  2634. /* Open the default message container (Inbox) */
  2635. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2636.  
  2637. /* Close the specified message container */
  2638. rc = RxVIMCloseMessageContainer( MsgCont )
  2639.  
  2640. /* Close the session with the mail subsystem */
  2641. rc = RxVIMCloseSession( Sess )
  2642.  
  2643. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2644. call RxVIMDropFuncs
  2645.  
  2646.  
  2647. ΓòÉΓòÉΓòÉ 10. Message Access and Attribute Functions ΓòÉΓòÉΓòÉ
  2648.  
  2649. This section describes each of the functions available in the RexxVIM product 
  2650. that address message access and attribute features. 
  2651.  
  2652.  
  2653. ΓòÉΓòÉΓòÉ 10.1. RxVIMOpenMessage ΓòÉΓòÉΓòÉ
  2654.  
  2655. The RxVIMOpenMessage function opens the specified message with the VIM system. 
  2656. After the message has been opened, the other message functions can be used for 
  2657. further message processing. 
  2658.  
  2659.  
  2660. ΓòÉΓòÉΓòÉ 10.1.1. Syntax ΓòÉΓòÉΓòÉ
  2661.  
  2662. RxVIMOpenMessage is called with four parameter. The first parameter is the 
  2663. variable which contains a pointer to the open message container.  The second 
  2664. parameter is the reference number of the message to open, which can be 
  2665. retrieved from the RxVIMEnumerateMessages function. The third parameter is the 
  2666. explicit key to use if the message is encrypted or NULL ('') if it is not 
  2667. encrypted.  The fourth parameter is the name of the variable to return the 
  2668. pointer to the message. 
  2669.  
  2670. call RxVIMOpenMessage MsgCont, MsgRef, '', 'MsgPtr'
  2671.  
  2672. or
  2673.  
  2674. rc = RxVIMOpenMessage( MsgCont, MsgRef, '', 'MsgPtr' )
  2675.  
  2676.  
  2677. ΓòÉΓòÉΓòÉ 10.1.2. Return Codes ΓòÉΓòÉΓòÉ
  2678.  
  2679. The RxVIMOpenMessage function returns the following values: 
  2680.  
  2681.         0 - Successful function return
  2682.  
  2683. The return values from all of the function calls return a zero for success, and 
  2684. non-zero for failure.  To retrieve the actual failure reason, use the 
  2685. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2686. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2687. be returned by RxVIMOpenMessage: 
  2688.  
  2689.         VIMSTS_SUCCESS                  Successful return
  2690.         VIMSTS_FAILURE                  Function Failed
  2691.  
  2692.         VIMSTS_BAD_PARAM                The message reference is bad
  2693.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  2694.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2695.         VIMSTS_READ_FAILURE             Error reading from the disk
  2696.  
  2697.  
  2698. ΓòÉΓòÉΓòÉ 10.1.3. Example ΓòÉΓòÉΓòÉ
  2699.  
  2700. /* Example of using RxVIMOpenMessage */
  2701.  
  2702. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2703. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2704. call RxVIMLoadFuncs
  2705.  
  2706. /* This will establish a connection to the VIM system */
  2707. rc = RxVIMInitialize()
  2708.  
  2709. /* Obtain the default session information */
  2710. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2711.  
  2712. Say 'Default path:' db_path
  2713. Say 'Default name:' user_name
  2714.  
  2715. /* Opening a session with the mail subsystem */
  2716. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2717.  
  2718. /* Open the default message container (Inbox) */
  2719. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2720.  
  2721. /* Retrieve the first message from the container pulling the */
  2722. /* message reference number only                             */
  2723. attrDesc.0 = 1
  2724. attrDesc.selector = 'VIMSEL_REF'
  2725. attrDesc.buffer   = 'refno'
  2726.  
  2727. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  2728.                             '','VIM_NO_FLAGS','more')
  2729.  
  2730.  
  2731. /* Open the first message */
  2732. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  2733.  
  2734.  
  2735. /* Close the specified message container */
  2736. rc = RxVIMCloseMessageContainer( MsgCont )
  2737.  
  2738. /* Close the session with the mail subsystem */
  2739. rc = RxVIMCloseSession( Sess )
  2740.  
  2741. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2742. call RxVIMDropFuncs
  2743.  
  2744.  
  2745. ΓòÉΓòÉΓòÉ 10.2. RxVIMMarkMessageAsRead ΓòÉΓòÉΓòÉ
  2746.  
  2747. The RxVIMMarkMessageAsRead function changes the status on the specified message 
  2748. to read. 
  2749.  
  2750.  
  2751. ΓòÉΓòÉΓòÉ 10.2.1. Syntax ΓòÉΓòÉΓòÉ
  2752.  
  2753. RxVIMMarkMessageAsRead is called with two parameter. The first parameter is the 
  2754. variable which contains a pointer to the open message container.  The second 
  2755. parameter is the variable which contains a pointer to the open message. 
  2756.  
  2757. call RxVIMMarkMessageAsRead MsgCont, MsgPtr
  2758.  
  2759. or
  2760.  
  2761. rc = RxVIMMarkMessageAsRead( MsgCont, MsgPtr )
  2762.  
  2763.  
  2764. ΓòÉΓòÉΓòÉ 10.2.2. Return Codes ΓòÉΓòÉΓòÉ
  2765.  
  2766. The RxVIMMarkMessageAsRead function returns the following values: 
  2767.  
  2768.         0 - Successful function return
  2769.  
  2770. The return values from all of the function calls return a zero for success, and 
  2771. non-zero for failure.  To retrieve the actual failure reason, use the 
  2772. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2773. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2774. be returned by RxVIMMarkMessageAsRead: 
  2775.  
  2776.         VIMSTS_SUCCESS                  Successful return
  2777.         VIMSTS_FAILURE                  Function Failed
  2778.  
  2779.         VIMSTS_BAD_PARAM                The message reference is bad
  2780.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2781.         VIMSTS_WRITE_FAILURE            Error writing to the disk
  2782.  
  2783.  
  2784. ΓòÉΓòÉΓòÉ 10.2.3. Example ΓòÉΓòÉΓòÉ
  2785.  
  2786. /* Example of using RxVIMMarkMessageAsRead */
  2787.  
  2788. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2789. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2790. call RxVIMLoadFuncs
  2791.  
  2792. /* This will establish a connection to the VIM system */
  2793. rc = RxVIMInitialize()
  2794.  
  2795. /* Obtain the default session information */
  2796. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2797.  
  2798. Say 'Default path:' db_path
  2799. Say 'Default name:' user_name
  2800.  
  2801. /* Opening a session with the mail subsystem */
  2802. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2803.  
  2804. /* Open the default message container (Inbox) */
  2805. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2806.  
  2807. /* Retrieve the first message from the container pulling the */
  2808. /* message reference number only                             */
  2809. attrDesc.0 = 1
  2810. attrDesc.selector = 'VIMSEL_REF'
  2811. attrDesc.buffer   = 'refno'
  2812.  
  2813. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  2814.                             '','VIM_NO_FLAGS','more')
  2815.  
  2816. /* Open the first message */
  2817. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  2818.  
  2819.  
  2820. /* Mark the first message as read */
  2821. rc = RxVIMMarkMessageAsRead(MsgCont,MsgPtr)
  2822.  
  2823.  
  2824. /* Close the specified message container */
  2825. rc = RxVIMCloseMessageContainer( MsgCont )
  2826.  
  2827. /* Close the session with the mail subsystem */
  2828. rc = RxVIMCloseSession( Sess )
  2829.  
  2830. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2831. call RxVIMDropFuncs
  2832.  
  2833.  
  2834. ΓòÉΓòÉΓòÉ 10.3. RxVIMGetMessageHeader ΓòÉΓòÉΓòÉ
  2835.  
  2836. The RxVIMGetMessageHeader function retrieves one or more attributes from the 
  2837. header of the specified message. 
  2838.  
  2839.  
  2840. ΓòÉΓòÉΓòÉ 10.3.1. Syntax ΓòÉΓòÉΓòÉ
  2841.  
  2842. RxVIMGetMessageHeader is called with two parameter. The first parameter is the 
  2843. name of the variable that contains a pointer to the message.  The second is the 
  2844. variable name of the stem variable of attributes to retrieve. 
  2845.  
  2846. attrDesc.0 = 1
  2847. attrDesc.1.Selector = 'VIMSEL_TYPE'
  2848. attrDesc.1.Buffer   = 'MsgType'
  2849.  
  2850. call RxVIMGetMessageHeader MsgPtr, 'attrDesc'
  2851.  
  2852. or
  2853.  
  2854. rc = RxVIMGetMessageHeader( MsgPtr, 'attrDesc' )
  2855.  
  2856. Listed below are the valid selectors to use to request specific attributes to 
  2857. be returned for each message: 
  2858.  
  2859. VIMSEL_TYPE                     Retrieves the message type
  2860.  
  2861. VIMSEL_FROM_NAME                Retrieves the name of the sender
  2862.  
  2863. VIMSEL_SUBJECT                  Retrieves the subject of the message
  2864.  
  2865. VIMSEL_SUBJECT_LEN              Retrieves the length of the subject of the message
  2866.  
  2867. VIMSEL_PRIORITY                 Retrieves the priority of the message
  2868.  
  2869. VIMSEL_MSG_LEN                  Retrieves the size of the message in bytes
  2870.  
  2871. VIMSEL_RETURN_RECEIPT           Returns 'True' if messge was requested upon opening
  2872.                                 or  'False' if it was not
  2873.  
  2874.  
  2875. ΓòÉΓòÉΓòÉ 10.3.2. Return Codes ΓòÉΓòÉΓòÉ
  2876.  
  2877. The RxVIMGetMessageHeader function returns the following values: 
  2878.  
  2879.         0 - Successful function return
  2880.  
  2881. The return values from all of the function calls return a zero for success, and 
  2882. non-zero for failure.  To retrieve the actual failure reason, use the 
  2883. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  2884. value to the actual failure text.  Using RxVIMStatus, the following values may 
  2885. be returned by RxVIMGetMessageHeader: 
  2886.  
  2887.         VIMSTS_SUCCESS                  Successful return
  2888.         VIMSTS_FAILURE                  Function Failed
  2889.  
  2890.         VIMSTS_BAD_PARAM                The message reference is bad
  2891.         VIMSTS_BUF_TOO_SMALL            The return buffer is too small
  2892.         VIMSTS_INVALID_OBJECT           The container handle is bad
  2893.         VIMSTS_INVALID_SELECTOR         Unknown selector value
  2894.         VIMSTS_NOT_SUPPORTED            Selector is not supported
  2895.  
  2896.  
  2897. ΓòÉΓòÉΓòÉ 10.3.3. Example ΓòÉΓòÉΓòÉ
  2898.  
  2899. /* Example of using RxVIMGetMessageHeader */
  2900.  
  2901. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  2902. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  2903. call RxVIMLoadFuncs
  2904.  
  2905. /* This will establish a connection to the VIM system */
  2906. rc = RxVIMInitialize()
  2907.  
  2908. /* Obtain the default session information */
  2909. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  2910.  
  2911. Say 'Default path:' db_path
  2912. Say 'Default name:' user_name
  2913.  
  2914. /* Opening a session with the mail subsystem */
  2915. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  2916.  
  2917. /* Open the default message container (Inbox) */
  2918. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  2919.  
  2920. /* Retrieve the first message from the container pulling the */
  2921. /* message reference number only                             */
  2922. attrDesc.0 = 1
  2923. attrDesc.selector = 'VIMSEL_REF'
  2924. attrDesc.buffer   = 'refno'
  2925.  
  2926. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  2927.                             '','VIM_NO_FLAGS','more')
  2928.  
  2929. /* Open the first message */
  2930. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  2931.  
  2932.  
  2933. /* Retrieve two attributes of the message header */
  2934. attrHead.0 = 2
  2935. attrHead.1.Selector = 'VIMSEL_FROM_NAME'
  2936. attrHead.1.Buffer   = 'from'
  2937. attrHead.2.Selector = 'VIMSEL_MSG_LEN'
  2938. attrHead.2.Buffer   = 'MsgLength'
  2939.  
  2940. rc = RxVIMGetMessageHeader(MsgPtr,'attrHead')
  2941.  
  2942. Say 'The message from' from ' is' MsgLength 'bytes in size'
  2943.  
  2944.  
  2945.  
  2946. /* Close the specified message container */
  2947. rc = RxVIMCloseMessageContainer( MsgCont )
  2948.  
  2949. /* Close the session with the mail subsystem */
  2950. rc = RxVIMCloseSession( Sess )
  2951.  
  2952. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  2953. call RxVIMDropFuncs
  2954.  
  2955.  
  2956. ΓòÉΓòÉΓòÉ 10.4. RxVIMEnumerateMessageItem ΓòÉΓòÉΓòÉ
  2957.  
  2958. The RxVIMEnumerateMessageItems function retrieves specified information 
  2959. regarding one or many items in a specific message.  This function is used to 
  2960. obtain reference pointers to message items in the message.  Once a pointer has 
  2961. been retrieved for a message item, that item can be accessed individually. 
  2962.  
  2963.  
  2964. ΓòÉΓòÉΓòÉ 10.4.1. Syntax ΓòÉΓòÉΓòÉ
  2965.  
  2966. RxVIMEnumerateMessageItems is called with eight parameters. The first parameter 
  2967. is the pointer to the open message, which was returned from RxVIMOpenMessage. 
  2968.  
  2969. The second is a variable containing the starting position within the message . 
  2970. To start at the beginning, the value of the variable should be set to null 
  2971. ('').  For subsequent calls, this value will contain the return value from the 
  2972. previous call.  This entry MUST be a variable name, since the function returns 
  2973. the value of the next starting position. 
  2974.  
  2975. The third parameter is the number of entries to skip before or after the 
  2976. starting position.  To start at the beginning,and move forward, this should be 
  2977. set to a value of 1.  To start at the end, and move in reverse, this should be 
  2978. set to a value of -1. 
  2979.  
  2980. The fourth parameter is a variable that contains the number of message items to 
  2981. read for the call.  Upon return, the variable contains the number of messages 
  2982. actually read.  This entry MUST be a variable name, since the function returns 
  2983. the number of messages actually read. 
  2984.  
  2985. The fifth parameter is a stem variable name that will contain the results of 
  2986. the call.  Upon return, the stem variable will contain the class, type, title, 
  2987. path, size, and reference number for each item retrieved. An example of a 
  2988. return stem variable 'ItemDesc' for the first message item is: 
  2989.  
  2990.      ItemDesc.1.CLASS         /* Contains the class of the item */
  2991.      ItemDesc.1.TYPE          /* Contains the type of the item  */
  2992.      ItemDesc.1.NAME          /* Contains the name of the item  */
  2993.      ItemDesc.1.SIZE          /* Contains size of item in bytes */
  2994.      ItemDesc.1.REF           /* Reference number of the item   */
  2995.  
  2996. The sixth parameter is a selector indicating the type of filtering to be done 
  2997. on the messages prior to being included in the return information.  Filtering 
  2998. can allow messages to be filtered based on subject, category, type of message, 
  2999. or other values.  To return all messages in the container without filtering, 
  3000. specify 'VIMSEL_NO_FILTER'. The seventh parameter is the value to be used for 
  3001. filtering, if specified. If no filtering is indicated, this parameter should be 
  3002. null (''). 
  3003.  
  3004. The eighth parameter is the name of a variable to return a boolean value 
  3005. indicating if additional messages exist in the message container.  This value 
  3006. can be used to indicate that another call to RxVIMEnumerateMessageItems is 
  3007. necessary to process remaining messages in the container. 
  3008.  
  3009. Pos     = ''
  3010. Skipcnt = 1
  3011. Mcount  = 1
  3012. attrDesc = ''
  3013. filter  = 'VIMSEL_NO_FILTER'
  3014. fdata   = ''
  3015. more    = ''
  3016.  
  3017.  
  3018. call RxVIMEnumerateMessageItems MsgCont,'Pos',Skipcnt,'MCount','attrDesc',filter,fdata,'more'
  3019.  
  3020. or
  3021.  
  3022. rc = RxVIMEnumerateMessageItems(MsgCont,'Pos',Skipcnt,'MCount','attrDesc',filter,fdata,'more')
  3023.  
  3024. Listed below are the valid selectors to use to request filtering for each 
  3025. message (parameter five): 
  3026.  
  3027. VIMSEL_CLASS                    Filter on the message item class
  3028.  
  3029.                                    Pass one of following in filter data:
  3030.  
  3031.                                    VIMSEL_NOTE_PART  - text portion of message
  3032.                                    VIMSEL_ATTACH     - message attachments
  3033.                                    VIMSEL_NESTED_MSG - nested message items
  3034.  
  3035.  
  3036. ΓòÉΓòÉΓòÉ 10.4.2. Return Codes ΓòÉΓòÉΓòÉ
  3037.  
  3038. The RxVIMEnumerateMessageItems function returns the following values: 
  3039.  
  3040.         0 - Successful return
  3041.  
  3042. The return values from all of the function calls return a zero for success, and 
  3043. non-zero for failure.  To retrieve the actual failure reason, use the 
  3044. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  3045. value to the actual failure text.  Using RxVIMStatus, the following values may 
  3046. be returned by RxVIMEnumerateMessageItems: 
  3047.  
  3048.         VIMSTS_SUCCESS                  Successful return
  3049.         VIMSTS_FAILURE                  Function Failed
  3050.  
  3051.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  3052.         VIMSTS_BUF_TOO_SMALL            Return buffer is too small
  3053.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  3054.         VIMSTS_INVALID_OBJECT           The message handle is bad
  3055.         VIMSTS_NOT_SUPPORTED            The filter selector is not supported
  3056.  
  3057.  
  3058. ΓòÉΓòÉΓòÉ 10.4.3. Example ΓòÉΓòÉΓòÉ
  3059.  
  3060. /* Example of using RxVIMEnumerateMessageItems */
  3061.  
  3062. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  3063. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  3064. call RxVIMLoadFuncs
  3065.  
  3066.  
  3067. /* This will establish a connection to the VIM system */
  3068. rc = RxVIMInitialize()
  3069.  
  3070. /* Obtain the default session information */
  3071. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  3072.  
  3073. Say 'Default path:' db_path
  3074. Say 'Default name:' user_name
  3075.  
  3076. /* Opening a session with the mail subsystem */
  3077. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  3078.  
  3079. /* Open the default message container (Inbox) */
  3080. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  3081.  
  3082. /* Retrieve the first message from the container pulling the */
  3083. /* message reference number only                             */
  3084. pos = ''                                  /* Start at beginning */
  3085. skipcnt = 1                               /* Start at beginning */
  3086. mcount  = 1                               /* Return one message */
  3087. filter  = 'VIMSEL_NO_FILTER'              /* No filtering       */
  3088. fdata   = ''                              /* No filter data     */
  3089. flags   = 'VIM_NO_FLAGS'                  /* No flags           */
  3090. more = ''                                 /* more messages?     */
  3091.  
  3092. attrDesc.0 = 2                            /* retrieve 2 attributes    */
  3093. attrDesc.1.Selector = 'VIMSEL_REF'        /* reference value          */
  3094. attrDesc.1.Buffer   = 'refno'             /* buffer to return refno   */
  3095. attrDesc.2.Selector = 'VIMSEL_SUBJECT'    /* message subject          */
  3096. attrDesc.2.Buffer   = 'Subject'           /* buffer to return subject */
  3097.  
  3098.  
  3099. rc = RxVIMEnumerateMessages(MsgCont,'pos',skipcnt,'attrDesc','mcount',filter,,
  3100.                             fdata,flags,'more')
  3101.  
  3102. /* Open the first message */
  3103. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  3104.  
  3105.  
  3106. /* Retrieve the first text message item from the first message */
  3107. ipos     = ''
  3108. iskip    = 1
  3109. icount   = 1
  3110. ifilter  = 'VIMSEL_CLASS'
  3111. ifdata   = 'VIMSEL_NOTE_PART'
  3112. imore    = ''
  3113. attrItem = ''
  3114.  
  3115. rc = RxVIMEnumerateMessageItems(MsgPtr,'ipos',iskip,'icount','attrItem',ifilter,,
  3116.                             ifdata,'imore')
  3117.  
  3118. Say 'The first text message item of the first message'
  3119. Say 'has the following details'
  3120. Say
  3121. Say '    Item Class  -' attrItem.1.CLASS
  3122. Say '    Item Type   -' attrItem.1.TYPE
  3123. Say '    Item Name   -' attrItem.1.NAME
  3124. Say '    Item Size   -' attrItem.1.SIZE
  3125. Say '    Item Ref No -' attrItem.1.REF
  3126.  
  3127.  
  3128.  
  3129. /* Close the specified message container */
  3130. rc = RxVIMCloseMessageContainer( MsgCont )
  3131.  
  3132. /* Close the session with the mail subsystem */
  3133. rc = RxVIMCloseSession( Sess )
  3134.  
  3135. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  3136. call RxVIMDropFuncs
  3137.  
  3138.  
  3139. ΓòÉΓòÉΓòÉ 10.5. RxVIMGetMessageItem ΓòÉΓòÉΓòÉ
  3140.  
  3141. The RxVIMGetMessageItem function reads a message item into a buffer or file. 
  3142.  
  3143.  
  3144. ΓòÉΓòÉΓòÉ 10.5.1. Syntax ΓòÉΓòÉΓòÉ
  3145.  
  3146. RxVIMGetMessageItem is called with five parameters. The first parameter is the 
  3147. variable which contains a pointer to the open message.  The second parameter is 
  3148. the reference number of the item to retrieve.  The third parameter is the 
  3149. desired type for the message item.  The fourth parameter is a flag to control 
  3150. output file formats. 
  3151.  
  3152. The fifth parameter is a stem variable that contains the buffer name or the 
  3153. filespec for the message to be stored.  The stem variable has three components, 
  3154. the name of the buffer, the size of the buffer, and the name of the file.  If a 
  3155. filename is specified, the buffer variable is ignored.  The size of the buffer 
  3156. will control the amount of information returned from the item, up to a maximum 
  3157. size of 4096.  Size will be updated on return to indicate the actual amount 
  3158. read from the message item. 
  3159.  
  3160. BufDesc.Buffer    = 'ItemText'         /* Return buffer name    */
  3161. BufDesc.Size      = 256                /* Size of return buffer */
  3162. BufDesc.FileName  = ''                 /* NULL for filename     */
  3163.  
  3164.  
  3165. call RxVIMGetMessageItem MsgPtr, MsgItemRef, 'Text Type', 'VIMSEL_NATIVE', 'BufDesc'
  3166.  
  3167. or
  3168.  
  3169. rc = RxVIMGetMessageItem( MsgPtr, MsgItemRef, 'Text Type', 'VIMSEL_NATIVE', 'BufDesc' )
  3170.  
  3171. Listed below are the valid types to use to request message conversion 
  3172. (parameter three): 
  3173.  
  3174. VIM_TEXT                    Convert the message to ASCII text (from VIM_RTF)
  3175.  
  3176. VIM_RTF                     Convert the message to Rich Text Format (from VIM_TEXT)
  3177.  
  3178. Listed below are the valid selectores to use to request specific file output 
  3179. types (parameter four): 
  3180.  
  3181. VIMSEL_NATIVE               The output file will be written in the Operating
  3182.                             System's format.  (Extended attributes will be
  3183.                             maintained.
  3184.  
  3185. VIMSEL_APPLESINGLE          The output file will be written in stream format.
  3186.  
  3187.  
  3188. ΓòÉΓòÉΓòÉ 10.5.2. Return Codes ΓòÉΓòÉΓòÉ
  3189.  
  3190. The RxVIMGetMessageItem function returns the following values: 
  3191.  
  3192.         0 - Successful function return
  3193.  
  3194. The return values from all of the function calls return a zero for success, and 
  3195. non-zero for failure.  To retrieve the actual failure reason, use the 
  3196. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  3197. value to the actual failure text.  Using RxVIMStatus, the following values may 
  3198. be returned by RxVIMGetMessageItem: 
  3199.  
  3200.         VIMSTS_SUCCESS                  Successful return
  3201.         VIMSTS_FAILURE                  Function Failed
  3202.  
  3203.         VIMSTS_BAD_PARAM                The message pointer is bad
  3204.         VIMSTS_CONV_NOT_SUPPORTED       Specified conversion not valid
  3205.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  3206.         VIMSTS_INVALID_OBJECT           The message handle is bad
  3207.         VIMSTS_INVALID_SELECTOR         The flags value is not correct
  3208.         VIMSTS_READ_FAILURE             Error reading from the disk
  3209.         VIMSTS_UNSUP_TYPE               The flags type is not correct
  3210.         VIMSTS_WRITE_FAILURE            Error writing to the disk
  3211.  
  3212.  
  3213. ΓòÉΓòÉΓòÉ 10.5.3. Example ΓòÉΓòÉΓòÉ
  3214.  
  3215. /* Example of using RxVIMGetMessageItem */
  3216.  
  3217. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  3218. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  3219. call RxVIMLoadFuncs
  3220.  
  3221. /* This will establish a connection to the VIM system */
  3222. rc = RxVIMInitialize()
  3223.  
  3224. /* Obtain the default session information */
  3225. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  3226.  
  3227. Say 'Default path:' db_path
  3228. Say 'Default name:' user_name
  3229.  
  3230. /* Opening a session with the mail subsystem */
  3231. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  3232.  
  3233. /* Open the default message container (Inbox) */
  3234. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  3235.  
  3236. /* Retrieve the first message from the container pulling the */
  3237. /* message reference number only                             */
  3238. attrDesc.0 = 1
  3239. attrDesc.selector = 'VIMSEL_REF'
  3240. attrDesc.buffer   = 'refno'
  3241.  
  3242. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  3243.                             '','VIM_NO_FLAGS','more')
  3244.  
  3245. /* Open the first message */
  3246. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  3247.  
  3248. /* Retrieve the first text message item from the first message */
  3249. ipos     = ''
  3250. iskip    = 1
  3251. icount   = 1
  3252. ifilter  = 'VIMSEL_CLASS'
  3253. ifdata   = 'VIMSEL_NOTE_PART'
  3254. imore    = ''
  3255. attrItem = ''
  3256.  
  3257. rc = RxVIMEnumerateMessageItems(MsgPtr,'ipos',iskip,'icount','attrItem',ifilter,,
  3258.                             ifdata,'imore')
  3259.  
  3260.  
  3261. /* Store the message item in a Rexx variable */
  3262. BufDesc.Buffer    = 'ItemText'         /* Return buffer name    */
  3263. BufDesc.Size      = 2048               /* Size of return buffer */
  3264. BufDesc.FileName  = ''                 /* NULL for filename     */
  3265.  
  3266. rc = RxVIMGetMessageItem( MsgPtr, attrItem.1.REF, '', '', 'BufDesc')
  3267.  
  3268. /* Display first 60 characters of the message item */
  3269. Say 'First 60 characters of the message item'
  3270. Say SUBSTR(ItemText,1,60)
  3271.  
  3272.  
  3273. /* Close the specified message container */
  3274. rc = RxVIMCloseMessageContainer( MsgCont )
  3275.  
  3276. /* Close the session with the mail subsystem */
  3277. rc = RxVIMCloseSession( Sess )
  3278.  
  3279. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  3280. call RxVIMDropFuncs
  3281.  
  3282.  
  3283. ΓòÉΓòÉΓòÉ 10.6. RxVIMOpenMessageItem ΓòÉΓòÉΓòÉ
  3284.  
  3285. The RxVIMOpenMessageItem function opens a message item in preparation for other 
  3286. actions. 
  3287.  
  3288.  
  3289. ΓòÉΓòÉΓòÉ 10.6.1. Syntax ΓòÉΓòÉΓòÉ
  3290.  
  3291. RxVIMOpenMessageItem is called with five parameters. The first parameter is the 
  3292. variable which contains a pointer to the open message.  The second parameter is 
  3293. the reference number of the item to retrieve.  The third parameter is the 
  3294. desired type for the message item.  The fourth parameter is a flag to control 
  3295. output file formats. The fifth parameter is a variable which will contain a 
  3296. pointer to the message item. 
  3297.  
  3298. call RxVIMGetMessageItem MsgPtr, MsgItemRef, 'Text Type', 'VIMSEL_NATIVE', 'MsgItemPtr'
  3299.  
  3300. or
  3301.  
  3302. rc = RxVIMGetMessageItem( MsgPtr, MsgItemRef, 'Text Type', 'VIMSEL_NATIVE', 'MsgItemPtr' )
  3303.  
  3304. Listed below are the valid types to use to request message conversion 
  3305. (parameter three): 
  3306.  
  3307. VIM_TEXT                    Convert the message to ASCII text (from VIM_RTF)
  3308.  
  3309. VIM_RTF                     Convert the message to Rich Text Format (from VIM_TEXT)
  3310.  
  3311. Listed below are the valid selectores to use to request specific file output 
  3312. types (parameter four): 
  3313.  
  3314. VIMSEL_NATIVE               The output file will be written in the Operating
  3315.                             System's format.  (Extended attributes will be
  3316.                             maintained.
  3317.  
  3318. VIMSEL_APPLESINGLE          The output file will be written in stream format.
  3319.  
  3320.  
  3321. ΓòÉΓòÉΓòÉ 10.6.2. Return Codes ΓòÉΓòÉΓòÉ
  3322.  
  3323. The RxVIMGetMessageItem function returns the following values: 
  3324.  
  3325.         0 - Successful function return
  3326.  
  3327. The return values from all of the function calls return a zero for success, and 
  3328. non-zero for failure.  To retrieve the actual failure reason, use the 
  3329. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  3330. value to the actual failure text.  Using RxVIMStatus, the following values may 
  3331. be returned by RxVIMGetMessageItem: 
  3332.  
  3333.         VIMSTS_SUCCESS                  Successful return
  3334.         VIMSTS_FAILURE                  Function Failed
  3335.  
  3336.         VIMSTS_BAD_PARAM                The message pointer is bad
  3337.         VIMSTS_CONV_NOT_SUPPORTED       Specified conversion not valid
  3338.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  3339.         VIMSTS_INVALID_OBJECT           The message handle is bad
  3340.         VIMSTS_INVALID_SELECTOR         The flags value is not correct
  3341.         VIMSTS_READ_FAILURE             Error reading from the disk
  3342.         VIMSTS_UNSUP_TYPE               The flags type is not correct
  3343.         VIMSTS_WRITE_FAILURE            Error writing to the disk
  3344.  
  3345.  
  3346. ΓòÉΓòÉΓòÉ 10.6.3. Example ΓòÉΓòÉΓòÉ
  3347.  
  3348. /* Example of using RxVIMOpenMessageItem */
  3349.  
  3350. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  3351. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  3352. call RxVIMLoadFuncs
  3353.  
  3354. /* This will establish a connection to the VIM system */
  3355. rc = RxVIMInitialize()
  3356.  
  3357. /* Obtain the default session information */
  3358. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  3359.  
  3360. Say 'Default path:' db_path
  3361. Say 'Default name:' user_name
  3362.  
  3363. /* Opening a session with the mail subsystem */
  3364. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  3365.  
  3366. /* Open the default message container (Inbox) */
  3367. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  3368.  
  3369. /* Retrieve the first message from the container pulling the */
  3370. /* message reference number only                             */
  3371. attrDesc.0 = 1
  3372. attrDesc.selector = 'VIMSEL_REF'
  3373. attrDesc.buffer   = 'refno'
  3374.  
  3375. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  3376.                             '','VIM_NO_FLAGS','more')
  3377.  
  3378. /* Open the first message */
  3379. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  3380.  
  3381. /* Retrieve the first text message item from the first message */
  3382. ipos     = ''
  3383. iskip    = 1
  3384. icount   = 1
  3385. ifilter  = 'VIMSEL_CLASS'
  3386. ifdata   = 'VIMSEL_NOTE_PART'
  3387. imore    = ''
  3388. attrItem = ''
  3389.  
  3390. rc = RxVIMEnumerateMessageItems(MsgPtr,'ipos',iskip,'icount','attrItem',ifilter,,
  3391.                             ifdata,'imore')
  3392.  
  3393.  
  3394. /* Open the message item */
  3395. rc = RxVIMOpenMessageItem( MsgPtr, attrItem.1.REF, '', '', 'MsgItemPtr')
  3396.  
  3397.  
  3398.  
  3399. /* Close the specified message container */
  3400. rc = RxVIMCloseMessageContainer( MsgCont )
  3401.  
  3402. /* Close the session with the mail subsystem */
  3403. rc = RxVIMCloseSession( Sess )
  3404.  
  3405. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  3406. call RxVIMDropFuncs
  3407.  
  3408.  
  3409. ΓòÉΓòÉΓòÉ 10.7. RxVIMReadMessageItem ΓòÉΓòÉΓòÉ
  3410.  
  3411. The RxVIMReadMessageItem function reads a message item into a buffer in 
  3412. sections. 
  3413.  
  3414.  
  3415. ΓòÉΓòÉΓòÉ 10.7.1. Syntax ΓòÉΓòÉΓòÉ
  3416.  
  3417. RxVIMReadMessageItem is called with two parameters. The first parameter is the 
  3418. variable which contains a pointer to the open message item. 
  3419.  
  3420. The second parameter is a stem variable that contains the buffer name for the 
  3421. message to be stored.  The stem variable has three components, the name of the 
  3422. buffer, the size of the buffer, and the offset. The size of the buffer will 
  3423. control the amount of information returned from the item, up to a maximum size 
  3424. of 4096.  Size will be updated on return to indicate the actual amount read 
  3425. from the message item.  The offset is updated on return to indicate the 
  3426. location within the message item.  When offset equals the size of the item, the 
  3427. entire item has been read. 
  3428.  
  3429. BufDesc.Buffer    = 'ItemText'         /* Return buffer name           */
  3430. BufDesc.Size      = 256                /* Size of return buffer        */
  3431. BufDesc.Offset    = 0                  /* Offset into the message item */
  3432.  
  3433. call RxVIMReadMessageItem MsgItemPtr, 'BufDesc'
  3434.  
  3435. or
  3436.  
  3437. rc = RxVIMReadMessageItem( MsgItemPtr, 'BufDesc' )
  3438.  
  3439.  
  3440. ΓòÉΓòÉΓòÉ 10.7.2. Return Codes ΓòÉΓòÉΓòÉ
  3441.  
  3442. The RxVIMReadMessageItem function returns the following values: 
  3443.  
  3444.         0 - Successful function return
  3445.  
  3446. The return values from all of the function calls return a zero for success, and 
  3447. non-zero for failure.  To retrieve the actual failure reason, use the 
  3448. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  3449. value to the actual failure text.  Using RxVIMStatus, the following values may 
  3450. be returned by RxVIMReadMessageItem: 
  3451.  
  3452.         VIMSTS_SUCCESS                  Successful return
  3453.         VIMSTS_FAILURE                  Function Failed
  3454.  
  3455.         VIMSTS_BAD_PARAM                The message item pointer is bad
  3456.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  3457.         VIMSTS_INVALID_OBJECT           The message item handle is bad
  3458.         VIMSTS_READ_FAILURE             Error reading from the disk
  3459.         VIMSTS_WRITE_FAILURE            Error writing to the disk
  3460.  
  3461.  
  3462. ΓòÉΓòÉΓòÉ 10.7.3. Example ΓòÉΓòÉΓòÉ
  3463.  
  3464. /* Example of using RxVIMReadMessageItem */
  3465.  
  3466. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  3467. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  3468. call RxVIMLoadFuncs
  3469.  
  3470. /* This will establish a connection to the VIM system */
  3471. rc = RxVIMInitialize()
  3472.  
  3473. /* Obtain the default session information */
  3474. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  3475.  
  3476. Say 'Default path:' db_path
  3477. Say 'Default name:' user_name
  3478.  
  3479. /* Opening a session with the mail subsystem */
  3480. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  3481.  
  3482. /* Open the default message container (Inbox) */
  3483. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  3484.  
  3485. /* Retrieve the first message from the container pulling the */
  3486. /* message reference number only                             */
  3487. attrDesc.0 = 1
  3488. attrDesc.selector = 'VIMSEL_REF'
  3489. attrDesc.buffer   = 'refno'
  3490.  
  3491. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  3492.                             '','VIM_NO_FLAGS','more')
  3493.  
  3494. /* Open the first message */
  3495. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  3496.  
  3497. /* Retrieve the first text message item from the first message */
  3498. ipos     = ''
  3499. iskip    = 1
  3500. icount   = 1
  3501. ifilter  = 'VIMSEL_CLASS'
  3502. ifdata   = 'VIMSEL_NOTE_PART'
  3503. imore    = ''
  3504. attrItem = ''
  3505.  
  3506. rc = RxVIMEnumerateMessageItems(MsgPtr,'ipos',iskip,'icount','attrItem',ifilter,,
  3507.                             ifdata,'imore')
  3508.  
  3509.  
  3510. /* Open the message item */
  3511. rc = RxVIMOpenMessageItem( MsgPtr, attrItem.1.REF, '', '', 'MsgItemPtr')
  3512.  
  3513.  
  3514. /* Store the first 2K of message item in a Rexx variable */
  3515. BufDesc.Buffer    = 'ItemText'         /* Return buffer name    */
  3516. BufDesc.Size      = 2048               /* Size of return buffer */
  3517. BufDesc.Offset    = 0
  3518.  
  3519. rc = RxVIMReadMessageItem( MsgItemPtr, 'BufDesc')
  3520.  
  3521. /* Close the specified message container */
  3522. rc = RxVIMCloseMessageContainer( MsgCont )
  3523.  
  3524. /* Close the session with the mail subsystem */
  3525. rc = RxVIMCloseSession( Sess )
  3526.  
  3527. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  3528. call RxVIMDropFuncs
  3529.  
  3530.  
  3531. ΓòÉΓòÉΓòÉ 10.8. RxVIMCloseMessageItem ΓòÉΓòÉΓòÉ
  3532.  
  3533. The RxVIMCloseMessageItem function closes a message item that has been opened 
  3534. for action. 
  3535.  
  3536.  
  3537. ΓòÉΓòÉΓòÉ 10.8.1. Syntax ΓòÉΓòÉΓòÉ
  3538.  
  3539. RxVIMCloseMessageItem is called with one parameter. The parameter is the 
  3540. variable which contains a pointer to the open message item. 
  3541.  
  3542. call RxVIMCloseMessageItem MsgItemPtr
  3543.  
  3544. or
  3545.  
  3546. rc = RxVIMCloseMessageItem( MsgItemPtr )
  3547.  
  3548.  
  3549. ΓòÉΓòÉΓòÉ 10.8.2. Return Codes ΓòÉΓòÉΓòÉ
  3550.  
  3551. The RxVIMCloseMessageItem function returns the following values: 
  3552.  
  3553.         0 - Successful function return
  3554.  
  3555. The return values from all of the function calls return a zero for success, and 
  3556. non-zero for failure.  To retrieve the actual failure reason, use the 
  3557. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  3558. value to the actual failure text.  Using RxVIMStatus, the following values may 
  3559. be returned by RxVIMCloseMessageItem: 
  3560.  
  3561.         VIMSTS_SUCCESS                  Successful return
  3562.         VIMSTS_FAILURE                  Function Failed
  3563.  
  3564.         VIMSTS_INVALID_OBJECT           The message item handle is bad
  3565.  
  3566.  
  3567. ΓòÉΓòÉΓòÉ 10.8.3. Example ΓòÉΓòÉΓòÉ
  3568.  
  3569. /* Example of using RxVIMCloseMessageItem */
  3570.  
  3571. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  3572. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  3573. call RxVIMLoadFuncs
  3574.  
  3575. /* This will establish a connection to the VIM system */
  3576. rc = RxVIMInitialize()
  3577.  
  3578. /* Obtain the default session information */
  3579. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  3580.  
  3581. Say 'Default path:' db_path
  3582. Say 'Default name:' user_name
  3583.  
  3584. /* Opening a session with the mail subsystem */
  3585. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  3586.  
  3587. /* Open the default message container (Inbox) */
  3588. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  3589.  
  3590. /* Retrieve the first message from the container pulling the */
  3591. /* message reference number only                             */
  3592. attrDesc.0 = 1
  3593. attrDesc.selector = 'VIMSEL_REF'
  3594. attrDesc.buffer   = 'refno'
  3595.  
  3596. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  3597.                             '','VIM_NO_FLAGS','more')
  3598.  
  3599. /* Open the first message */
  3600. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  3601.  
  3602. /* Retrieve the first text message item from the first message */
  3603. ipos     = ''
  3604. iskip    = 1
  3605. icount   = 1
  3606. ifilter  = 'VIMSEL_CLASS'
  3607. ifdata   = 'VIMSEL_NOTE_PART'
  3608. imore    = ''
  3609. attrItem = ''
  3610.  
  3611. rc = RxVIMEnumerateMessageItems(MsgPtr,'ipos',iskip,'icount','attrItem',ifilter,,
  3612.                             ifdata,'imore')
  3613.  
  3614. /* Open the message item */
  3615. rc = RxVIMOpenMessageItem( MsgPtr, attrItem.1.REF, '', '', 'MsgItemPtr')
  3616.  
  3617.  
  3618.  
  3619. /* Close the message item */
  3620. rc = RxVIMCloseMessageItem( MsgItemPtr )
  3621.  
  3622.  
  3623. /* Close the specified message container */
  3624. rc = RxVIMCloseMessageContainer( MsgCont )
  3625.  
  3626. /* Close the session with the mail subsystem */
  3627. rc = RxVIMCloseSession( Sess )
  3628.  
  3629. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  3630. call RxVIMDropFuncs
  3631.  
  3632.  
  3633. ΓòÉΓòÉΓòÉ 10.9. RxVIMEnumerateMessageRecipients ΓòÉΓòÉΓòÉ
  3634.  
  3635. The RxVIMEnumerateMessageRecipients function retrieves one or more recipients 
  3636. of the specified message. 
  3637.  
  3638.  
  3639. ΓòÉΓòÉΓòÉ 10.9.1. Syntax ΓòÉΓòÉΓòÉ
  3640.  
  3641. RxVIMEnumerateMessageRecipients is called with seven parameters. The first 
  3642. parameter is the pointer to the open message, which was returned from the open 
  3643. of the message. 
  3644.  
  3645. The second parameter is a selector that indicates the type of recipients to 
  3646. retrieve. 
  3647.  
  3648. The third is a variable containing the starting position within the message 
  3649. recipients.  To start at the beginning, the value of the variable should be set 
  3650. to null ('').  For subsequent calls, this value will contain the return value 
  3651. from the previous call.  This entry MUST be a variable name, since the function 
  3652. returns the value of the next starting position. 
  3653.  
  3654. The fourth parameter is the number of entries to skip before or after the 
  3655. starting position.  To start at the beginning,and move forward, this should be 
  3656. set to a value of 1.  To start at the end, and move in reverse, this should be 
  3657. set to a value of -1. 
  3658.  
  3659. The fifth parameter is a stem variable name that contains the number of 
  3660. attributes to retrieve at the root, and a Selector and Buffer entry for each 
  3661. attribute.  The Selector entry contains the selector to retrieve, and the 
  3662. Buffer entry contains the name of the variable to return the values. 
  3663.  
  3664. An example of a properly formated attribute description buffer is shown below: 
  3665.  
  3666.       attrDesc.0 = 1
  3667.       attrDesc.1.Selector = 'VIMSEL_NAME'
  3668.       attrDesc.1.Buffer   = 'Name'
  3669.  
  3670. The sixth parameter is a variable that contains the number of recipients to 
  3671. read for the call.  Upon return, the variable contains the number of recipients 
  3672. actually read.  This entry MUST be a variable name, since the function returns 
  3673. the number of recipients actually read. 
  3674.  
  3675. The seventh parameter is the name of a variable to return a boolean value 
  3676. indicating if additional recipients exist for this message.  This value can be 
  3677. used to indicate that another call to RxVIMEnumerateRecipients is necessary to 
  3678. process remaining recipients for this message. 
  3679.  
  3680. Pos     = ''
  3681. Skipcnt = 1
  3682. Mcount  = 1
  3683. Rtype   = 'VIMSEL_TO'
  3684. attrDesc.0 = 1
  3685. attrDesc.1.Selector = 'VIMSEL_NAME'
  3686. attrDesc.1.Buffer   = 'Name'
  3687. more    = ''
  3688.  
  3689.  
  3690.  
  3691. call RxVIMEnumerateMessageRecipients Message,Rtype,'Pos',Skipcnt,'attrDesc','MCount','more'
  3692.  
  3693. or
  3694.  
  3695. rc = RxVIMEnumerateMessageRecipients( Message,Rtype,'Pos',Skipcnt,'attrDesc','MCount','more' )
  3696.  
  3697. Listed below are the valid selectors to use to specify the type of recipients 
  3698. to retrieve: 
  3699.  
  3700. VIMSEL_TO                       Retrieves recipients on the TO list
  3701.  
  3702. VIMSEL_CC                       Retrieves recipients on the CC list
  3703.  
  3704. VIMSEL_BCC                      Retrieves recipients on the BCC list
  3705.  
  3706. Listed below are the valid selectors to use to specific information from the 
  3707. call: 
  3708.  
  3709. VIMSEL_NAME                     Return the name of the recipient
  3710.  
  3711. VIMSEL_FAILURE_REASON           Return the reason a delivery failed
  3712.  
  3713. VIMSEL_FAN                      Return the Foreign Alias Name for this
  3714.                                 recipient, used in gateway applications
  3715.  
  3716. VIMSEL_RECIP_STATUS             Return True if message has been delivered
  3717.                                 or False if it has not been delivered
  3718.  
  3719. The function will return the requested attribute values in the specified buffer 
  3720. as stem values with the following format: 
  3721.  
  3722.          'Name' specified to receive recipient name
  3723.          5 messages are retreived
  3724.  
  3725.          Name.0 = 5
  3726.          Name.1 = 'Name of the first  recipient'
  3727.          Name.2 = 'Name of the second recipient'
  3728.          Name.3 = 'Name of the third recipient'
  3729.          Name.4 = 'Name of the fourth recipient'
  3730.          Name.5 = 'Name of the fifth recipient'
  3731.  
  3732.  
  3733. ΓòÉΓòÉΓòÉ 10.9.2. Return Codes ΓòÉΓòÉΓòÉ
  3734.  
  3735. The RxVIMEnumerateMessageRecipients function returns the following values: 
  3736.  
  3737.         0 - Successful return
  3738.  
  3739. The return values from all of the function calls return a zero for success, and 
  3740. non-zero for failure.  To retrieve the actual failure reason, use the 
  3741. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  3742. value to the actual failure text.  Using RxVIMStatus, the following values may 
  3743. be returned by RxVIMEnumerateMessageRecipients: 
  3744.  
  3745.         VIMSTS_SUCCESS                  Successful return
  3746.         VIMSTS_FAILURE                  Function Failed
  3747.  
  3748.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  3749.         VIMSTS_BUF_TOO_SMALL            Return buffer is too small
  3750.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  3751.         VIMSTS_INVALID_OBJECT           The message handle is bad
  3752.         VIMSTS_INVALID_SELECTOR         The requested type is bad
  3753.  
  3754.  
  3755. ΓòÉΓòÉΓòÉ 10.9.3. Example ΓòÉΓòÉΓòÉ
  3756.  
  3757. /* Example of using RxVIMEnumerateMessageRecipientss */
  3758.  
  3759. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  3760. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  3761. call RxVIMLoadFuncs
  3762.  
  3763.  
  3764. /* This will establish a connection to the VIM system */
  3765. rc = RxVIMInitialize()
  3766.  
  3767. /* Obtain the default session information */
  3768. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  3769.  
  3770. Say 'Default path:' db_path
  3771. Say 'Default name:' user_name
  3772.  
  3773. /* Opening a session with the mail subsystem */
  3774. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  3775.  
  3776. /* Open the default message container (Inbox) */
  3777. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  3778.  
  3779. /* Retrieve the first message from the container pulling the */
  3780. /* message reference number only                             */
  3781. pos = ''                                  /* Start at beginning */
  3782. skipcnt = 1                               /* Start at beginning */
  3783. mcount  = 1                               /* Return one message */
  3784. filter  = 'VIMSEL_NO_FILTER'              /* No filtering       */
  3785. fdata   = ''                              /* No filter data     */
  3786. flags   = 'VIM_NO_FLAGS'                  /* No flags           */
  3787. more = ''                                 /* more messages?     */
  3788.  
  3789. attrDesc.0 = 2                            /* retrieve 2 attributes    */
  3790. attrDesc.1.Selector = 'VIMSEL_REF'        /* reference value          */
  3791. attrDesc.1.Buffer   = 'refno'             /* buffer to return refno   */
  3792. attrDesc.2.Selector = 'VIMSEL_SUBJECT'    /* message subject          */
  3793. attrDesc.2.Buffer   = 'Subject'           /* buffer to return subject */
  3794.  
  3795. rc = RxVIMEnumerateMessages(MsgCont,'pos',skipcnt,'attrDesc','mcount',filter,,
  3796.                             fdata,flags,'more')
  3797.  
  3798. /* Open the first message */
  3799. rc = RxVIMOpenMessage(MsgCont,refno.1,'','Message')
  3800.  
  3801.  
  3802.  
  3803. /* Retrieve the name of the first recipient on the TO list */
  3804.  
  3805. mpos = ''                                  /* Start at beginning   */
  3806. mskipcnt = 1                               /* Start at beginning   */
  3807. mcount  = 1                                /* Return one recipient */
  3808. more = ''                                  /* more recipients?     */
  3809.  
  3810. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  3811. attrDesc.1.Selector = 'VIMSEL_NAME'       /* recipient name           */
  3812. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  3813.  
  3814. rc = RxVIMEnumerateMessageRecipients(Message,'VIMSEL_TO','mpos',mskipcnt,'attrDesc',,
  3815.                                      'mcount','more')
  3816.  
  3817. Say 'The name of the first recipient is' name.1
  3818.  
  3819.  
  3820.  
  3821.  
  3822. /* Close the specified message container */
  3823. rc = RxVIMCloseMessageContainer( MsgCont )
  3824.  
  3825. /* Close the session with the mail subsystem */
  3826. rc = RxVIMCloseSession( Sess )
  3827.  
  3828. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  3829. call RxVIMDropFuncs
  3830.  
  3831.  
  3832. ΓòÉΓòÉΓòÉ 10.10. RxVIMOpenNestedMessage ΓòÉΓòÉΓòÉ
  3833.  
  3834. The RxVIMOpenNestedMessage function opens the specified nested message with the 
  3835. VIM system.  After the message has been opened, the other message functions can 
  3836. be used for further message processing.  A nested message is one that has been 
  3837. created with RxVIMCreateNestedMessage.  By opening the message as a nested 
  3838. message, the history can be reviewed at that particular point. 
  3839.  
  3840.  
  3841. ΓòÉΓòÉΓòÉ 10.10.1. Syntax ΓòÉΓòÉΓòÉ
  3842.  
  3843. RxVIMOpenNestedMessage is called with three parameter. The first parameter is 
  3844. the variable which contains a pointer to the open message containing a nested 
  3845. message.  The second parameter is the reference number of the nested message to 
  3846. open.  The third parameter is the name of the variable to return the pointer to 
  3847. the nested message. 
  3848.  
  3849. call RxVIMOpenNestedMessage Message, MsgRef, 'NestMsgPtr'
  3850.  
  3851. or
  3852.  
  3853. rc = RxVIMOpenNestedMessage( Message, MsgRef, 'NestMsgPtr' )
  3854.  
  3855.  
  3856. ΓòÉΓòÉΓòÉ 10.10.2. Return Codes ΓòÉΓòÉΓòÉ
  3857.  
  3858. The RxVIMOpenNestedMessage function returns the following values: 
  3859.  
  3860.         0 - Successful function return
  3861.  
  3862. The return values from all of the function calls return a zero for success, and 
  3863. non-zero for failure.  To retrieve the actual failure reason, use the 
  3864. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  3865. value to the actual failure text.  Using RxVIMStatus, the following values may 
  3866. be returned by RxVIMOpenNestedMessage: 
  3867.  
  3868.         VIMSTS_SUCCESS                  Successful return
  3869.         VIMSTS_FAILURE                  Function Failed
  3870.  
  3871.         VIMSTS_BAD_PARAM                The message reference is bad
  3872.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  3873.         VIMSTS_INVALID_OBJECT           The message handle is bad
  3874.         VIMSTS_NOT_SUPPORTED            This function is not supported
  3875.  
  3876.  
  3877. ΓòÉΓòÉΓòÉ 10.10.3. Example ΓòÉΓòÉΓòÉ
  3878.  
  3879. /* Example of using RxVIMOpenNestedMessage */
  3880.  
  3881. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  3882. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  3883. call RxVIMLoadFuncs
  3884.  
  3885. /* This will establish a connection to the VIM system */
  3886. rc = RxVIMInitialize()
  3887.  
  3888. /* Obtain the default session information */
  3889. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  3890.  
  3891. Say 'Default path:' db_path
  3892. Say 'Default name:' user_name
  3893.  
  3894. /* Opening a session with the mail subsystem */
  3895. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  3896.  
  3897. /* Open the default message container (Inbox) */
  3898. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  3899.  
  3900. /* Retrieve the first message from the container pulling the */
  3901. /* message reference number only                             */
  3902. attrDesc.0 = 1
  3903. attrDesc.selector = 'VIMSEL_REF'
  3904. attrDesc.buffer   = 'refno'
  3905.  
  3906. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  3907.                             '','VIM_NO_FLAGS','more')
  3908.  
  3909.  
  3910. /* Open the first message */
  3911. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  3912.  
  3913.  
  3914. /* Enumerate the nested message items */
  3915. ipos     = ''
  3916. iskip    = 1
  3917. icount   = 1
  3918. ifilter  = 'VIMSEL_CLASS'
  3919. ifdata   = 'VIMSEL_NESTED_MSG'
  3920. imore    = ''
  3921. attrItem = ''
  3922.  
  3923. rc = RxVIMEnumerateMessageItems(MsgPtr,'ipos',iskip,'icount','attrItem',ifilter,,
  3924.                             ifdata,'imore')
  3925.  
  3926. /* THIS EXAMPLE ASSUMES THAT THE FIRST MESSAGE IN THE INBOX CONTAINS */
  3927. /* NESTED MESSAGES.  THIS EXAMPLE WILL FAIL IF THE FIRST MESSAGE     */
  3928. /* DOES NOT CONTAIN NESTED MESSAGES                                  */
  3929.  
  3930.  
  3931.  
  3932. /* Open the first occurance of nesting in message */
  3933. rc = RxVIMOpenNestedMessage(MsgPtr,attrItem.1.REF,'NestMsgPtr')
  3934.  
  3935.  
  3936.  
  3937. /* Close the specified message */
  3938. rc = RxVIMCloseMessage( NestMsgPtr )
  3939.  
  3940. /* Close the specified message container */
  3941. rc = RxVIMCloseMessageContainer( MsgCont )
  3942.  
  3943. /* Close the session with the mail subsystem */
  3944. rc = RxVIMCloseSession( Sess )
  3945.  
  3946. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  3947. call RxVIMDropFuncs
  3948.  
  3949.  
  3950. ΓòÉΓòÉΓòÉ 10.11. RxVIMExtractMessage ΓòÉΓòÉΓòÉ
  3951.  
  3952. The RxVIMExtractMessage function moves the message from the message container 
  3953. into a file. 
  3954.  
  3955.  
  3956. ΓòÉΓòÉΓòÉ 10.11.1. Syntax ΓòÉΓòÉΓòÉ
  3957.  
  3958. RxVIMExtractMessage is called with three parameter. The first parameter is the 
  3959. name of the variable that contains a pointer to the message.  The second 
  3960. parameter are control flags for the extract. The third is the filespec of the 
  3961. file into which the message will be extracted. 
  3962.  
  3963. call RxVIMExtractMessage MsgPtr, 'flags', 'file_name'
  3964.  
  3965. or
  3966.  
  3967. rc = RxVIMExtractMessage( MsgPtr, 'flags', 'file_name' )
  3968.  
  3969. Listed below are the valid types to use to specify extraction options: 
  3970.  
  3971. VIM_NO_FLAGS                    No extract options
  3972.  
  3973. VIM_EXTRACT_REF                 Extract only reference information,
  3974.                                 not the actual message
  3975.  
  3976.  
  3977. ΓòÉΓòÉΓòÉ 10.11.2. Return Codes ΓòÉΓòÉΓòÉ
  3978.  
  3979. The RxVIMExtractMessage function returns the following values: 
  3980.  
  3981.         0 - Successful function return
  3982.  
  3983. The return values from all of the function calls return a zero for success, and 
  3984. non-zero for failure.  To retrieve the actual failure reason, use the 
  3985. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  3986. value to the actual failure text.  Using RxVIMStatus, the following values may 
  3987. be returned by RxVIMExtractMessage: 
  3988.  
  3989.         VIMSTS_SUCCESS                  Successful return
  3990.         VIMSTS_FAILURE                  Function Failed
  3991.  
  3992.         VIMSTS_BAD_PARAM                The filespec is bad
  3993.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  3994.         VIMSTS_INVALID_OBJECT           The message handle is bad
  3995.         VIMSTS_NOT_SUPPORTED            Flag value is not supported
  3996.         VIMSTS_OPEN_FAILURE             The file could not be opened
  3997.         VIMSTS_WRITE_FAILURE            Error writing to the disk
  3998.  
  3999.  
  4000. ΓòÉΓòÉΓòÉ 10.11.3. Example ΓòÉΓòÉΓòÉ
  4001.  
  4002. /* Example of using RxVIMExtractMessage */
  4003.  
  4004. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  4005. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  4006. call RxVIMLoadFuncs
  4007.  
  4008. /* This will establish a connection to the VIM system */
  4009. rc = RxVIMInitialize()
  4010.  
  4011. /* Obtain the default session information */
  4012. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  4013.  
  4014. Say 'Default path:' db_path
  4015. Say 'Default name:' user_name
  4016.  
  4017. /* Opening a session with the mail subsystem */
  4018. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  4019.  
  4020. /* Open the default message container (Inbox) */
  4021. rc = RxVIMOpenMessageContainer(Sess,'','MsgCont')
  4022.  
  4023. /* Retrieve the first message from the container pulling the */
  4024. /* message reference number only                             */
  4025. attrDesc.0 = 1
  4026. attrDesc.selector = 'VIMSEL_REF'
  4027. attrDesc.buffer   = 'refno'
  4028.  
  4029. rc = RxVIMEnumerateMessages(MsgCont,'',1,'attrDesc',1,'VIMSEL_NO_FILTER',,
  4030.                             '','VIM_NO_FLAGS','more')
  4031.  
  4032. /* Open the first message */
  4033. rc = RxVIMOpenMessage(MsgCont,refno.1,'','MsgPtr')
  4034.  
  4035.  
  4036.  
  4037. /* Extract the message to a file */
  4038. path  = '\rexxvim\'
  4039. filename = 'message.dat'
  4040. filespec = path || filename
  4041.  
  4042. rc = RxVIMExtractMessage(MsgPtr,'VIM_NO_FLAGS',filespec)
  4043.  
  4044.  
  4045.  
  4046. /* Close the specified message */
  4047. rc = RxVIMCloseMessage( MsgPtr )
  4048.  
  4049. /* Close the specified message container */
  4050. rc = RxVIMCloseMessageContainer( MsgCont )
  4051.  
  4052. /* Close the session with the mail subsystem */
  4053. rc = RxVIMCloseSession( Sess )
  4054.  
  4055. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  4056. call RxVIMDropFuncs
  4057.  
  4058.  
  4059. ΓòÉΓòÉΓòÉ 10.12. RxVIMOpenExtractedMessage ΓòÉΓòÉΓòÉ
  4060.  
  4061. The RxVIMOpenExtractedMessage function opens the specified message which has 
  4062. been previously extracted to a file. After the message has been opened, the 
  4063. other message functions can be used for further message processing. 
  4064.  
  4065.  
  4066. ΓòÉΓòÉΓòÉ 10.12.1. Syntax ΓòÉΓòÉΓòÉ
  4067.  
  4068. RxVIMOpenExtractedMessage is called with three parameter. The first parameter 
  4069. is the variable which contains a pointer to the current VIM session.  The 
  4070. second parameter is the filespec for the extracted message to open.  The third 
  4071. parameter is the name of the variable to return the pointer to the message. 
  4072.  
  4073. call RxVIMOpenExtractedMessage Session, 'file_name', 'MsgPtr'
  4074.  
  4075. or
  4076.  
  4077. rc = RxVIMOpenExtractedMessage( Session, 'file_name', 'MsgPtr' )
  4078.  
  4079.  
  4080. ΓòÉΓòÉΓòÉ 10.12.2. Return Codes ΓòÉΓòÉΓòÉ
  4081.  
  4082. The RxVIMOpenExtractedMessage function returns the following values: 
  4083.  
  4084.         0 - Successful function return
  4085.  
  4086. The return values from all of the function calls return a zero for success, and 
  4087. non-zero for failure.  To retrieve the actual failure reason, use the 
  4088. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  4089. value to the actual failure text.  Using RxVIMStatus, the following values may 
  4090. be returned by RxVIMOpenExtractedMessage: 
  4091.  
  4092.         VIMSTS_SUCCESS                  Successful return
  4093.         VIMSTS_FAILURE                  Function Failed
  4094.  
  4095.         VIMSTS_BAD_PARAM                File name is bad
  4096.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  4097.         VIMSTS_INVALID_OBJECT           The session handle is bad
  4098.         VIMSTS_OPEN_FAILURE             File could not be opened
  4099.         VIMSTS_READ_FAILURE             Error reading from the disk
  4100.  
  4101.  
  4102. ΓòÉΓòÉΓòÉ 10.12.3. Example ΓòÉΓòÉΓòÉ
  4103.  
  4104. /* Example of using RxVIMOpenExtractedMessage */
  4105.  
  4106. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  4107. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  4108. call RxVIMLoadFuncs
  4109.  
  4110. /* This will establish a connection to the VIM system */
  4111. rc = RxVIMInitialize()
  4112.  
  4113. /* Obtain the default session information */
  4114. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  4115.  
  4116. Say 'Default path:' db_path
  4117. Say 'Default name:' user_name
  4118.  
  4119. /* Opening a session with the mail subsystem */
  4120. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  4121.  
  4122.  
  4123.  
  4124. /* Open an extracted message */
  4125. path  = '\rexxvim\'
  4126. filename = 'message.dat'
  4127. filespec = path || filename
  4128.  
  4129. rc = RxVIMOpenMessage(Sess,filespec,'MsgPtr')
  4130.  
  4131.  
  4132.  
  4133. /* Close the message */
  4134. rc = RxVIMCloseMessage( MsgPtr )
  4135.  
  4136. /* Close the session with the mail subsystem */
  4137. rc = RxVIMCloseSession( Sess )
  4138.  
  4139. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  4140. call RxVIMDropFuncs
  4141.  
  4142.  
  4143. ΓòÉΓòÉΓòÉ 11. Address Book Functions ΓòÉΓòÉΓòÉ
  4144.  
  4145. This section describes each of the functions available in the RexxVIM product 
  4146. that address address book RexxVIM features. 
  4147.  
  4148.  
  4149. ΓòÉΓòÉΓòÉ 11.1. RxVIMEnumerateAddressBooks ΓòÉΓòÉΓòÉ
  4150.  
  4151. The RxVIMEnumerateAddressBooks function retrieves one or more attributes about 
  4152. the address books available in the current session. 
  4153.  
  4154.  
  4155. ΓòÉΓòÉΓòÉ 11.1.1. Syntax ΓòÉΓòÉΓòÉ
  4156.  
  4157. RxVIMEnumerateAddressBooks is called with six parameters. The first parameter 
  4158. is the pointer to the current session. 
  4159.  
  4160. The second is a variable containing the starting position within the address 
  4161. book list.  To start at the beginning, the value of the variable should be set 
  4162. to null ('').  For subsequent calls, this value will contain the return value 
  4163. from the previous call.  This entry MUST be a variable name, since the function 
  4164. returns the value of the next starting position. 
  4165.  
  4166. The third parameter is the number of entries to skip before or after the 
  4167. starting position.  To start at the beginning,and move forward, this should be 
  4168. set to a value of 1.  To start at the end, and move in reverse, this should be 
  4169. set to a value of -1. 
  4170.  
  4171. The fourth parameter is a stem variable name that contains the number of 
  4172. attributes to retrieve at the root, and a Selector and Buffer entry for each 
  4173. attribute.  The Selector entry contains the selector to retrieve, and the 
  4174. Buffer entry contains the name of the variable to return the values. 
  4175.  
  4176. An example of a properly formated attribute description buffer is shown below: 
  4177.  
  4178.       attrDesc.0 = 1
  4179.       attrDesc.1.Selector = 'VIMSEL_NAME'
  4180.       attrDesc.1.Buffer   = 'Name'
  4181.  
  4182. The fifth parameter is a variable that contains the number of address books to 
  4183. read for the call.  Upon return, the variable contains the number of address 
  4184. books actually read.  This entry MUST be a variable name, since the function 
  4185. returns the number of address books actually read. 
  4186.  
  4187. The sixth parameter is the name of a variable to return a boolean value 
  4188. indicating if additional address books exist in this session.  This value can 
  4189. be used to indicate that another call to RxVIMEnumerateAddressBooks is 
  4190. necessary to process remaining address books. 
  4191.  
  4192. Pos     = ''
  4193. Skipcnt = 1
  4194. Mcount  = 1
  4195. attrDesc.0 = 1
  4196. attrDesc.1.Selector = 'VIMSEL_NAME'
  4197. attrDesc.1.Buffer   = 'Name'
  4198. more    = ''
  4199.  
  4200.  
  4201. call RxVIMEnumerateAddressBooks Session,'Pos',Skipcnt,'attrDesc','MCount','more'
  4202.  
  4203. or
  4204.  
  4205. rc = RxVIMEnumerateAddressBooks( Session,'Pos',Skipcnt,'attrDesc','MCount','more' )
  4206.  
  4207. Listed below are the valid selectors to use to retrieve specific information 
  4208. from the call: 
  4209.  
  4210. VIMSEL_NAME                     Return the name of the address book
  4211.  
  4212. VIMSEL_TYPE                     Return the type of the address book
  4213.  
  4214.                                    Return values will be:
  4215.  
  4216.                                    VIMSEL_CCMAIL
  4217.                                    VIMSEL_MHS
  4218.                                    VIMSEL_MSGMGR
  4219.                                    VIMSEL_NOTES
  4220.                                    VIMSEL_OCE
  4221.                                    VIMSEL_X500
  4222.  
  4223. VIMSEL_DISPLAY_NAME             Return the name used to display the
  4224.                                 address book (same as VIMSEL_NAME
  4225.                                 for ccMail)
  4226.  
  4227. VIMSEL_ENTRY_NUMBER             Return the number for this entry
  4228.  
  4229. VIMSEL_TOTAL_ENTRIES            Return the total number of address books
  4230.  
  4231. The function will return the requested attribute values in the specified buffer 
  4232. as stem values with the following format: 
  4233.  
  4234.          'Name' specified to receive recipient name
  4235.          5 messages are retreived
  4236.  
  4237.          Name.0 = 5
  4238.          Name.1 = 'Name of the first  address book'
  4239.          Name.2 = 'Name of the second address book'
  4240.          Name.3 = 'Name of the third address book'
  4241.          Name.4 = 'Name of the fourth address book'
  4242.          Name.5 = 'Name of the fifth address book'
  4243.  
  4244.  
  4245. ΓòÉΓòÉΓòÉ 11.1.2. Return Codes ΓòÉΓòÉΓòÉ
  4246.  
  4247. The RxVIMEnumerateAddressBooks function returns the following values: 
  4248.  
  4249.         0 - Successful return
  4250.  
  4251. The return values from all of the function calls return a zero for success, and 
  4252. non-zero for failure.  To retrieve the actual failure reason, use the 
  4253. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  4254. value to the actual failure text.  Using RxVIMStatus, the following values may 
  4255. be returned by RxVIMEnumerateAddressBooks: 
  4256.  
  4257.         VIMSTS_SUCCESS                  Successful return
  4258.         VIMSTS_FAILURE                  Function Failed
  4259.  
  4260.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  4261.         VIMSTS_BUF_TOO_SMALL            Return buffer is too small
  4262.         VIMSTS_INVALID_OBJECT           The session handle is bad
  4263.         VIMSTS_INVALID_SELECTOR         One of the request selectors is bad
  4264.  
  4265.  
  4266. ΓòÉΓòÉΓòÉ 11.1.3. Example ΓòÉΓòÉΓòÉ
  4267.  
  4268. /* Example of using RxVIMEnumerateAddressBooks */
  4269.  
  4270. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  4271. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  4272. call RxVIMLoadFuncs
  4273.  
  4274.  
  4275. /* This will establish a connection to the VIM system */
  4276. rc = RxVIMInitialize()
  4277.  
  4278. /* Obtain the default session information */
  4279. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  4280.  
  4281. Say 'Default path:' db_path
  4282. Say 'Default name:' user_name
  4283.  
  4284. /* Opening a session with the mail subsystem */
  4285. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  4286.  
  4287.  
  4288. /* Retrieve the name of the first address book */
  4289. pos = ''                                  /* Start at beginning */
  4290. skipcnt = 1                               /* Start at beginning */
  4291. mcount  = 1                               /* Return one entry   */
  4292. more = ''                                 /* more entires?      */
  4293.  
  4294. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  4295. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  4296. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  4297.  
  4298. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  4299.  
  4300. Say 'The name of the first address book is' name.1
  4301.  
  4302.  
  4303. /* Close the session with the mail subsystem */
  4304. rc = RxVIMCloseSession( Sess )
  4305.  
  4306. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  4307. call RxVIMDropFuncs
  4308.  
  4309.  
  4310. ΓòÉΓòÉΓòÉ 11.2. RxVIMOpenAddressBook ΓòÉΓòÉΓòÉ
  4311.  
  4312. The RxVIMOpenAddressBook function opens the specified address book.  Once 
  4313. opened, entries from the address book can be accessed. 
  4314.  
  4315.  
  4316. ΓòÉΓòÉΓòÉ 11.2.1. Syntax ΓòÉΓòÉΓòÉ
  4317.  
  4318. RxVIMOpenAddressBook is called with three parameters. The first parameter is 
  4319. the variable containing the pointer to the current session. The second 
  4320. parameter is the name of the address book to open, which can be retrieved with 
  4321. a call to RxVIMEnumerateAddressBooks.  The third is a variable which will 
  4322. contain a pointer to the address book after it has been opened. 
  4323.  
  4324. call RxVIMOpenAddressBook Session, 'Address Book", 'AddrBkPtr'
  4325.  
  4326. or
  4327.  
  4328. rc = RxVIMOpenAddressBook( Session, 'Address Book', 'AddrBkPtr' )
  4329.  
  4330.  
  4331. ΓòÉΓòÉΓòÉ 11.2.2. Return Codes ΓòÉΓòÉΓòÉ
  4332.  
  4333. The RxVIMOpenAddressBook function returns the following values: 
  4334.  
  4335.         0 - Successful return
  4336.  
  4337. The return values from all of the function calls return a zero for success, and 
  4338. non-zero for failure.  To retrieve the actual failure reason, use the 
  4339. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  4340. value to the actual failure text.  Using RxVIMStatus, the following values may 
  4341. be returned by RxVIMOpenAddressBook: 
  4342.  
  4343.         VIMSTS_SUCCESS                  Successful return
  4344.         VIMSTS_FAILURE                  Function Failed
  4345.  
  4346.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  4347.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  4348.         VIMSTS_INVALID_OBJECT           The session handle is bad
  4349.         VIMSTS_NAME_NOT_FOUND           The address book could not be located
  4350.  
  4351.  
  4352. ΓòÉΓòÉΓòÉ 11.2.3. Example ΓòÉΓòÉΓòÉ
  4353.  
  4354. /* Example of using RxVIMOpenAddressBook */
  4355.  
  4356. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  4357. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  4358. call RxVIMLoadFuncs
  4359.  
  4360.  
  4361. /* This will establish a connection to the VIM system */
  4362. rc = RxVIMInitialize()
  4363.  
  4364. /* Obtain the default session information */
  4365. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  4366.  
  4367. Say 'Default path:' db_path
  4368. Say 'Default name:' user_name
  4369.  
  4370. /* Opening a session with the mail subsystem */
  4371. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  4372.  
  4373. /* Retrieve the name of the first address book */
  4374. pos = ''                                  /* Start at beginning */
  4375. skipcnt = 1                               /* Start at beginning */
  4376. mcount  = 1                               /* Return one entry   */
  4377. more = ''                                 /* more entires?      */
  4378.  
  4379. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  4380. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  4381. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  4382.  
  4383. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  4384.  
  4385.  
  4386.  
  4387. /* Open the first address book found */
  4388. rc = RxVIMOpenAddressBook(Sess,name.1,'AddrBkPtr')
  4389.  
  4390.  
  4391.  
  4392. /* Close the session with the mail subsystem */
  4393. rc = RxVIMCloseSession( Sess )
  4394.  
  4395. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  4396. call RxVIMDropFuncs
  4397.  
  4398.  
  4399. ΓòÉΓòÉΓòÉ 11.3. RxVIMSetCurrentSubtree ΓòÉΓòÉΓòÉ
  4400.  
  4401. The RxVIMSetCurrentSubtree function sets the root of the tree for all future 
  4402. calls to the address book.  For flat address book models, such as cc:Mail and 
  4403. Lotus Notes, this call has no effect.  It is included here for compatibility to 
  4404. the VIM specification. 
  4405.  
  4406.  
  4407. ΓòÉΓòÉΓòÉ 11.3.1. Syntax ΓòÉΓòÉΓòÉ
  4408.  
  4409. RxVIMSetCurrentSubtree is called with three parameters. The first parameter is 
  4410. the variable containing the pointer to the open address book. The second 
  4411. parameter is a reference pointer to set the location of the subtree. The third 
  4412. is the name of the subtree to set the root location. 
  4413.  
  4414. call RxVIMSetCurrentSubtree AddrBkPtr, 'Subtree_Ref', 'Subtree Name'
  4415.  
  4416. or
  4417.  
  4418. rc = RxVIMSetCurrentSubtree( AddrBkPtr, 'Subtree_Ref', 'Subtree Name' )
  4419.  
  4420. Shown below are the valid entries for the subtree reference pointer: 
  4421.  
  4422. VIM_ROOT_REF                  Set subtree to the root of the entry
  4423.  
  4424. VIM_PARENT_REF                Set subtree to the parent of the entry
  4425.  
  4426. NULL ('')                     Set the subtree to the beginning of the entry
  4427.  
  4428.  
  4429. ΓòÉΓòÉΓòÉ 11.3.2. Return Codes ΓòÉΓòÉΓòÉ
  4430.  
  4431. The RxVIMSetCurrentSubtree function returns the following values: 
  4432.  
  4433.         0 - Successful return
  4434.  
  4435. The return values from all of the function calls return a zero for success, and 
  4436. non-zero for failure.  To retrieve the actual failure reason, use the 
  4437. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  4438. value to the actual failure text.  Using RxVIMStatus, the following values may 
  4439. be returned by RxVIMSetCurrentSubtree: 
  4440.  
  4441.         VIMSTS_SUCCESS                  Successful return
  4442.         VIMSTS_FAILURE                  Function Failed
  4443.  
  4444.         VIMSTS_BAD_PARAM                Ref/name not a valid entry
  4445.  
  4446.  
  4447. ΓòÉΓòÉΓòÉ 11.3.3. Example ΓòÉΓòÉΓòÉ
  4448.  
  4449. /* Example of using RxVIMSetCurrentSubtree */
  4450.  
  4451. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  4452. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  4453. call RxVIMLoadFuncs
  4454.  
  4455.  
  4456. /* This will establish a connection to the VIM system */
  4457. rc = RxVIMInitialize()
  4458.  
  4459. /* Obtain the default session information */
  4460. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  4461.  
  4462. Say 'Default path:' db_path
  4463. Say 'Default name:' user_name
  4464.  
  4465. /* Opening a session with the mail subsystem */
  4466. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  4467.  
  4468. /* Retrieve the name of the first address book */
  4469. pos = ''                                  /* Start at beginning */
  4470. skipcnt = 1                               /* Start at beginning */
  4471. mcount  = 1                               /* Return one entry   */
  4472. more = ''                                 /* more entires?      */
  4473.  
  4474. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  4475. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  4476. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  4477.  
  4478. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  4479.  
  4480. /* Open the first address book found */
  4481. rc = RxVIMOpenAddressBook(Sess,name.1,'AddrBkPtr')
  4482.  
  4483.  
  4484. /* NOTE: THIS CALL HAS NO EFFECT WHEN USED WITH CCMAIL OR LOTUS */
  4485. /*       NOTES.  IT IS INCLUDED FOR COMPATIBILITY WITH THE VIM  */
  4486. /*       SPECIFICATION ONLY.                                    */
  4487.  
  4488. /* Set the subtree to the beginning of the address book */
  4489. rc = RxVIMSetCurrentSubtree(AddrBkPtr, '', '')
  4490.  
  4491.  
  4492. /* Close the session with the mail subsystem */
  4493. rc = RxVIMCloseSession( Sess )
  4494.  
  4495. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  4496. call RxVIMDropFuncs
  4497.  
  4498.  
  4499. ΓòÉΓòÉΓòÉ 11.4. RxVIMGetCurrentSubtree ΓòÉΓòÉΓòÉ
  4500.  
  4501. The RxVIMGetCurrentSubtree function returns the current subtree in the address 
  4502. book.  For flat address book models, such as cc:Mail and Lotus Notes, this call 
  4503. has no effect.  It is included here for compatibility to the VIM specification. 
  4504.  
  4505.  
  4506. ΓòÉΓòÉΓòÉ 11.4.1. Syntax ΓòÉΓòÉΓòÉ
  4507.  
  4508. RxVIMGetCurrentSubtree is called with three parameters. The first parameter is 
  4509. the variable containing the pointer to the open address book. The second 
  4510. parameter is a variable to get the reference pointer of the subtree. The third 
  4511. is the name of the variable to get the name of the subtree. 
  4512.  
  4513. call RxVIMGetCurrentSubtree AddrBkPtr, 'Subtree_Ref', 'Subtree Name'
  4514.  
  4515. or
  4516.  
  4517. rc = RxVIMGetCurrentSubtree( AddrBkPtr, 'Subtree_Ref', 'Subtree Name' )
  4518.  
  4519. Shown below are the valid entries for the subtree reference pointer: 
  4520.  
  4521.  
  4522. ΓòÉΓòÉΓòÉ 11.4.2. Return Codes ΓòÉΓòÉΓòÉ
  4523.  
  4524. The RxVIMGetCurrentSubtree function returns the following values: 
  4525.  
  4526.         0 - Successful return
  4527.  
  4528. The return values from all of the function calls return a zero for success, and 
  4529. non-zero for failure.  To retrieve the actual failure reason, use the 
  4530. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  4531. value to the actual failure text.  Using RxVIMStatus, the following values may 
  4532. be returned by RxVIMGetCurrentSubtree: 
  4533.  
  4534.         VIMSTS_SUCCESS                  Successful return
  4535.         VIMSTS_FAILURE                  Function Failed
  4536.  
  4537.         VIMSTS_BAD_PARAM                Ref/name not a valid entry
  4538.         VIMSTS_BUF_TOO_SMALL            Buffer variable is too small
  4539.  
  4540.  
  4541. ΓòÉΓòÉΓòÉ 11.4.3. Example ΓòÉΓòÉΓòÉ
  4542.  
  4543. /* Example of using RxVIMGetCurrentSubtree */
  4544.  
  4545. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  4546. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  4547. call RxVIMLoadFuncs
  4548.  
  4549.  
  4550. /* This will establish a connection to the VIM system */
  4551. rc = RxVIMInitialize()
  4552.  
  4553. /* Obtain the default session information */
  4554. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  4555.  
  4556. Say 'Default path:' db_path
  4557. Say 'Default name:' user_name
  4558.  
  4559. /* Opening a session with the mail subsystem */
  4560. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  4561.  
  4562. /* Retrieve the name of the first address book */
  4563. pos = ''                                  /* Start at beginning */
  4564. skipcnt = 1                               /* Start at beginning */
  4565. mcount  = 1                               /* Return one entry   */
  4566. more = ''                                 /* more entires?      */
  4567.  
  4568. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  4569. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  4570. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  4571.  
  4572. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  4573.  
  4574. /* Open the first address book found */
  4575. rc = RxVIMOpenAddressBook(Sess,name.1,'AddrBkPtr')
  4576.  
  4577.  
  4578.  
  4579. /* NOTE: THIS CALL HAS NO EFFECT WHEN USED WITH CCMAIL OR LOTUS */
  4580. /*       NOTES.  IT IS INCLUDED FOR COMPATIBILITY WITH THE VIM  */
  4581. /*       SPECIFICATION ONLY.                                    */
  4582.  
  4583. /* Set the subtree to the beginning of the address book */
  4584. rc = RxVIMGetCurrentSubtree(AddrBkPtr, 'SubRef', 'SubName')
  4585.  
  4586. Say 'Subtree name is' SubName
  4587.  
  4588.  
  4589.  
  4590. /* Close the session with the mail subsystem */
  4591. rc = RxVIMCloseSession( Sess )
  4592.  
  4593. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  4594. call RxVIMDropFuncs
  4595.  
  4596.  
  4597. ΓòÉΓòÉΓòÉ 11.5. RxVIMEnumerateAddressBookEntries ΓòÉΓòÉΓòÉ
  4598.  
  4599. The RxVIMEnumerateAddressBookEntries function retrieves one or more attributes 
  4600. about the entries in the current address book. 
  4601.  
  4602.  
  4603. ΓòÉΓòÉΓòÉ 11.5.1. Syntax ΓòÉΓòÉΓòÉ
  4604.  
  4605. RxVIMEnumerateAddressBookEntries is called with eight parameters. The first 
  4606. parameter is a variable that contains the pointer to the current address book. 
  4607.  
  4608. The second is a variable containing the starting position within the address 
  4609. book entries.  To start at the beginning, the value of the variable should be 
  4610. set to null ('').  For subsequent calls, this value will contain the return 
  4611. value from the previous call.  This entry MUST be a variable name, since the 
  4612. function returns the value of the next starting position. 
  4613.  
  4614. The third parameter is the number of entries to skip before or after the 
  4615. starting position.  To start at the beginning,and move forward, this should be 
  4616. set to a value of 1.  To start at the end, and move in reverse, this should be 
  4617. set to a value of -1. 
  4618.  
  4619. The fourth parameter is a stem variable name that contains the number of 
  4620. attributes to retrieve at the root, and a Selector and Buffer entry for each 
  4621. attribute.  The Selector entry contains the selector to retrieve, and the 
  4622. Buffer entry contains the name of the variable to return the values. 
  4623.  
  4624. An example of a properly formated attribute description buffer is shown below: 
  4625.  
  4626.       attrDesc.0 = 2
  4627.       attrDesc.1.Selector = 'VIMSEL_NAME'
  4628.       attrDesc.1.Buffer   = 'Name'
  4629.       attrDesc.2.Selector = 'VIMSEL_REF'
  4630.       attrDesc.2.Buffer   = 'RefNo'
  4631.  
  4632. The fifth parameter is a variable that contains the number of address book 
  4633. entries to read for the call.  Upon return, the variable contains the number of 
  4634. address book entries actually read.  This entry MUST be a variable name, since 
  4635. the function returns the number of address book entries actually read. 
  4636.  
  4637. The sixth parameter is a selector indicating the type of filtering to be done 
  4638. on the messages prior to being included in the return information.  Filtering 
  4639. can allow messages to be filtered based on subject, category, type of message, 
  4640. or other values.  To return all messages in the container without filtering, 
  4641. specify 'VIMSEL_NO_FILTER'. The seventh parameter is the value to be used for 
  4642. filtering, if specified. If no filtering is indicated, this parameter should be 
  4643. null (''). 
  4644.  
  4645. The eighth parameter is the name of a variable to return a boolean value 
  4646. indicating if additional address books exist in this session.  This value can 
  4647. be used to indicate that another call to RxVIMEnumerateAddressBookEntries is 
  4648. necessary to process remaining address books. 
  4649.  
  4650. Pos     = ''
  4651. Skipcnt = 1
  4652. Mcount  = 1
  4653. filter  = 'VIMSEL_NO_FILTER'
  4654. fdata   = ''
  4655. attrDesc.0 = 1
  4656. attrDesc.1.Selector = 'VIMSEL_NAME'
  4657. attrDesc.1.Buffer   = 'Name'
  4658. more    = ''
  4659.  
  4660.  
  4661. call RxVIMEnumerateAddressBookEntries AddrBkPtr,'Pos',Skipcnt,'attrDesc','MCount',filter,fdata,'more'
  4662.  
  4663. or
  4664.  
  4665. rc = RxVIMEnumerateAddressBookEntries( AddrBkPtr,'Pos',Skipcnt,'attrDesc','MCount',filter,fdata,'more' )
  4666.  
  4667. Listed below are the valid selectors to use to request specific attributes to 
  4668. be returned for each entry: 
  4669.  
  4670. VIMSEL_REF                      Retrieves the entry reference value
  4671.  
  4672. VIMSEL_TYPE                     Retrieves the message type
  4673.  
  4674.                                    VIMSEL_ENTITY   -  Individual entry
  4675.                                    VIMSEL_GROUP    -  collection of entries
  4676.                                    VIMSEL_SUBTREE  -  subtree entry
  4677.  
  4678.  
  4679. VIMSEL_NAME                     Retrieves the full name of the entry
  4680.  
  4681. VIMSEL_ADDRESS                  Retrieves the address of the entry
  4682.  
  4683. VIMSEL_COMMENTS                 Retrieves the comments for this entry
  4684.  
  4685. VIMSEL_ENTRY_NUMBER             Retrieves the entry number for the entry
  4686.  
  4687. VIMSEL_TOTAL_ENTRIES            Retrieves the total entries in the address book
  4688.  
  4689. VIMSEL_FAN                      Returns foreign alias name, which is used
  4690.                                 in gateway applications
  4691.  
  4692. Listed below are the valid selectors to use to request filtering for each entry 
  4693. (parameter six ): 
  4694.  
  4695. VIMSEL_NO_FILTER                Return all entries
  4696.  
  4697. VIMSEL_ENTITY                   Return only individual entries
  4698.  
  4699. VIMSEL_GROUP                    Return only group entries (lists)
  4700.  
  4701. The function will return the requested attribute values in the specified buffer 
  4702. as stem values with the following format: 
  4703.  
  4704.          'Name' specified to receive address book entry name
  4705.          5 entries are retreived
  4706.  
  4707.          Name.0 = 5
  4708.          Name.1 = 'Name of the first  address book entry'
  4709.          Name.2 = 'Name of the second address book entry'
  4710.          Name.3 = 'Name of the third address book entry'
  4711.          Name.4 = 'Name of the fourth address book entry'
  4712.          Name.5 = 'Name of the fifth address book entry'
  4713.  
  4714.  
  4715. ΓòÉΓòÉΓòÉ 11.5.2. Return Codes ΓòÉΓòÉΓòÉ
  4716.  
  4717. The RxVIMEnumerateAddressBookEntries function returns the following values: 
  4718.  
  4719.         0 - Successful return
  4720.  
  4721. The return values from all of the function calls return a zero for success, and 
  4722. non-zero for failure.  To retrieve the actual failure reason, use the 
  4723. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  4724. value to the actual failure text.  Using RxVIMStatus, the following values may 
  4725. be returned by RxVIMEnumerateAddressBookEntries: 
  4726.  
  4727.         VIMSTS_SUCCESS                  Successful return
  4728.         VIMSTS_FAILURE                  Function Failed
  4729.  
  4730.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  4731.         VIMSTS_BUF_TOO_SMALL            Return buffer is too small
  4732.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  4733.         VIMSTS_INVALID_OBJECT           The address book handle is bad
  4734.         VIMSTS_INVALID_SELECTOR         One of the request selectors is bad
  4735.  
  4736.  
  4737. ΓòÉΓòÉΓòÉ 11.5.3. Example ΓòÉΓòÉΓòÉ
  4738.  
  4739. /* Example of using RxVIMEnumerateAddressBookEntries */
  4740.  
  4741. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  4742. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  4743. call RxVIMLoadFuncs
  4744.  
  4745.  
  4746. /* This will establish a connection to the VIM system */
  4747. rc = RxVIMInitialize()
  4748.  
  4749. /* Obtain the default session information */
  4750. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  4751.  
  4752. Say 'Default path:' db_path
  4753. Say 'Default name:' user_name
  4754.  
  4755. /* Opening a session with the mail subsystem */
  4756. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  4757.  
  4758.  
  4759. /* Retrieve the name of the first address book */
  4760. pos = ''                                  /* Start at beginning */
  4761. skipcnt = 1                               /* Start at beginning */
  4762. mcount  = 1                               /* Return one entry   */
  4763. more = ''                                 /* more entires?      */
  4764.  
  4765. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  4766. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  4767. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  4768.  
  4769. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  4770.  
  4771. /* Open the first addressbook */
  4772. rc = RxVIMOpenAddressBook(Sess, name.1, 'AddrBkPtr')
  4773.  
  4774.  
  4775.  
  4776. /* Retrieve the name of the first address book entry */
  4777. pos = ''                                  /* Start at beginning */
  4778. skipcnt = 1                               /* Start at beginning */
  4779. mcount  = 1                               /* Return one entry   */
  4780. more = ''                                 /* more entires?      */
  4781. filter = 'VIMSEL_NO_FILTER'
  4782. fdata  = ''
  4783.  
  4784. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  4785. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  4786. attrDesc.1.Buffer   = 'Ename'             /* buffer to return name    */
  4787.  
  4788. rc = RxVIMEnumerateAddressBookEntries(AddrBkPtr,'pos',skipcnt,'attrDesc','mcount',filter,fdata,'more')
  4789.  
  4790. Say 'The full name of the first entry is' Ename.1
  4791.  
  4792.  
  4793. /* Close the session with the mail subsystem */
  4794. rc = RxVIMCloseSession( Sess )
  4795.  
  4796. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  4797. call RxVIMDropFuncs
  4798.  
  4799.  
  4800. ΓòÉΓòÉΓòÉ 11.6. RxVIMCreateAddressBookEntry ΓòÉΓòÉΓòÉ
  4801.  
  4802. The RxVIMCreateAddressBookEntry function adds a new entry to the current 
  4803. address book.  To add entries to the primary address book, the session must be 
  4804. connected with the postoffice name and password.  Standard users can only 
  4805. create entries in their private mailing lists. 
  4806.  
  4807. IMPORTANT NOTE:  If this function is called attempting to add an entry to the 
  4808. primary address book of a postoffice that is at the maximum number of local 
  4809. users, the function will generate an exception in OS/2.  This function should 
  4810. only be used with postoffices that have available users. 
  4811.  
  4812.  
  4813. ΓòÉΓòÉΓòÉ 11.6.1. Syntax ΓòÉΓòÉΓòÉ
  4814.  
  4815. RxVIMCreateAddressBookEntry is called with three parameters. The first 
  4816. parameter is a variable that contains the pointer to the current address book. 
  4817.  
  4818. The second is a selector value of the type of entry to create.  For individual 
  4819. entries this will be VIMSEL_ENTITY, and for group entries (lists) this will be 
  4820. VIMSEL_GROUP. 
  4821.  
  4822. The third parameter is a stem variable name that contains the number of 
  4823. attributes to use for creation at the root, and a Selector and Value entry for 
  4824. each attribute.  The Selector entry contains the selector to use in the create, 
  4825. and the Value entry contains the information to use in the create. 
  4826.  
  4827. An example of a properly formated attribute description buffer is shown below: 
  4828.  
  4829.       attrDesc.0 = 2
  4830.       attrDesc.1.Selector = 'VIMSEL_NAME'
  4831.       attrDesc.1.Value    = 'Mark Stevens'
  4832.       attrDesc.2.Selector = 'VIMSEL_COMMENTS'
  4833.       attrDesc.2.Value    = 'This entry created with RexxVIM'
  4834.  
  4835. attrDesc.0 = 1
  4836. attrDesc.1.Selector = 'VIMSEL_NAME'
  4837. attrDesc.1.Buffer   = 'Mark Stevens'
  4838.  
  4839.  
  4840. call RxVIMCreateAddressBookEntry AddrBkPtr,'VIMSEL_ENTITY','attrDesc'
  4841.  
  4842. or
  4843.  
  4844. rc = RxVIMCreateAddressBookEntry( AddrBkPtr,'VIMSEL_ENTITY','attrDesc' )
  4845.  
  4846. Listed below are the valid selectors to use to indicate specific attributes to 
  4847. be set for the entry: 
  4848.  
  4849. VIMSEL_NAME                     Provide the full name of the entry
  4850.  
  4851. VIMSEL_ADDRESS                  Provide the full address of the entry
  4852.  
  4853. VIMSEL_COMMENTS                 Provide free form comments for this entry
  4854.  
  4855. VIMSEL_PASSWORD                 Provide the password for the entry
  4856.  
  4857. VIMSEL_LOCATION                 Set the location using one of these selectors
  4858.  
  4859.                                    VIMSEL_LOCAL   - Add to the local postoffice (default)
  4860.  
  4861.                                    VIMSEL_DIALIN  - Will access the local postoffice
  4862.                                                     using dialin only
  4863.  
  4864.                                    VIMSEL_REMOTE  - User local on another postoffice
  4865.  
  4866.                                    VIMSEL_ALIAS   - Entry is an alias for another
  4867.                                                     local entry
  4868.  
  4869.                                    VIMSEL_DIRECT_POSTOFFICE  - Entry is a postoffice that
  4870.                                                                will directly connect
  4871.  
  4872.                                    VIMSEL_INDIRECT_POSTOFFICE- Entry is a postoffice that
  4873.                                                                will not direct connect
  4874.  
  4875.  
  4876. ΓòÉΓòÉΓòÉ 11.6.2. Return Codes ΓòÉΓòÉΓòÉ
  4877.  
  4878. The RxVIMCreateAddressBookEntry function returns the following values: 
  4879.  
  4880.         0 - Successful return
  4881.  
  4882. The return values from all of the function calls return a zero for success, and 
  4883. non-zero for failure.  To retrieve the actual failure reason, use the 
  4884. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  4885. value to the actual failure text.  Using RxVIMStatus, the following values may 
  4886. be returned by RxVIMCreateAddressBookEntry: 
  4887.  
  4888.         VIMSTS_SUCCESS                  Successful return
  4889.         VIMSTS_FAILURE                  Function Failed
  4890.  
  4891.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  4892.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  4893.         VIMSTS_INVALID_OBJECT           The address book handle is bad
  4894.         VIMSTS_INVALID_SELECTOR         One of the request selectors is bad
  4895.         VIMSTS_NAME_EXISTS              Name already exists in address book
  4896.         VIMSTS_UNSUP_TYPE               Entry type is not valid
  4897.         VIMSTS_WRITE_FAILURE            Error writing to the disk
  4898.         VIMSTS_NOT_SUPPORTED            Attribute not supported
  4899.  
  4900.  
  4901. ΓòÉΓòÉΓòÉ 11.6.3. Example ΓòÉΓòÉΓòÉ
  4902.  
  4903. /* Example of using RxVIMCreateAddressBookEntry */
  4904.  
  4905. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  4906. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  4907. call RxVIMLoadFuncs
  4908.  
  4909.  
  4910. /* This will establish a connection to the VIM system */
  4911. rc = RxVIMInitialize()
  4912.  
  4913. /* Obtain the default session information */
  4914. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  4915.  
  4916. Say 'Default path:' db_path
  4917. Say 'Default name:' user_name
  4918.  
  4919. /* Opening a session with the mail subsystem */
  4920. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  4921.  
  4922.  
  4923. /* Retrieve the name of the first address book */
  4924. pos = ''                                  /* Start at beginning */
  4925. skipcnt = 1                               /* Start at beginning */
  4926. mcount  = 1                               /* Return one entry   */
  4927. more = ''                                 /* more entires?      */
  4928.  
  4929. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  4930. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  4931. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  4932.  
  4933. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  4934.  
  4935. /* Open the first addressbook */
  4936. rc = RxVIMOpenAddressBook(Sess, name.1, 'AddrBkPtr')
  4937.  
  4938.  
  4939.  
  4940. /* Add a new name to the first address book entry */
  4941. attrDesc.0 = 1                            /* create with 1 attribute  */
  4942. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of entry to add     */
  4943. attrDesc.1.Value    = 'Mark Stevens'      /* value to use for add     */
  4944.  
  4945. rc = RxVIMEnumerateAddressBookEntries(AddrBkPtr,'VIMSEL_ENTITY',attrDesc')
  4946.  
  4947. Say attrDesc.1.Value 'has been added to the addressbook'
  4948.  
  4949.  
  4950.  
  4951. /* Close the session with the mail subsystem */
  4952. rc = RxVIMCloseSession( Sess )
  4953.  
  4954. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  4955. call RxVIMDropFuncs
  4956.  
  4957.  
  4958. ΓòÉΓòÉΓòÉ 11.7. RxVIMMatchAddressBook ΓòÉΓòÉΓòÉ
  4959.  
  4960. The RxVIMMatchAddressBook function searches the specified address book for an 
  4961. entry that matches the specified attributes. 
  4962.  
  4963.  
  4964. ΓòÉΓòÉΓòÉ 11.7.1. Syntax ΓòÉΓòÉΓòÉ
  4965.  
  4966. RxVIMMatchAddressBook is called with six parameters. The first parameter is a 
  4967. variable that contains the pointer to the current address book. The second is a 
  4968. selector value to indicate what attribute on which to match. The third 
  4969. parameter is the information with which to perform the match. The fourth 
  4970. parameter a selector value to indicate the type of matching to use. The fifth 
  4971. parameter is a variable that contains the position to start the match.  To 
  4972. begin the search at the beginning, the variable should be set to null (''). The 
  4973. sixth parameter is a variable that will receive the enumeration number of the 
  4974. entry being returned. 
  4975.  
  4976. Pos   = ''
  4977. Enum  = ''
  4978. Attr  = 'VIMSEL_NAME'
  4979. type  = 'VIMSEL_FULL'
  4980. srch  = 'Mark Stevens'
  4981.  
  4982. call RxVIMMatchAddressBook AddrBkPtr,Attr,srch,type,'Pos','Enum'
  4983.  
  4984. or
  4985.  
  4986. rc = RxVIMMatchAddressBook( AddrBkPtr,Attr,srch,type,'Pos','Enum' )
  4987.  
  4988. Listed below are the valid selectors to use to indicate on what element the 
  4989. match will occur: 
  4990.  
  4991. VIMSEL_NAME                     Performs the match on the entry name
  4992.  
  4993. VIMSEL_FAN                      Performs the match on the foreign alias
  4994.                                 name, which is used in gateway applications
  4995.  
  4996. Listed below are the valid selectors to use to indicate type of matching 
  4997. (parameter four ): 
  4998.  
  4999. VIMSEL_FULL                     Return only entries that fully match
  5000.  
  5001. VIMSEL_PARTIAL                  Return entries that match the partial string
  5002.  
  5003.  
  5004. ΓòÉΓòÉΓòÉ 11.7.2. Return Codes ΓòÉΓòÉΓòÉ
  5005.  
  5006. The RxVIMMatchAddressBook function returns the following values: 
  5007.  
  5008.         0 - Successful return
  5009.  
  5010. The return values from all of the function calls return a zero for success, and 
  5011. non-zero for failure.  To retrieve the actual failure reason, use the 
  5012. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  5013. value to the actual failure text.  Using RxVIMStatus, the following values may 
  5014. be returned by RxVIMMatchAddressBook: 
  5015.  
  5016.         VIMSTS_SUCCESS                  Successful return
  5017.         VIMSTS_FAILURE                  Function Failed
  5018.  
  5019.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  5020.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  5021.         VIMSTS_INVALID_OBJECT           The address book handle is bad
  5022.         VIMSTS_INVALID_SELECTOR         One of the request selectors is bad
  5023.         VIMSTS_NO_MATCH                 No entries match the search
  5024.  
  5025.  
  5026. ΓòÉΓòÉΓòÉ 11.7.3. Example ΓòÉΓòÉΓòÉ
  5027.  
  5028. /* Example of using RxVIMMatchAddressBook */
  5029.  
  5030. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  5031. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  5032. call RxVIMLoadFuncs
  5033.  
  5034.  
  5035. /* This will establish a connection to the VIM system */
  5036. rc = RxVIMInitialize()
  5037.  
  5038. /* Obtain the default session information */
  5039. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  5040.  
  5041. Say 'Default path:' db_path
  5042. Say 'Default name:' user_name
  5043.  
  5044. /* Opening a session with the mail subsystem */
  5045. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  5046.  
  5047.  
  5048. /* Retrieve the name of the first address book */
  5049. pos = ''                                  /* Start at beginning */
  5050. skipcnt = 1                               /* Start at beginning */
  5051. mcount  = 1                               /* Return one entry   */
  5052. more = ''                                 /* more entires?      */
  5053.  
  5054. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5055. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  5056. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  5057.  
  5058. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  5059.  
  5060. /* Open the first addressbook */
  5061. rc = RxVIMOpenAddressBook(Sess, name.1, 'AddrBkPtr')
  5062.  
  5063.  
  5064.  
  5065. /* Search for a name in the address book */
  5066. Pos   = ''
  5067. Enum  = ''
  5068. Attr  = 'VIMSEL_NAME'
  5069. type  = 'VIMSEL_FULL'
  5070. srch  = 'Mark Stevens'
  5071.  
  5072. rc = RxVIMMatchAddressBook( AddrBkPtr,Attr,srch,type,'Pos','Enum' )
  5073.  
  5074. if rc>0 then
  5075.   Say srch 'not found in addressbook'
  5076. else
  5077.   Say srch 'was found in addressbook at location' enum
  5078.  
  5079.  
  5080.  
  5081. /* Close the session with the mail subsystem */
  5082. rc = RxVIMCloseSession( Sess )
  5083.  
  5084. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  5085. call RxVIMDropFuncs
  5086.  
  5087.  
  5088. ΓòÉΓòÉΓòÉ 11.8. RxVIMGetABEntryAttributes ΓòÉΓòÉΓòÉ
  5089.  
  5090. The RxVIMGetABEntryAttributes function retrieves one or more attributes about 
  5091. the specified address book entry. 
  5092.  
  5093.  
  5094. ΓòÉΓòÉΓòÉ 11.8.1. Syntax ΓòÉΓòÉΓòÉ
  5095.  
  5096. RxVIMGetABEntryAttributes is called with four parameters. The first parameter 
  5097. is a variable that contains the pointer to the current address book. 
  5098.  
  5099. The second is a variable containing the reference number for the entry to 
  5100. obtain attribute information.  If this value is set to null (''), the third 
  5101. parameter is used to locate the entry. 
  5102.  
  5103. The third parameter is the name of the entry to obtain attribute information. 
  5104. This paramter is used if the Entry Reference number (parameter two) is null. 
  5105.  
  5106. The fourth parameter is a stem variable name that contains the number of 
  5107. attributes to retrieve at the root, and a Selector and Buffer entry for each 
  5108. attribute.  The Selector entry contains the selector to retrieve, and the 
  5109. Buffer entry contains the name of the variable to return the values. 
  5110.  
  5111. An example of a properly formated attribute description buffer is shown below: 
  5112.  
  5113.       attrDesc.0 = 2
  5114.       attrDesc.1.Selector = 'VIMSEL_NAME'
  5115.       attrDesc.1.Buffer   = 'Name'
  5116.       attrDesc.2.Selector = 'VIMSEL_COMMENTS'
  5117.       attrDesc.2.Buffer   = 'Comments'
  5118.  
  5119. attrDesc.0 = 1
  5120. attrDesc.1.Selector = 'VIMSEL_NAME'
  5121. attrDesc.1.Buffer   = 'Name'
  5122.  
  5123.  
  5124. call RxVIMGetABEntryAttributes AddrBkPtr,EntryRef,'','attrDesc'
  5125.  
  5126. or
  5127.  
  5128. rc = RxVIMGetABEntryAttributes( AddrBkPtr,EntryRef,'','attrDesc' )
  5129.  
  5130. Listed below are the valid selectors to use to request specific attributes to 
  5131. be returned for each entry: 
  5132.  
  5133. VIMSEL_NAME                     Retrieves the full name of the entry
  5134.  
  5135. VIMSEL_ADDRESS                  Retrieves the address of the entry
  5136.  
  5137. VIMSEL_COMMENTS                 Retrieves the comments for this entry
  5138.  
  5139. VIMSEL_TYPE                     Retrieves the message type
  5140.  
  5141.                                    VIMSEL_ENTITY   -  Individual entry
  5142.                                    VIMSEL_GROUP    -  collection of entries
  5143.                                    VIMSEL_SUBTREE  -  subtree entry
  5144.  
  5145.  
  5146. VIMSEL_LOCATION                 Retrieves location using one of these selectors
  5147.  
  5148.                                    VIMSEL_LOCAL   - Add to the local postoffice (default)
  5149.  
  5150.                                    VIMSEL_DIALIN  - Will access the local postoffice
  5151.                                                     using dialin only
  5152.  
  5153.                                    VIMSEL_REMOTE  - User local on another postoffice
  5154.  
  5155.                                    VIMSEL_ALIAS   - Entry is an alias for another
  5156.                                                     local entry
  5157.  
  5158.                                    VIMSEL_DIRECT_POSTOFFICE  - Entry is a postoffice that
  5159.                                                                will directly connect
  5160.  
  5161.                                    VIMSEL_INDIRECT_POSTOFFICE- Entry is a postoffice that
  5162.                                                                will not direct connect
  5163.  
  5164. VIMSEL_FAN                      Returns foreign alias name, which is used
  5165.                                 in gateway applications
  5166.  
  5167. The function will return the requested attribute values in the specified buffer 
  5168. variable directly with the following format: 
  5169.  
  5170.          'Name' specified to receive address book entry name
  5171.  
  5172.          Name  = 'Name of the address book entry'
  5173.  
  5174.  
  5175. ΓòÉΓòÉΓòÉ 11.8.2. Return Codes ΓòÉΓòÉΓòÉ
  5176.  
  5177. The RxVIMGetABEntryAttributes function returns the following values: 
  5178.  
  5179.         0 - Successful return
  5180.  
  5181. The return values from all of the function calls return a zero for success, and 
  5182. non-zero for failure.  To retrieve the actual failure reason, use the 
  5183. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  5184. value to the actual failure text.  Using RxVIMStatus, the following values may 
  5185. be returned by RxVIMGetABEntryAttributes: 
  5186.  
  5187.         VIMSTS_SUCCESS                  Successful return
  5188.         VIMSTS_FAILURE                  Function Failed
  5189.  
  5190.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  5191.         VIMSTS_INVALID_OBJECT           The address book handle is bad
  5192.         VIMSTS_INVALID_SELECTOR         One of the request selectors is bad
  5193.         VIMSTS_NOT_SUPPORTED            Attribute not supported
  5194.  
  5195.  
  5196. ΓòÉΓòÉΓòÉ 11.8.3. Example ΓòÉΓòÉΓòÉ
  5197.  
  5198. /* Example of using RxVIMGetABEntryAttributes */
  5199.  
  5200. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  5201. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  5202. call RxVIMLoadFuncs
  5203.  
  5204.  
  5205. /* This will establish a connection to the VIM system */
  5206. rc = RxVIMInitialize()
  5207.  
  5208. /* Obtain the default session information */
  5209. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  5210.  
  5211. Say 'Default path:' db_path
  5212. Say 'Default name:' user_name
  5213.  
  5214. /* Opening a session with the mail subsystem */
  5215. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  5216.  
  5217.  
  5218. /* Retrieve the name of the first address book */
  5219. pos = ''                                  /* Start at beginning */
  5220. skipcnt = 1                               /* Start at beginning */
  5221. mcount  = 1                               /* Return one entry   */
  5222. more = ''                                 /* more entires?      */
  5223.  
  5224. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5225. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  5226. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  5227.  
  5228. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  5229.  
  5230. /* Open the first addressbook */
  5231. rc = RxVIMOpenAddressBook(Sess, name.1, 'AddrBkPtr')
  5232.  
  5233. /* Retrieve the name of the first address book entry */
  5234. pos = ''                                  /* Start at beginning */
  5235. skipcnt = 1                               /* Start at beginning */
  5236. mcount  = 1                               /* Return one entry   */
  5237. more = ''                                 /* more entires?      */
  5238. filter = 'VIMSEL_NO_FILTER'
  5239. fdata  = ''
  5240.  
  5241. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5242. attrDesc.1.Selector = 'VIMSEL_REF'        /* reference number         */
  5243. attrDesc.1.Buffer   = 'RefNo'             /* buffer to return RefNo   */
  5244.  
  5245. rc = RxVIMEnumerateAddressBookEntries(AddrBkPtr,'pos',skipcnt,'attrDesc','mcount',filter,fdata,'more')
  5246.  
  5247.  
  5248.  
  5249. /* Get the comment for the first address book entry */
  5250. ItemBuf.0 = 1
  5251. ItemBuf.1.Selector = 'VIMSEL_COMMENTS'
  5252. ItemBuf.1.Buffer   = 'comments'
  5253.  
  5254. rc = RxVIMGetABEntryAttributes(AddrBkPtr,RefNo.1,'','ItemBuf')
  5255.  
  5256. Say 'The comment for the first entry is' comments
  5257.  
  5258.  
  5259.  
  5260. /* Close the session with the mail subsystem */
  5261. rc = RxVIMCloseSession( Sess )
  5262.  
  5263. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  5264. call RxVIMDropFuncs
  5265.  
  5266.  
  5267. ΓòÉΓòÉΓòÉ 11.9. RxVIMSetABEntryAttributes ΓòÉΓòÉΓòÉ
  5268.  
  5269. The RxVIMSetABEntryAttributes function changes one or more attributes of the 
  5270. specified address book entry. 
  5271.  
  5272.  
  5273. ΓòÉΓòÉΓòÉ 11.9.1. Syntax ΓòÉΓòÉΓòÉ
  5274.  
  5275. RxVIMSetABEntryAttributes is called with four parameters. The first parameter 
  5276. is a variable that contains the pointer to the current address book. 
  5277.  
  5278. The second is a variable containing the reference number for the entry to 
  5279. obtain attribute information.  If this value is set to null (''), the third 
  5280. parameter is used to locate the entry. 
  5281.  
  5282. The third parameter is the name of the entry to obtain attribute information. 
  5283. This paramter is used if the Entry Reference number (parameter two) is null. 
  5284.  
  5285. The fourth parameter is a stem variable name that contains the number of 
  5286. attributes to change at the root, and a Selector and Value entry for each 
  5287. attribute.  The Selector entry contains the selector to retrieve, and the Value 
  5288. entry contains the information to use for the change. 
  5289.  
  5290. An example of a properly formated attribute description buffer is shown below: 
  5291.  
  5292.       attrDesc.0 = 2
  5293.       attrDesc.1.Selector = 'VIMSEL_NAME'
  5294.       attrDesc.1.Value    = 'Mark Stevens'
  5295.       attrDesc.2.Selector = 'VIMSEL_COMMENTS'
  5296.       attrDesc.2.Value    = 'This entry was changed using RexxVIM'
  5297.  
  5298. attrDesc.0 = 1
  5299. attrDesc.1.Selector = 'VIMSEL_NAME'
  5300. attrDesc.1.Value    = 'Mark Stevens'
  5301.  
  5302.  
  5303. call RxVIMSetABEntryAttributes AddrBkPtr,EntryRef,'','attrDesc'
  5304.  
  5305. or
  5306.  
  5307. rc = RxVIMSetABEntryAttributes( AddrBkPtr,EntryRef,'','attrDesc' )
  5308.  
  5309. Listed below are the valid selectors to use to request specific attributes to 
  5310. be changed for the entry: 
  5311.  
  5312. VIMSEL_NAME                     Changes the full name of the entry
  5313.  
  5314. VIMSEL_ADDRESS                  Changes the address of the entry
  5315.  
  5316. VIMSEL_COMMENTS                 Changes the comments for this entry
  5317.  
  5318. VIMSEL_COMMENTS                 Changes the password for this entry
  5319.  
  5320. VIMSEL_LOCATION                 Changes location using one of these selectors
  5321.  
  5322.                                    VIMSEL_LOCAL   - Add to the local postoffice (default)
  5323.  
  5324.                                    VIMSEL_DIALIN  - Will access the local postoffice
  5325.                                                     using dialin only
  5326.  
  5327.                                    VIMSEL_REMOTE  - User local on another postoffice
  5328.  
  5329.                                    VIMSEL_ALIAS   - Entry is an alias for another
  5330.                                                     local entry
  5331.  
  5332.                                    VIMSEL_DIRECT_POSTOFFICE  - Entry is a postoffice that
  5333.                                                                will directly connect
  5334.  
  5335.                                    VIMSEL_INDIRECT_POSTOFFICE- Entry is a postoffice that
  5336.                                                                will not direct connect
  5337.  
  5338. VIMSEL_FAN                      Changes foreign alias name, which is used
  5339.                                 in gateway applications
  5340.  
  5341.  
  5342. ΓòÉΓòÉΓòÉ 11.9.2. Return Codes ΓòÉΓòÉΓòÉ
  5343.  
  5344. The RxVIMSetABEntryAttributes function returns the following values: 
  5345.  
  5346.         0 - Successful return
  5347.  
  5348. The return values from all of the function calls return a zero for success, and 
  5349. non-zero for failure.  To retrieve the actual failure reason, use the 
  5350. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  5351. value to the actual failure text.  Using RxVIMStatus, the following values may 
  5352. be returned by RxVIMSetABEntryAttributes: 
  5353.  
  5354.         VIMSTS_SUCCESS                  Successful return
  5355.         VIMSTS_FAILURE                  Function Failed
  5356.  
  5357.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  5358.         VIMSTS_INVALID_OBJECT           The address book handle is bad
  5359.         VIMSTS_INVALID_SELECTOR         One of the request selectors is bad
  5360.         VIMSTS_NOT_SUPPORTED            Attribute not supported
  5361.  
  5362.  
  5363. ΓòÉΓòÉΓòÉ 11.9.3. Example ΓòÉΓòÉΓòÉ
  5364.  
  5365. /* Example of using RxVIMSetABEntryAttributes */
  5366.  
  5367. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  5368. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  5369. call RxVIMLoadFuncs
  5370.  
  5371.  
  5372. /* This will establish a connection to the VIM system */
  5373. rc = RxVIMInitialize()
  5374.  
  5375. /* Obtain the default session information */
  5376. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  5377.  
  5378. Say 'Default path:' db_path
  5379. Say 'Default name:' user_name
  5380.  
  5381. /* Opening a session with the mail subsystem */
  5382. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  5383.  
  5384.  
  5385. /* Retrieve the name of the first address book */
  5386. pos = ''                                  /* Start at beginning */
  5387. skipcnt = 1                               /* Start at beginning */
  5388. mcount  = 1                               /* Return one entry   */
  5389. more = ''                                 /* more entires?      */
  5390.  
  5391. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5392. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  5393. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  5394.  
  5395. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  5396.  
  5397. /* Open the first addressbook */
  5398. rc = RxVIMOpenAddressBook(Sess, name.1, 'AddrBkPtr')
  5399.  
  5400. /* Retrieve the name of the first address book entry */
  5401. pos = ''                                  /* Start at beginning */
  5402. skipcnt = 1                               /* Start at beginning */
  5403. mcount  = 1                               /* Return one entry   */
  5404. more = ''                                 /* more entires?      */
  5405. filter = 'VIMSEL_NO_FILTER'
  5406. fdata  = ''
  5407.  
  5408. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5409. attrDesc.1.Selector = 'VIMSEL_REF'        /* reference number         */
  5410. attrDesc.1.Buffer   = 'RefNo'             /* buffer to return RefNo   */
  5411.  
  5412. rc = RxVIMEnumerateAddressBookEntries(AddrBkPtr,'pos',skipcnt,'attrDesc','mcount',filter,fdata,'more')
  5413.  
  5414.  
  5415.  
  5416. /* Get the comment for the first address book entry */
  5417. ItemBuf.0 = 1
  5418. ItemBuf.1.Selector = 'VIMSEL_COMMENTS'
  5419. ItemBuf.1.Value    = 'This entry was updated using RexxVIM'
  5420.  
  5421. rc = RxVIMGetABEntryAttributes(AddrBkPtr,RefNo.1,'','ItemBuf')
  5422.  
  5423.  
  5424.  
  5425. /* Close the session with the mail subsystem */
  5426. rc = RxVIMCloseSession( Sess )
  5427.  
  5428. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  5429. call RxVIMDropFuncs
  5430.  
  5431.  
  5432. ΓòÉΓòÉΓòÉ 11.10. RxVIMRemoveAddressBookEntry ΓòÉΓòÉΓòÉ
  5433.  
  5434. The RxVIMRemoveAddressBookEntry function deletes an address book entry from the 
  5435. specified address book. 
  5436.  
  5437.  
  5438. ΓòÉΓòÉΓòÉ 11.10.1. Syntax ΓòÉΓòÉΓòÉ
  5439.  
  5440. RxVIMRemoveAddressBookEntry is called with three parameters. The first 
  5441. parameter is a variable that contains the pointer to the current address book. 
  5442.  
  5443. The second is a variable containing the reference number for the entry to 
  5444. delete. If this value is set to null (''), the third parameter is used to 
  5445. locate the entry to delete. 
  5446.  
  5447. The third parameter is the name of the entry to delete. This paramter is used 
  5448. if the Entry Reference number (parameter two) is null. 
  5449.  
  5450. call RxVIMRemoveAddressBookEntry AddrBkPtr,EntryRef,''
  5451.  
  5452. or
  5453.  
  5454. rc = RxVIMRemoveAddressBookEntry( AddrBkPtr,EntryRef,'' )
  5455.  
  5456.  
  5457. ΓòÉΓòÉΓòÉ 11.10.2. Return Codes ΓòÉΓòÉΓòÉ
  5458.  
  5459. The RxVIMRemoveAddressBookEntry function returns the following values: 
  5460.  
  5461.         0 - Successful return
  5462.  
  5463. The return values from all of the function calls return a zero for success, and 
  5464. non-zero for failure.  To retrieve the actual failure reason, use the 
  5465. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  5466. value to the actual failure text.  Using RxVIMStatus, the following values may 
  5467. be returned by RxVIMRemoveAddressBookEntry: 
  5468.  
  5469.         VIMSTS_SUCCESS                  Successful return
  5470.         VIMSTS_FAILURE                  Function Failed
  5471.  
  5472.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  5473.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  5474.         VIMSTS_INVALID_OBJECT           The address book handle is bad
  5475.         VIMSTS_WRITE_FAILURE            Error writing to disk
  5476.  
  5477.  
  5478. ΓòÉΓòÉΓòÉ 11.10.3. Example ΓòÉΓòÉΓòÉ
  5479.  
  5480. /* Example of using RxVIMRemoveAddressBookEntry */
  5481.  
  5482. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  5483. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  5484. call RxVIMLoadFuncs
  5485.  
  5486.  
  5487. /* This will establish a connection to the VIM system */
  5488. rc = RxVIMInitialize()
  5489.  
  5490. /* Obtain the default session information */
  5491. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  5492.  
  5493. Say 'Default path:' db_path
  5494. Say 'Default name:' user_name
  5495.  
  5496. /* Opening a session with the mail subsystem */
  5497. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  5498.  
  5499.  
  5500. /* Retrieve the name of the first address book */
  5501. pos = ''                                  /* Start at beginning */
  5502. skipcnt = 1                               /* Start at beginning */
  5503. mcount  = 1                               /* Return one entry   */
  5504. more = ''                                 /* more entires?      */
  5505.  
  5506. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5507. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  5508. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  5509.  
  5510. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  5511.  
  5512. /* Open the first addressbook */
  5513. rc = RxVIMOpenAddressBook(Sess, name.1, 'AddrBkPtr')
  5514.  
  5515. /* Retrieve the name of the first address book entry */
  5516. pos = ''                                  /* Start at beginning */
  5517. skipcnt = 1                               /* Start at beginning */
  5518. mcount  = 1                               /* Return one entry   */
  5519. more = ''                                 /* more entires?      */
  5520. filter = 'VIMSEL_NO_FILTER'
  5521. fdata  = ''
  5522.  
  5523. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5524. attrDesc.1.Selector = 'VIMSEL_REF'        /* reference number         */
  5525. attrDesc.1.Buffer   = 'RefNo'             /* buffer to return RefNo   */
  5526.  
  5527. rc = RxVIMEnumerateAddressBookEntries(AddrBkPtr,'pos',skipcnt,'attrDesc','mcount',filter,fdata,'more')
  5528.  
  5529.  
  5530.  
  5531. /* Delete the first entry from the first address book */
  5532. rc = RxVIMRemoveAddressBookEntry(AddrBkPtr,RefNo.1,'')
  5533.  
  5534.  
  5535.  
  5536. /* Close the session with the mail subsystem */
  5537. rc = RxVIMCloseSession( Sess )
  5538.  
  5539. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  5540. call RxVIMDropFuncs
  5541.  
  5542.  
  5543. ΓòÉΓòÉΓòÉ 11.11. RxVIMAddGroupMember ΓòÉΓòÉΓòÉ
  5544.  
  5545. The RxVIMAddGroupMember function adds a new entry to an existing group list. 
  5546. The group must have already been created, using the RxVIMCreateAddressBookEntry 
  5547. prior to adding entries. 
  5548.  
  5549.  
  5550. ΓòÉΓòÉΓòÉ 11.11.1. Syntax ΓòÉΓòÉΓòÉ
  5551.  
  5552. RxVIMAddGroupMember is called with four parameters. The first parameter is a 
  5553. variable that contains the pointer to the current address book. 
  5554.  
  5555. The second is a variable containing the reference number for the group entry to 
  5556. add the new entry.  If this value is set to null (''), the third parameter is 
  5557. used to locate the entry. 
  5558.  
  5559. The third parameter is the name of the group entry to add the new entry. This 
  5560. paramter is used if the Entry Reference number (parameter two) is null. 
  5561.  
  5562. The fourth parameter is a the name to add to the group.  This name must be an 
  5563. existing entry in the address book. 
  5564.  
  5565. call RxVIMAddGroupMember AddrBkPtr,EntryRef,'','Mark Stevens'
  5566.  
  5567. or
  5568.  
  5569. rc = RxVIMAddGroupMember( AddrBkPtr,EntryRef,'','Mark Stevens' )
  5570.  
  5571.  
  5572. ΓòÉΓòÉΓòÉ 11.11.2. Return Codes ΓòÉΓòÉΓòÉ
  5573.  
  5574. The RxVIMAddGroupMember function returns the following values: 
  5575.  
  5576.         0 - Successful return
  5577.  
  5578. The return values from all of the function calls return a zero for success, and 
  5579. non-zero for failure.  To retrieve the actual failure reason, use the 
  5580. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  5581. value to the actual failure text.  Using RxVIMStatus, the following values may 
  5582. be returned by RxVIMAddGroupMember: 
  5583.  
  5584.         VIMSTS_SUCCESS                  Successful return
  5585.         VIMSTS_FAILURE                  Function Failed
  5586.  
  5587.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  5588.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  5589.         VIMSTS_INVALID_OBJECT           The address book handle is bad
  5590.         VIMSTS_WRITE_FAILURE            Error writing to the disk
  5591.  
  5592.  
  5593. ΓòÉΓòÉΓòÉ 11.11.3. Example ΓòÉΓòÉΓòÉ
  5594.  
  5595. /* Example of using RxVIMAddGroupMember */
  5596.  
  5597. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  5598. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  5599. call RxVIMLoadFuncs
  5600.  
  5601.  
  5602. /* This will establish a connection to the VIM system */
  5603. rc = RxVIMInitialize()
  5604.  
  5605. /* Obtain the default session information */
  5606. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  5607.  
  5608. Say 'Default path:' db_path
  5609. Say 'Default name:' user_name
  5610.  
  5611. /* Opening a session with the mail subsystem */
  5612. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  5613.  
  5614.  
  5615. /* Retrieve the name of the first address book */
  5616. pos = ''                                  /* Start at beginning */
  5617. skipcnt = 1                               /* Start at beginning */
  5618. mcount  = 1                               /* Return one entry   */
  5619. more = ''                                 /* more entires?      */
  5620.  
  5621. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5622. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  5623. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  5624.  
  5625. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  5626.  
  5627. /* Open the first addressbook */
  5628. rc = RxVIMOpenAddressBook(Sess, name.1, 'AddrBkPtr')
  5629.  
  5630. /* Retrieve the name of the first group entry in the address book */
  5631. pos = ''                                  /* Start at beginning */
  5632. skipcnt = 1                               /* Start at beginning */
  5633. mcount  = 1                               /* Return one entry   */
  5634. more = ''                                 /* more entires?      */
  5635. filter = 'VIMSEL_GROUP'                   /* return only group entries */
  5636. fdata  = ''
  5637.  
  5638. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5639. attrDesc.1.Selector = 'VIMSEL_REF'        /* reference number         */
  5640. attrDesc.1.Buffer   = 'RefNo'             /* buffer to return RefNo   */
  5641.  
  5642. rc = RxVIMEnumerateAddressBookEntries(AddrBkPtr,'pos',skipcnt,'attrDesc','mcount',filter,fdata,'more')
  5643.  
  5644.  
  5645.  
  5646. /* Add a new member to the first group in the address book */
  5647. rc = RxVIMAddGroupMember(AddrBkPtr,RefNo.1,'','Mark Stevens')
  5648.  
  5649.  
  5650.  
  5651. /* Close the session with the mail subsystem */
  5652. rc = RxVIMCloseSession( Sess )
  5653.  
  5654. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  5655. call RxVIMDropFuncs
  5656.  
  5657.  
  5658. ΓòÉΓòÉΓòÉ 11.12. RxVIMRemoveGroupMember ΓòÉΓòÉΓòÉ
  5659.  
  5660. The RxVIMRemoveGroupMember function deletes an  entry from an existing group 
  5661. list. 
  5662.  
  5663.  
  5664. ΓòÉΓòÉΓòÉ 11.12.1. Syntax ΓòÉΓòÉΓòÉ
  5665.  
  5666. RxVIMRemoveGroupMember is called with four parameters. The first parameter is a 
  5667. variable that contains the pointer to the current address book. 
  5668.  
  5669. The second is a variable containing the reference number for the group entry to 
  5670. delete an entry.  If this value is set to null (''), the third parameter is 
  5671. used to locate the entry. 
  5672.  
  5673. The third parameter is the name of the group entry to delete the entry. This 
  5674. paramter is used if the Entry Reference number (parameter two) is null. 
  5675.  
  5676. The fourth parameter is a the name to delete from the group. 
  5677.  
  5678. call RxVIMRemoveGroupMember AddrBkPtr,EntryRef,'','Mark Stevens'
  5679.  
  5680. or
  5681.  
  5682. rc = RxVIMRemoveGroupMember( AddrBkPtr,EntryRef,'','Mark Stevens' )
  5683.  
  5684.  
  5685. ΓòÉΓòÉΓòÉ 11.12.2. Return Codes ΓòÉΓòÉΓòÉ
  5686.  
  5687. The RxVIMRemoveGroupMember function returns the following values: 
  5688.  
  5689.         0 - Successful return
  5690.  
  5691. The return values from all of the function calls return a zero for success, and 
  5692. non-zero for failure.  To retrieve the actual failure reason, use the 
  5693. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  5694. value to the actual failure text.  Using RxVIMStatus, the following values may 
  5695. be returned by RxVIMRemoveGroupMember: 
  5696.  
  5697.         VIMSTS_SUCCESS                  Successful return
  5698.         VIMSTS_FAILURE                  Function Failed
  5699.  
  5700.         VIMSTS_BAD_PARAM                Bad parameter passed to function
  5701.         VIMSTS_INSUFFICIENT_MEMORY      Not enough memory
  5702.         VIMSTS_INVALID_OBJECT           The address book handle is bad
  5703.         VIMSTS_WRITE_FAILURE            Error writing to the disk
  5704.  
  5705.  
  5706. ΓòÉΓòÉΓòÉ 11.12.3. Example ΓòÉΓòÉΓòÉ
  5707.  
  5708. /* Example of using RxVIMRemoveGroupMember */
  5709.  
  5710. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  5711. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  5712. call RxVIMLoadFuncs
  5713.  
  5714.  
  5715. /* This will establish a connection to the VIM system */
  5716. rc = RxVIMInitialize()
  5717.  
  5718. /* Obtain the default session information */
  5719. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  5720.  
  5721. Say 'Default path:' db_path
  5722. Say 'Default name:' user_name
  5723.  
  5724. /* Opening a session with the mail subsystem */
  5725. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  5726.  
  5727.  
  5728. /* Retrieve the name of the first address book */
  5729. pos = ''                                  /* Start at beginning */
  5730. skipcnt = 1                               /* Start at beginning */
  5731. mcount  = 1                               /* Return one entry   */
  5732. more = ''                                 /* more entires?      */
  5733.  
  5734. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5735. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  5736. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  5737.  
  5738. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  5739.  
  5740. /* Open the first addressbook */
  5741. rc = RxVIMOpenAddressBook(Sess, name.1, 'AddrBkPtr')
  5742.  
  5743. /* Retrieve the name of the first group entry in the address book */
  5744. pos = ''                                  /* Start at beginning */
  5745. skipcnt = 1                               /* Start at beginning */
  5746. mcount  = 1                               /* Return one entry   */
  5747. more = ''                                 /* more entires?      */
  5748. filter = 'VIMSEL_GROUP'                   /* return only group entries */
  5749. fdata  = ''
  5750.  
  5751. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5752. attrDesc.1.Selector = 'VIMSEL_REF'        /* reference number         */
  5753. attrDesc.1.Buffer   = 'RefNo'             /* buffer to return RefNo   */
  5754.  
  5755. rc = RxVIMEnumerateAddressBookEntries(AddrBkPtr,'pos',skipcnt,'attrDesc','mcount',filter,fdata,'more')
  5756.  
  5757.  
  5758.  
  5759. /* Delete an entry from the first group in the address book */
  5760. rc = RxVIMRemoveGroupMember(AddrBkPtr,RefNo.1,'','Mark Stevens')
  5761.  
  5762.  
  5763.  
  5764. /* Close the session with the mail subsystem */
  5765. rc = RxVIMCloseSession( Sess )
  5766.  
  5767. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  5768. call RxVIMDropFuncs
  5769.  
  5770.  
  5771. ΓòÉΓòÉΓòÉ 11.13. RxVIMCloseAddressBook ΓòÉΓòÉΓòÉ
  5772.  
  5773. The RxVIMCloseAddressBook function closes the session with the specified 
  5774. address book and frees any resources. 
  5775.  
  5776.  
  5777. ΓòÉΓòÉΓòÉ 11.13.1. Syntax ΓòÉΓòÉΓòÉ
  5778.  
  5779. RxVIMCloseAddressBook is called with one parameter. The parameter is the 
  5780. variable containing the pointer to the address book to close. 
  5781.  
  5782. call RxVIMCloseAddressBook AddrBkPtr
  5783.  
  5784. or
  5785.  
  5786. rc = RxVIMCloseAddressBook( AddrBkPtr )
  5787.  
  5788.  
  5789. ΓòÉΓòÉΓòÉ 11.13.2. Return Codes ΓòÉΓòÉΓòÉ
  5790.  
  5791. The RxVIMCloseAddressBook function returns the following values: 
  5792.  
  5793.         0 - Successful return
  5794.  
  5795. The return values from all of the function calls return a zero for success, and 
  5796. non-zero for failure.  To retrieve the actual failure reason, use the 
  5797. RxVIMStatus function.  The RxVIMStatus function converts the numeric return 
  5798. value to the actual failure text.  Using RxVIMStatus, the following values may 
  5799. be returned by RxVIMCloseAddressBook: 
  5800.  
  5801.         VIMSTS_SUCCESS                  Successful return
  5802.         VIMSTS_FAILURE                  Function Failed
  5803.  
  5804.         VIMSTS_INVALID_OBJECT           The address book handle is bad
  5805.  
  5806.  
  5807. ΓòÉΓòÉΓòÉ 11.13.3. Example ΓòÉΓòÉΓòÉ
  5808.  
  5809. /* Example of using RxVIMCloseAddressBook */
  5810.  
  5811. /* The RxVIMLoadFuncs function loads all of the VIM extensions */
  5812. call RxFuncAdd 'RxVIMLoadFuncs', 'RexxVIM', 'RxVIMLoadFuncs'
  5813. call RxVIMLoadFuncs
  5814.  
  5815.  
  5816. /* This will establish a connection to the VIM system */
  5817. rc = RxVIMInitialize()
  5818.  
  5819. /* Obtain the default session information */
  5820. rc = RxVIMDefaultSessionInfo('db_path', 'user_name')
  5821.  
  5822. Say 'Default path:' db_path
  5823. Say 'Default name:' user_name
  5824.  
  5825. /* Opening a session with the mail subsystem */
  5826. rc = RxVIMOpenSession(db_path, user_name, 'SNOOPY', 'Sess')
  5827.  
  5828. /* Retrieve the name of the first address book */
  5829. pos = ''                                  /* Start at beginning */
  5830. skipcnt = 1                               /* Start at beginning */
  5831. mcount  = 1                               /* Return one entry   */
  5832. more = ''                                 /* more entires?      */
  5833.  
  5834. attrDesc.0 = 1                            /* retrieve 1 attribute     */
  5835. attrDesc.1.Selector = 'VIMSEL_NAME'       /* name of address book     */
  5836. attrDesc.1.Buffer   = 'name'              /* buffer to return name    */
  5837.  
  5838. rc = RxVIMEnumerateAddressBooks(Sess,'pos',skipcnt,'attrDesc','mcount','more')
  5839.  
  5840. /* Open the first address book found */
  5841. rc = RxVIMOpenAddressBook(Sess,name.1,'AddrBkPtr')
  5842.  
  5843.  
  5844.  
  5845. /* Close the address book */
  5846. rc = RxVIMCloseAddressBook( AddrBkPtr )
  5847.  
  5848.  
  5849.  
  5850. /* Close the session with the mail subsystem */
  5851. rc = RxVIMCloseSession( Sess )
  5852.  
  5853. /* The RxVIMDropFuncs function unloads all of the VIM extensions */
  5854. call RxVIMDropFuncs
  5855.  
  5856.  
  5857. ΓòÉΓòÉΓòÉ 12. RexxVIM Examples ΓòÉΓòÉΓòÉ
  5858.  
  5859. Several examples are shown for using the many functions of RexxVIM in actual 
  5860. Rexx programs. 
  5861.  
  5862.  
  5863. ΓòÉΓòÉΓòÉ 12.1. General Demo ΓòÉΓòÉΓòÉ
  5864.  
  5865.  The general demo (DEMO.CMD) shows the proper loading of the RexxVIM functions, 
  5866. connection to the VIM subsystem, querying session capabilities, opening a VIM 
  5867. session, and querying the active session.  The example also shows the proper 
  5868. unloading and shutdown of the VIM connections and sessions. 
  5869.  
  5870.     Run DEMO.CMD 
  5871.  
  5872.  
  5873. ΓòÉΓòÉΓòÉ 12.1.1. DEMO.CMD Listing ΓòÉΓòÉΓòÉ
  5874.  
  5875. /** RexxDemo **/
  5876. /******************************************/
  5877. /*                                        */
  5878. /* Command line syntax:                   */
  5879. /*                                        */
  5880. /* demo db_path user_password user_name   */
  5881. /*                                        */
  5882. /*                                        */
  5883. /******************************************/
  5884. ARG db_path user_pw user_name
  5885. '@echo off'
  5886. '@cls'
  5887. Say 'RexxVIM General Demonstration Program'
  5888. Say
  5889.  
  5890. /* unload functions upon error */
  5891. SIGNAL ON ERROR NAME done
  5892.  
  5893. /* Prompt for the parameters if not passed on the */
  5894. /* command line                                   */
  5895. if LENGTH(STRIP(db_path)) = 0 then do
  5896.    Say 'Enter Postoffice Directory -'
  5897.    PARSE PULL db_path .
  5898.    Say
  5899.    Say 'Enter User Name -'
  5900.    PARSE PULL user_name
  5901.    Say 'Enter Password -'
  5902.    PARSE PULL user_pw
  5903. end  /* Do */
  5904.  
  5905.  
  5906. /* Load the RexxVIM extensions to Rexx */
  5907. rc = RxFuncAdd('RxVIMLoadFuncs', 'REXXVIM', 'RxVIMLoadFuncs')
  5908. if rc <> 0 then do
  5909.    Say
  5910.    Say 'RexxVIM failed to load, return code' rc
  5911.    Say
  5912.    Say 'Functions have been released.  Retry program.'
  5913.    signal done
  5914. end  /* Do */
  5915. call RxVIMLoadFuncs
  5916. Say 'Functions are now loaded'
  5917. Say
  5918.  
  5919.  
  5920. /* Initialize the VIM subsystem */
  5921. rc = RxVIMInitialize()
  5922. Say
  5923. Say '|-Call To Routine ---------------RC--|'
  5924. Say '  RxVIMInitialize-              ' rc
  5925. if (rc > 0) then call vimerr
  5926.  
  5927.  
  5928. /* Retrieve the default session info if present */
  5929. rc = RxVIMGetDefaultSessionInfo('def_path', 'def_user')
  5930. Say '  RxVIMGetDefaultSessionInfo -  ' rc
  5931. if (rc > 0) then call vimerr
  5932. Say '      Default Path -' def_path
  5933. Say '      Default Name -' def_user
  5934. Say
  5935.  
  5936.  
  5937. /* Query the maximum subject line length and maximum */
  5938. /* text length                                       */
  5939. rc = RxVIMQueryCapability('VIMSEL_MAX_SUBJECT_LEN','Query')
  5940. Say '  RxVIMQueryCapability -        ' rc
  5941. if (rc > 0) then call vimerr
  5942. Say '      Max Subject Length -' query
  5943. rc = RxVIMQueryCapability('VIMSEL_MAX_TEXT_LEN','Query')
  5944. if (rc > 0) then call vimerr
  5945. Say '         Max Text Length -' query
  5946. Say
  5947.  
  5948.  
  5949. /* Open a session with the postoffice using the parameters */
  5950. /* provided by the user                                    */
  5951. rc = RxVIMOpenSession(db_path,user_name,user_pw,'Session')
  5952. Say '  RxVIMOpenSession -            ' rc
  5953. if (rc > 0) then call vimerr
  5954.  
  5955.  
  5956. /* Retieve the name and type of active session */
  5957. rc = RxVIMGetEntityName(Session,'Entity')
  5958. Say '  RxVIMGetEntityName            ' rc
  5959. if (rc > 0) then call vimerr
  5960. Say '      Type -' entity.Type
  5961. Say '      Name -' entity.Name
  5962. Say
  5963.  
  5964.  
  5965. /* Close the session with the postoffice */
  5966. rc = RxVIMCloseSession(Session)
  5967. Say '  RxVIMCloseSession -            ' rc
  5968. if (rc > 0) then call vimerr
  5969.  
  5970.  
  5971. /* Terminate the active VIM subsystem connection */
  5972. rc = RxVIMTerminate()
  5973. Say '  RxVIMTerminate -               ' rc
  5974. if (rc > 0) then call vimerr
  5975. signal done
  5976.  
  5977.  
  5978. /***** VIMErr *******/
  5979.  
  5980. /* If an error occurs, this function will return the text */
  5981. /* associated with the error.  Extended text may be       */
  5982. /* displayed if it exists for the specified error.        */
  5983.  
  5984. VIMERR:
  5985.  
  5986. rc = RxVIMStatusText(rc,'Status')
  5987. Say
  5988. Say '|-Error Information -----------------|'
  5989. Say '  Error Text -' status.1
  5990. Say
  5991. if LENGTH(STRIP(status.2)) > 0 then
  5992.    Say '  Ext Status -' status.2
  5993. rc = RxVIMTerminate()
  5994. signal done
  5995.  
  5996.  
  5997. /* The done section will unload the RexxVIM extensions */
  5998. /* and exit the program                                */
  5999. DONE:
  6000. /*** Drop all of the external functions ***/
  6001. call RxVIMDropFuncs
  6002. Say '|------------------------------------|'
  6003. Say 'Demo Complete.  All functions released'
  6004. 'pause'
  6005. exit
  6006.  
  6007.  
  6008. ΓòÉΓòÉΓòÉ 12.2. Query Capabilities Demo ΓòÉΓòÉΓòÉ
  6009.  
  6010.  The Query Capabilities demo (VIMCAP.CMD) shows the use of the 
  6011. RxVIMQueryCapability function to determine support in the underlying VIM 
  6012. subsystem.  This demo can be used to query all selectors by using the command 
  6013. word ALL, or will support a query of a single selector.  Launching the demo 
  6014. below will query all selectors. 
  6015.  
  6016.     Run VIMCAP.CMD 
  6017.  
  6018.  
  6019. ΓòÉΓòÉΓòÉ 12.2.1. VIMCAP.CMD Listing ΓòÉΓòÉΓòÉ
  6020.  
  6021. /** Rexx Program to Query VIM Capabilities **/
  6022.  
  6023. /* The program accepts either a selector to query or */
  6024. /* the command word ALL to query all selectors       */
  6025. ARG TYPE
  6026.  
  6027. '@echo off'
  6028. '@cls'
  6029.  
  6030. /* Unload functions upon error */
  6031. SIGNAL ON ERROR NAME done
  6032.  
  6033. if LENGTH(STRIP(type)) = 0 then do
  6034.    Say
  6035.    Say 'Incorrect Syntax!  Correct syntax is -'
  6036.    Say
  6037.    Say 'VIMCAP < Capability to query | ALL'
  6038.    Say
  6039.    Say 'VIMCAP ALL will query all VIM functions'
  6040.    Say
  6041.    return
  6042. end  /* Do */
  6043.  
  6044. TYPE = TRANSLATE(STRIP(TYPE))
  6045. if TYPE = 'ALL' then do
  6046.   call LoadVIMCap
  6047.   doall = TRUE
  6048. end  /* Do */
  6049. else
  6050.   doall = FALSE
  6051.  
  6052. call RxFuncAdd 'RxVIMLoadFuncs', 'REXXVIM', 'RxVIMLoadFuncs'
  6053. call RxVIMLoadFuncs
  6054. rc = RxVIMInitialize()
  6055. Say
  6056. Say '|-Capability----------------------Value------------------------------------|'
  6057.  
  6058. if doall = TRUE then do
  6059.    do count=1 to vimcap.0
  6060.       TYPE = TRANSLATE(STRIP(vimcap.count))
  6061.       rc = RxVIMQueryCapability(TYPE,'Query')
  6062.    if rc>0 then signal VIMERR
  6063.       Say ' 'LEFT(TYPE||'-',30)'  ' SUBSTR(Query.1,1,30)
  6064.    end /* do */
  6065. end  /* Do */
  6066. else do
  6067.    rc = RxVIMQueryCapability(TYPE,'Query')
  6068.    if rc>0 then signal VIMERR
  6069.    Say ' 'LEFT(TYPE||'-',30)'  ' SUBSTR(Query.1,1,30)
  6070.    Say
  6071. end  /* Do */
  6072.  
  6073. rc = RxVIMTerminate()
  6074. /*** Drop all of the external functions ***/
  6075. call RxVIMDropFuncs
  6076. Say '|--------------------------------------------------------------------------|'
  6077. Say 'Demo Complete.  All functions released'
  6078. 'pause'
  6079. exit
  6080.  
  6081. /***** VIMErr *******/
  6082. VIMERR:
  6083.  
  6084. rc = RxVIMStatusText(rc,'Status')
  6085. Say
  6086. Say '|-Error Information -----------------|'
  6087. Say '  Error Text -' status.1
  6088. Say
  6089. if LENGTH(STRIP(status.2)) > 0 then
  6090.    Say '  Ext Status -' status.2
  6091. rc = RxVIMTerminate()
  6092.  
  6093. DONE:
  6094. /*** Drop all of the external functions ***/
  6095. call RxVIMDropFuncs
  6096. Say '|------------------------------------|'
  6097. Say 'Demo Complete.  All functions released'
  6098. 'pause'
  6099. exit
  6100.  
  6101. /****** Load all VIM Capabilities into stem variable *****/
  6102. LOADVIMCAP:
  6103.  
  6104. vimcap.0    =  32
  6105. vimcap.1    =  "VIMSEL_VERSION"
  6106. vimcap.2    =  "VIMSEL_IMPLEMENTATION"
  6107. vimcap.3    =  "VIMSEL_IMPLEMENTATION_VERSION"
  6108. vimcap.4    =  "VIMSEL_PRODUCT"
  6109. vimcap.5    =  "VIMSEL_MAX_SUBJECT_LEN"
  6110. vimcap.6    =  "VIMSEL_MAX_TYPE_LEN"
  6111. vimcap.7    =  "VIMSEL_MAX_TEXT_LEN"
  6112. vimcap.8    =  "VIMSEL_RTF"
  6113. vimcap.9    =  "VIMSEL_FAX"
  6114. vimcap.10   =  "VIMSEL_STYLED"
  6115. vimcap.11   =  "VIMSEL_PICT"
  6116. vimcap.12   =  "VIMSEL_MOVIE"
  6117. vimcap.13   =  "VIMSEL_IMAG"
  6118. vimcap.14   =  "VIMSEL_UNWRAPPED_TEXT"
  6119. vimcap.15   =  "VIMSEL_ALL_NOTE_PARTS_SUPP"
  6120. vimcap.16   =  "VIMSEL_ATTACH_TYPE_SUPP"
  6121. vimcap.17   =  "VIMSEL_ATTACH_DIRS"
  6122. vimcap.18   =  "VIMSEL_ENCRYPT"
  6123. vimcap.19   =  "VIMSEL_ENCRYPT_WITH_KEY"
  6124. vimcap.20   =  "VIMSEL_SIGN"
  6125. vimcap.21   =  "VIMSEL_NSTD_DERIVED_REPLIES"
  6126. vimcap.22   =  "VIMSEL_NSTD_DERIVED_FORWRDS"
  6127. vimcap.23   =  "VIMSEL_CP850"
  6128. vimcap.24   =  "VIMSEL_CP1252"
  6129. vimcap.25   =  "VIMSEL_CP437"
  6130. vimcap.26   =  "VIMSEL_LMBCS"
  6131. vimcap.27   =  "VIMSEL_ISTRING"
  6132. vimcap.28   =  "VIMSEL_UNICODE"
  6133. vimcap.29   =  "VIMSEL_APPLESINGLE"
  6134. vimcap.30   =  "VIMSEL_PATH_REQUIRED"
  6135. vimcap.31   =  "VIMSEL_NAME_REQUIRED"
  6136. vimcap.32   =  "VIMSEL_PASS_REQUIRED"
  6137. return
  6138.  
  6139.  
  6140. ΓòÉΓòÉΓòÉ 12.3. Send Message Demo ΓòÉΓòÉΓòÉ
  6141.  
  6142.  The Send Message (MESSAGE.CMD) demo shows how RexxVIM can be used to create 
  6143. and send messages.  Launching the demo below will send a message back to the 
  6144. person that is logged into the postoffice.  The message will contain a text 
  6145. portion, and a file attachment. 
  6146.  
  6147.     Run MESSAGE.CMD 
  6148.  
  6149.  
  6150. ΓòÉΓòÉΓòÉ 12.3.1. MESSAGE.CMD Listing ΓòÉΓòÉΓòÉ
  6151.  
  6152. /** Message.cmd **/
  6153. /*********************************************/
  6154. /*                                           */
  6155. /* Command line syntax:                      */
  6156. /*                                           */
  6157. /* message db_path user_password user_name   */
  6158. /*                                           */
  6159. /*                                           */
  6160. /*********************************************/
  6161. ARG db_path user_pw user_name
  6162. '@echo off'
  6163. '@cls'
  6164. Say 'RexxVIM Message Demonstration Program'
  6165. Say
  6166.  
  6167. /* Unload functions upon error */
  6168. SIGNAL ON ERROR NAME done
  6169.  
  6170. /* Prompt for the parameters if not passed on the */
  6171. /* command line                                   */
  6172. if LENGTH(STRIP(db_path)) = 0 then do
  6173.    Say 'Enter Postoffice Directory -'
  6174.    PARSE PULL db_path .
  6175.    Say
  6176.    Say 'Enter User Name -'
  6177.    PARSE PULL user_name
  6178.    Say 'Enter Password -'
  6179.    PARSE PULL user_pw
  6180. end  /* Do */
  6181.  
  6182.  
  6183. /* Load the RexxVIM extensions to Rexx */
  6184. rc = RxFuncAdd('RxVIMLoadFuncs', 'REXXVIM', 'RxVIMLoadFuncs')
  6185. if rc <> 0 then do
  6186.    Say
  6187.    Say 'RexxVIM failed to load, return code' rc
  6188.    Say
  6189.    Say 'Functions have been released.  Retry program.'
  6190.    signal done
  6191. end  /* Do */
  6192. call RxVIMLoadFuncs
  6193. Say 'Functions are now loaded'
  6194. Say
  6195.  
  6196.  
  6197. /* Initialize the VIM subsystem */
  6198. rc = RxVIMInitialize()
  6199. Say
  6200. Say '|-Call To Routine ---------------RC--|'
  6201. Say '  RxVIMInitialize -              ' rc
  6202. if (rc > 0) then call vimerr
  6203.  
  6204.  
  6205.  
  6206. /* Open a session with the postoffice using the parameters */
  6207. /* provided by the user                                    */
  6208. rc = RxVIMOpenSession(db_path,user_name,user_pw,'Session')
  6209. Say '  RxVIMOpenSession -             ' rc
  6210. if (rc > 0) then call vimerr
  6211.  
  6212.  
  6213. /* Create a new message of type VIM_MAIL */
  6214. rc = RxVIMCreateMessage(Session,'VIM_MAIL','Message')
  6215. Say '  RxVIMCreateMessage -           ' rc
  6216. if (rc > 0) then call vimerr
  6217.  
  6218.  
  6219. /* Set the header text */
  6220. hdrtext = user_name"'s config.sys file"
  6221. rc = RxVIMSetMessageHeader(Message,'VIMSEL_SUBJECT', hdrtext)
  6222. Say '  RxVIMSetMessageHeader -        ' rc
  6223. if (rc > 0) then call vimerr
  6224.  
  6225.  
  6226. /* Set the priority to high */
  6227. rc = RxVIMSetMessageHeader(Message,'VIMSEL_PRIORITY', 'VIM_HIGH_PRIORITY')
  6228. Say '  RxVIMSetMessageHeader -        ' rc
  6229. if (rc > 0) then call vimerr
  6230.  
  6231.  
  6232. /* Set the recipient to the user that is logged on */
  6233. /* This will send the message back to ourselves    */
  6234. rc = RxVIMSetMessageRecipient(Message,'VIMSEL_TO','VIMSEL_ENTITY','','',,
  6235.                 user_name,'','')
  6236. Say '  RxVIMSetMessageRecipient -     ' rc
  6237. if (rc > 0) then call vimerr
  6238.  
  6239.  
  6240. /* Add some text to the message */
  6241. itemtxt = 'This message was created using the RexxVIM !!'
  6242. rc = RxVIMSetMessageItem(Message,'VIMSEL_NOTE_PART','VIM_TEXT','VIMSEL_NATIVE',,
  6243.          'Message Demo',itemtxt,'')
  6244. Say '  RxVIMSetMessageItem -          ' rc
  6245. if (rc > 0) then call vimerr
  6246.  
  6247.  
  6248. /* Add the config.sys as a file attachment in the message */
  6249. drive = STRIP('c: ')
  6250. rc = RxVIMSetMessageItem(Message,'VIMSEL_ATTACH','VIM_TEXT','VIMSEL_NATIVE',,
  6251.          'config.sys','',drive'\config.sys')
  6252. Say '  RxVIMSetMessageItem -          ' rc
  6253. if (rc > 0) then call vimerr
  6254.  
  6255.  
  6256. /* Send the message */
  6257. rc = RxVIMSendMessage(Message)
  6258. Say '  RxVIMSendMessage -             ' rc
  6259. if (rc > 0) then call vimerr
  6260.  
  6261.  
  6262. /* Close the session with the postoffice */
  6263. rc = RxVIMCloseSession(Session)
  6264. Say '  RxVIMCloseSession -            ' rc
  6265. if (rc > 0) then call vimerr
  6266.  
  6267.  
  6268. /* Terminate the active VIM subsystem connection */
  6269. rc = RxVIMTerminate()
  6270. Say '  RxVIMTerminate -               ' rc
  6271. if (rc > 0) then call vimerr
  6272. signal done
  6273.  
  6274.  
  6275. /***** VIMErr *******/
  6276.  
  6277. /* If an error occurs, this function will return the text */
  6278. /* associated with the error.  Extended text may be       */
  6279. /* displayed if it exists for the specified error.        */
  6280.  
  6281. VIMERR:
  6282.  
  6283. rc = RxVIMStatusText(rc,'Status')
  6284. Say
  6285. Say '|-Error Information -----------------|'
  6286. Say '  Error Text -' status.1
  6287. Say
  6288. Say '  Ext Status -' status.2
  6289. rc = RxVIMTerminate()
  6290. signal done
  6291.  
  6292.  
  6293. /* The done section will unload the RexxVIM extensions */
  6294. /* and exit the program                                */
  6295. DONE:
  6296. /*** Drop all of the external functions ***/
  6297. call RxVIMDropFuncs
  6298. Say '|------------------------------------|'
  6299. Say 'Demo Complete.  All functions released'
  6300. 'pause'
  6301. exit
  6302.  
  6303.  
  6304. ΓòÉΓòÉΓòÉ 12.4. Message Container Demo ΓòÉΓòÉΓòÉ
  6305.  
  6306.  The Message Container (MSGCONT.CMD) demo shows how RexxVIM can be used to open 
  6307. and read message containers, like the Inbox.  Launching the demo below will 
  6308. retrieve each message from the Inbox, and allow it to be deleted, stored in a 
  6309. folder, or left in the Inbox. 
  6310.  
  6311.     Run MSGCONT.CMD 
  6312.  
  6313.  
  6314. ΓòÉΓòÉΓòÉ 12.4.1. MESSAGE.CMD Listing ΓòÉΓòÉΓòÉ
  6315.  
  6316. /** Msgcont.cmd **/
  6317. /*********************************************/
  6318. /*                                           */
  6319. /* Command line syntax:                      */
  6320. /*                                           */
  6321. /* msgcont db_path user_password user_name   */
  6322. /*                                           */
  6323. /*                                           */
  6324. /*********************************************/
  6325. ARG db_path user_pw user_name
  6326. '@echo off'
  6327. '@cls'
  6328. Say 'RexxVIM Message Container Demonstration Program'
  6329. Say
  6330.  
  6331. /* Unload functions upon error */
  6332. SIGNAL ON ERROR NAME done
  6333.  
  6334. /* Prompt for the parameters if not passed on the */
  6335. /* command line                                   */
  6336. if LENGTH(STRIP(db_path)) = 0 then do
  6337.    Say 'Enter Postoffice Directory -'
  6338.    PARSE PULL db_path .
  6339.    Say
  6340.    Say 'Enter User Name -'
  6341.    PARSE PULL user_name
  6342.    Say 'Enter Password -'
  6343.    PARSE PULL user_pw
  6344. end  /* Do */
  6345.  
  6346.  
  6347. /* Load the RexxVIM extensions to Rexx */
  6348. rc = RxFuncAdd('RxVIMLoadFuncs', 'REXXVIM', 'RxVIMLoadFuncs')
  6349. if rc <> 0 then do
  6350.    Say
  6351.    Say 'RexxVIM failed to load, return code' rc
  6352.    Say
  6353.    Say 'Functions have been released.  Retry program.'
  6354.    signal done
  6355. end  /* Do */
  6356. call RxVIMLoadFuncs
  6357. Say 'Functions are now loaded'
  6358. Say
  6359.  
  6360.  
  6361. /* Initialize the VIM subsystem */
  6362. rc = RxVIMInitialize()
  6363. if (rc > 0) then call vimerr
  6364.  
  6365. /* Open a session with the postoffice using the parameters */
  6366. /* provided by the user                                    */
  6367. rc = RxVIMOpenSession(db_path,user_name,user_pw,Session)
  6368. if (rc > 0) then call vimerr
  6369.  
  6370.  
  6371. /* Open the default message container -- Inbox */
  6372. rc = RxVIMOpenMessageContainer(Session,'','Inbox')
  6373. if (rc > 0) then call vimerr
  6374.  
  6375.  
  6376. /* Query the message container for new mail */
  6377. rc = RxVIMQueryNewMessages(Inbox,'New_Mail')
  6378. if (rc > 0) then call vimerr
  6379. Say '      New Mail Flag is' New_Mail
  6380.  
  6381.  
  6382. /* Query the number of new messages */
  6383. rc = RxVIMQueryUnreadMailCount(Inbox,'Unread_Count')
  6384. if (rc > 0) then call vimerr
  6385. Say '   Number of unread messages is' Unread_Count
  6386. Say
  6387.  
  6388.  
  6389. /* Display all mail in Inbox if unread messages exist */
  6390.  
  6391. if New_Mail = 'True' then do
  6392.  
  6393.      Say 'To review all mail in Inbox,'
  6394.      'pause'
  6395.  
  6396.      /* Enumerate messages in container -- Inbox */
  6397.      pos = ''                           /* Start at the beginning of the container */
  6398.      skipcnt = 1                        /* Move forward through the container one at a time */
  6399.      mcount  = 1                        /* Retrieve 1 message for each call */
  6400.      filter  = 'VIMSEL_NO_FILTER'       /* No filter, return all messages in inbox */
  6401.      fdata   = ''                       /* No filter data */
  6402.      flags   = 'VIM_NO_FLAGS'           /* No enumeration flags, return all messages in inbox */
  6403.      more    = ''                       /* Set the value of more to nul */
  6404.      action  = 'N'                      /* Set the value of repeat loop indicator to N */
  6405.  
  6406.      AttrDesc.0 = 2                          /* Retrieve 2 attributes for each message */
  6407.      AttrDesc.1.Selector = 'VIMSEL_REF'      /* 1st attribute is the message reference number */
  6408.      AttrDesc.1.Buffer   = 'MsgRefNo'        /* store results in this stem variable */
  6409.      AttrDesc.2.Selector = 'VIMSEL_SUBJECT'  /* 2nd attribute is the message subject */
  6410.      AttrDesc.2.Buffer   = 'Subject'         /* store results in this stem variable */
  6411.  
  6412.      do until TRANSLATE(SUBSTR(action,1,1)) = 'X'
  6413.  
  6414.           /* Continue retrieving message info until user enters N */
  6415.  
  6416.           rc = RxVIMEnumerateMessages(Inbox,'pos',skipcnt,'AttrDesc','mcount',filter,fdata,flags,'more')
  6417.           if (rc > 0) then call vimerr
  6418.  
  6419.           /* Display results */
  6420.          'cls'
  6421.           Say 'RexxVIM - (c) Innovative Business Technologies, Inc'
  6422.           Say
  6423.           Say 'Message Container Demo'
  6424.           Say
  6425.           Say '-----------------------------------------------------------'
  6426.           Say '    Message =' MsgRefNo.1
  6427.           Say '    Subject =' Subject.1
  6428.           Say '-----------------------------------------------------------'
  6429.           Say
  6430.           Say
  6431.           Say 'Select an action for this message'
  6432.           Say
  6433.           Say '   D - Delete message'
  6434.           Say '   F - File message in a folder'
  6435.           Say '   N - Go to next message, leave this one in the Inbox'
  6436.           Say '   X - Exit demo now'
  6437.           Say
  6438.           Say 'Enter your selection below -'
  6439.           PULL action
  6440.           if more = 'False' then do
  6441.              Say 'All messages have been retrieved'
  6442.              action = 'X'
  6443.           end  /* Do */
  6444.  
  6445.           /* Process the selection entered.  X will fall through the select statement */
  6446.           select
  6447.              when TRANSLATE(SUBSTR(action,1,1)) = 'D' then do
  6448.                 /* Delete message */
  6449.                 rc = RxVIMRemoveMessage(Inbox,MsgRefNo.1)
  6450.                 if (rc > 0) then call vimerr
  6451.            end  /* Do */
  6452.              when TRANSLATE(SUBSTR(action,1,1)) = 'F' then do
  6453.                 /* File message in folder */
  6454.                 Say 'Enter the name of the folder -'
  6455.                 PULL category
  6456.                  rc = RxVIMSetMessageCategory(Inbox,MsgRefNo.1,category)
  6457.                 if (rc > 0) then call vimerr
  6458.              end  /* Do */
  6459.              when TRANSLATE(SUBSTR(action,1,1)) = 'N' then do
  6460.                 /* Go to the next message */
  6461.                 /* Nothing to do.....loop will pull next message */
  6462.              end  /* Do */
  6463.           otherwise
  6464.           end  /* select */
  6465.      end /* do */
  6466. end  /* Do */
  6467.  
  6468.  
  6469. /* Close the message container -- Inbox */
  6470. rc = RxVIMCloseMessageContainer(Inbox)
  6471. if (rc > 0) then call vimerr
  6472.  
  6473.  
  6474. /* Close the session with the postoffice */
  6475. rc = RxVIMCloseSession(Session)
  6476. if (rc > 0) then call vimerr
  6477.  
  6478.  
  6479. /* Terminate the active VIM subsystem connection */
  6480. rc = RxVIMTerminate()
  6481. if (rc > 0) then call vimerr
  6482. signal done
  6483.  
  6484.  
  6485. /***** VIMErr *******/
  6486.  
  6487. /* If an error occurs, this function will return the text */
  6488. /* associated with the error.  Extended text may be       */
  6489. /* displayed if it exists for the specified error.        */
  6490.  
  6491. VIMERR:
  6492.  
  6493. erc = RxVIMStatusText(Session,rc,'Status')
  6494. Say
  6495. Say '|-Error Information -----------------|'
  6496. Say '  Error Text -' status.1
  6497. Say
  6498. Say '  Ext Status -' status.2
  6499. rc = RxVIMTerminate()
  6500. signal done
  6501.  
  6502.  
  6503. /* The done section will unload the RexxVIM extensions */
  6504. /* and exit the program                                */
  6505. DONE:
  6506. /*** Drop all of the external functions ***/
  6507. call RxVIMDropFuncs
  6508. Say '|------------------------------------|'
  6509. Say 'Demo Complete.  All functions released'
  6510. 'pause'
  6511. exit
  6512.  
  6513.  
  6514. ΓòÉΓòÉΓòÉ 12.5. Message Access Demo ΓòÉΓòÉΓòÉ
  6515.  
  6516.  The Message Access (MSGACTS.CMD) demo shows how RexxVIM can be used to open 
  6517. and read messages.  Launching the demo below will actions to be performed on 
  6518. the messages in the Inbox. 
  6519.  
  6520.     Run MSGACTS.CMD 
  6521.  
  6522.  
  6523. ΓòÉΓòÉΓòÉ 12.5.1. MSGACTS.CMD Listing ΓòÉΓòÉΓòÉ
  6524.  
  6525. /** Msgacts.cmd **/
  6526. /*********************************************/
  6527. /*                                           */
  6528. /* Command line syntax:                      */
  6529. /*                                           */
  6530. /* msgacts db_path user_password user_name   */
  6531. /*                                           */
  6532. /*                                           */
  6533. /*********************************************/
  6534. ARG db_path user_pw user_name
  6535. '@echo off'
  6536. '@cls'
  6537. Say 'RexxVIM Message Access Demonstration Program'
  6538. Say
  6539.  
  6540. /* Unload the function upon error */
  6541. SIGNAL ON ERROR NAME done
  6542.  
  6543. /* Prompt for the parameters if not passed on the */
  6544. /* command line                                   */
  6545. if LENGTH(STRIP(db_path)) = 0 then do
  6546.    Say 'Enter Postoffice Directory -'
  6547.    PARSE PULL db_path .
  6548.    Say
  6549.    Say 'Enter User Name -'
  6550.    PARSE PULL user_name
  6551.    Say 'Enter Password -'
  6552.    PARSE PULL user_pw
  6553. end  /* Do */
  6554.  
  6555.  
  6556. /* Load the RexxVIM extensions to Rexx */
  6557. rc = RxFuncAdd('RxVIMLoadFuncs', 'REXXVIM', 'RxVIMLoadFuncs')
  6558. if rc <> 0 then do
  6559.    Say
  6560.    Say 'RexxVIM failed to load, return code' rc
  6561.    Say
  6562.    Say 'Functions have been released.  Retry program.'
  6563.    signal done
  6564. end  /* Do */
  6565. call RxVIMLoadFuncs
  6566. Say 'Functions are now loaded'
  6567. Say
  6568.  
  6569.  
  6570. /* Initialize the VIM subsystem */
  6571. rc = RxVIMInitialize()
  6572. if (rc > 0) then call vimerr
  6573.  
  6574.  
  6575. /* Open a session with the postoffice using the parameters */
  6576. /* provided by the user                                    */
  6577. rc = RxVIMOpenSession(db_path,user_name,user_pw,Session)
  6578. if (rc > 0) then call vimerr
  6579.  
  6580.  
  6581. /* Open the default message container -- Inbox */
  6582. rc = RxVIMOpenMessageContainer(Session,'','Inbox')
  6583. if (rc > 0) then call vimerr
  6584.  
  6585.  
  6586. /* Display all messages in Inbox if they exist */
  6587.  
  6588.      /* Enumerate messages in container -- Inbox */
  6589.      pos = ''                           /* Start at the beginning of the container */
  6590.      skipcnt = 1                        /* Move forward through the container one at a time */
  6591.      mcount  = 1                        /* Retrieve 1 message for each call */
  6592.      filter  = 'VIMSEL_NO_FILTER'       /* No filter, return all messages in inbox */
  6593.      fdata   = ''                       /* No filter data */
  6594.      flags   = 'VIM_NO_FLAGS'           /* No enumeration flags, return all messages in inbox */
  6595.      more    = ''                       /* Set the value of more to nul */
  6596.      action  = 'N'                      /* Set the value of repeat loop indicator to N */
  6597.  
  6598.      AttrDesc.0 = 3                               /* Retrieve 3 attributes for each message */
  6599.      AttrDesc.1.Selector = 'VIMSEL_REF'           /* 1st attribute is the message reference number */
  6600.      AttrDesc.1.Buffer   = 'MsgRefNo'             /* store results in this stem variable */
  6601.      AttrDesc.2.Selector = 'VIMSEL_SUBJECT'       /* 2nd attribute is the message subject */
  6602.      AttrDesc.2.Buffer   = 'Subject'              /* store results in this stem variable */
  6603.      AttrDesc.3.Selector = 'VIMSEL_UNREAD_MAIL'   /* 3rd attribute is if unread */
  6604.      AttrDesc.3.Buffer   = 'Unread'               /* store results in this stem variable */
  6605.  
  6606.      do until TRANSLATE(SUBSTR(action,1,1)) = 'X'
  6607.  
  6608.           /* Continue retrieving message info until user enters N */
  6609.  
  6610.           rc = RxVIMEnumerateMessages(Inbox,'pos',skipcnt,'AttrDesc','mcount',filter,fdata,flags,'more')
  6611.           if (rc > 0) then call vimerr
  6612.  
  6613.           /* Display results */
  6614.          'cls'
  6615.           Say 'RexxVIM - (c) Innovative Business Technologies, Inc'
  6616.           Say
  6617.           Say 'Message Container Demo'
  6618.           Say
  6619.           Say '--------------------------------------------------------'
  6620.           Say '    Message =' MsgRefNo.1
  6621.           Say '    Subject =' Subject.1
  6622.           Say '    Unread  =' Unread.1
  6623.           Say '--------------------------------------------------------'
  6624.           Say
  6625.           Say 'Select an action for this message'
  6626.           Say
  6627.           Say '   D - Delete message'
  6628.           Say '   F - File message in a folder'
  6629.           Say '   N - Go to next message, leave this one in the Inbox'
  6630.           Say '   M - Mark message as read'
  6631.           Say '   H - Display message header info'
  6632.           Say '   I - Display message items'
  6633.           Say '   T - Display the first 60 characters of first message item'
  6634.           Say '   X - Exit demo now'
  6635.           Say
  6636.           Say 'Enter your selection below -'
  6637.           PULL action
  6638.  
  6639.           /* Process the selection entered.  X will fall through the select statement */
  6640.           select
  6641.              when TRANSLATE(SUBSTR(action,1,1)) = 'D' then do
  6642.                 /* Delete message */
  6643.                 rc = RxVIMRemoveMessage(Inbox,MsgRefNo.1)
  6644.                 if (rc > 0) then call vimerr
  6645.            end  /* Do */
  6646.              when TRANSLATE(SUBSTR(action,1,1)) = 'F' then do
  6647.                 /* File message in folder */
  6648.                 Say 'Enter the name of the folder-'
  6649.                 PULL category
  6650.                  rc = RxVIMSetMessageCategory(Inbox,MsgRefNo.1,category)
  6651.                 if (rc > 0) then call vimerr
  6652.              end  /* Do */
  6653.              when TRANSLATE(SUBSTR(action,1,1)) = 'N' then do
  6654.                 /* Go to the next message */
  6655.                 /* Nothing to do.....loop will pull next message */
  6656.              end  /* Do */
  6657.              when TRANSLATE(SUBSTR(action,1,1)) = 'M' then do
  6658.                 /* Open message */
  6659.                 rc = RxVIMOpenMessage(Inbox,MsgRefNo.1,'','MsgHandle')
  6660.                 if (rc > 0) then call vimerr
  6661.  
  6662.                 /* Mark the message as read */
  6663.                 rc = RxVIMMarkMessageAsRead(Inbox,MsgRefNo.1)
  6664.                 if (rc > 0) then call vimerr
  6665.  
  6666.                 /* Close the message */
  6667.                 rc = RxVIMCloseMessage(MsgHandle)
  6668.                 if (rc > 0) then call vimerr
  6669.              end  /* Do */
  6670.              when TRANSLATE(SUBSTR(action,1,1)) = 'H' then do
  6671.                 /* Open message */
  6672.                 rc = RxVIMOpenMessage(Inbox,MsgRefNo.1,'','MsgHandle')
  6673.                 if (rc > 0) then call vimerr
  6674.  
  6675.                 /* Get the message header info */
  6676.                 attrDesc.0 = 2
  6677.                 attrDesc.1.Selector = 'VIMSEL_FROM_NAME'
  6678.                 attrDesc.1.Buffer   = 'from'
  6679.                 attrDesc.2.Selector = 'VIMSEL_PRIORITY'
  6680.                 attrDesc.2.Buffer   = 'priority'
  6681.  
  6682.                 rc = RxVIMGetMessageHeader(MsgHandle,'attrDesc')
  6683.                 if (rc > 0) then call vimerr
  6684.                 Say '--------------------------------------------------------'
  6685.                 Say '    Message Sent by -' from
  6686.                 Say '    Message Priority-' priority
  6687.                 Say '--------------------------------------------------------'
  6688.                 'pause'
  6689.                 /* Close the message */
  6690.                 rc = RxVIMCloseMessage(MsgHandle)
  6691.                 if (rc > 0) then call vimerr
  6692.              end  /* Do */
  6693.              when TRANSLATE(SUBSTR(action,1,1)) = 'I' then do
  6694.                 /* Open message */
  6695.                 rc = RxVIMOpenMessage(Inbox,MsgRefNo.1,'','MsgHandle')
  6696.                 if (rc > 0) then call vimerr
  6697.  
  6698.                 /* Retrieve all of the items for this message */
  6699.                 ipos      = ''
  6700.                 icount   = 20
  6701.                 imore    = ''
  6702.                 ItemDesc = ''
  6703.                 ifilter   = 'VIMSEL_NO_FILTER'
  6704.                 ifdata    = ''
  6705.  
  6706.                 rc = RxVIMEnumerateMessageItems(MsgHandle,'ipos',1,'icount','ItemDesc',,
  6707.                                                 ifilter,ifdata,'imore')
  6708.                 if (rc > 0) then call vimerr
  6709.  
  6710.                 'cls'
  6711.                 Say 'RexxVIM - (c) Innovative Business Technologies, Inc'
  6712.                 Say
  6713.                 Say ' Message Information with Item Detail'
  6714.                 Say '--------------------------------------------------------'
  6715.                 Say '    Message =' MsgRefNo.1
  6716.                 Say '    Subject =' Subject.1
  6717.                 Say '    Unread  =' Unread.1
  6718.                 Say '--------------------------------------------------------'
  6719.  
  6720.                 loopcnt = 1
  6721.                 do while (loopcnt <= icount)
  6722.                    /* Display each item descriptor entry */
  6723.                    Say '    Item Class  -' ItemDesc.loopcnt.CLASS
  6724.                    Say '    Item Type   -' ItemDesc.loopcnt.TYPE
  6725.                    Say '    Item Name   -' ItemDesc.loopcnt.NAME
  6726.                    Say '    Item Size   -' ItemDesc.loopcnt.SIZE
  6727.                    Say '    Item Ref No -' ItemDesc.loopcnt.REF
  6728.                    Say '--------------------------------------------------------'
  6729.  
  6730.                    loopcnt = loopcnt + 1
  6731.                 end /* do */
  6732.                 'pause'
  6733.                 /* Close the message */
  6734.                 rc = RxVIMCloseMessage(MsgHandle)
  6735.                 if (rc > 0) then call vimerr
  6736.              end  /* Do */
  6737.              when TRANSLATE(SUBSTR(action,1,1)) = 'T' then do
  6738.                 /* Open message */
  6739.                 rc = RxVIMOpenMessage(Inbox,MsgRefNo.1,'','MsgHandle')
  6740.                 if (rc > 0) then call vimerr
  6741.  
  6742.                 /* Retrieve all of the items for this message */
  6743.                 ipos      = ''
  6744.                 icount    = 20
  6745.                 imore     = ''
  6746.                 ItemDesc  = ''
  6747.                 ifilter   = 'VIMSEL_CLASS'        /* Filter on item class */
  6748.                 ifdata    = 'VIMSEL_NOTE_PART'    /* Retrieve only text items */
  6749.  
  6750.                 rc = RxVIMEnumerateMessageItems(MsgHandle,'ipos',1,'icount','ItemDesc',,
  6751.                                                 ifilter,ifdata,'imore')
  6752.                 if (rc > 0) then call vimerr
  6753.                 /* Retrieve the text for the first message item */
  6754.                 tconvert          = 'VIM_TEXT'         /* Use text conversion   */
  6755.                 tflags            = ''                 /* No conversion flags   */
  6756.                 BufDesc.Buffer    = 'ItemText'         /* Return buffer name    */
  6757.                 BufDesc.Size      = 256                /* Size of return buffer */
  6758.                 BufDesc.FileName  = ''
  6759.  
  6760.                 rc = RxVIMGetMessageItem(MsgHandle,ItemDesc.1.REF,tconvert,tflags,'BufDesc')
  6761.                 if (rc > 0) then call vimerr
  6762.  
  6763.                 'cls'
  6764.                 Say 'RexxVIM - (c) Innovative Business Technologies, Inc'
  6765.                 Say
  6766.                 Say ' Message Information with Item Detail'
  6767.                 Say '--------------------------------------------------------'
  6768.                 Say '    Message =' MsgRefNo.1
  6769.                 Say '    Subject =' Subject.1
  6770.                 Say '    Unread  =' Unread.1
  6771.                 Say '--------------------------------------------------------'
  6772.  
  6773.                 /* Display each item descriptor entry */
  6774.                 Say '    Item Class  -' ItemDesc.1.CLASS
  6775.                 Say '    Item Type   -' ItemDesc.1.TYPE
  6776.                 Say '    Item Name   -' ItemDesc.1.NAME
  6777.                 Say '    Item Size   -' ItemDesc.1.SIZE
  6778.                 Say '    Item Ref No -' ItemDesc.1.REF
  6779.                 Say '--------------------------------------------------------'
  6780.                 Say ' Message Contents for first item (max 60 characters) -'
  6781.                 Say
  6782.                 Say SUBSTR(ItemText,1,60)
  6783.                 Say '--------------------------------------------------------'
  6784.                 'pause'
  6785.                 /* Close the message */
  6786.                 rc = RxVIMCloseMessage(MsgHandle)
  6787.                 if (rc > 0) then call vimerr
  6788.              end  /* Do */
  6789.           otherwise
  6790.           end  /* select */
  6791.  
  6792.           /* End the loop if no more messages to retrieve */
  6793.           if more = 'False' then do
  6794.              Say 'All messages have been retrieved'
  6795.              action = 'X'
  6796.           end  /* Do */
  6797.  
  6798.      end /* do */
  6799.  
  6800.  
  6801. /* Close the message container -- Inbox */
  6802. rc = RxVIMCloseMessageContainer(Inbox)
  6803. if (rc > 0) then call vimerr
  6804.  
  6805.  
  6806. /* Close the session with the postoffice */
  6807. rc = RxVIMCloseSession(Session)
  6808. if (rc > 0) then call vimerr
  6809.  
  6810.  
  6811. /* Terminate the active VIM subsystem connection */
  6812. rc = RxVIMTerminate()
  6813. if (rc > 0) then call vimerr
  6814. signal done
  6815.  
  6816.  
  6817. /***** VIMErr *******/
  6818.  
  6819. /* If an error occurs, this function will return the text */
  6820. /* associated with the error.  Extended text may be       */
  6821. /* displayed if it exists for the specified error.        */
  6822.  
  6823. VIMERR:
  6824.  
  6825. erc = RxVIMStatusText(Session,rc,'Status')
  6826. Say
  6827. Say '|-Error Information ------------------------------------|'
  6828. Say '  Error Text -' status.1
  6829. Say
  6830. Say '  Ext Status -' status.2
  6831. rc = RxVIMTerminate()
  6832. signal done
  6833.  
  6834.  
  6835. /* The done section will unload the RexxVIM extensions */
  6836. /* and exit the program                                */
  6837. DONE:
  6838. /*** Drop all of the external functions ***/
  6839. call RxVIMDropFuncs
  6840. Say '|-------------------------------------------------------|'
  6841. Say 'Demo Complete.  All functions released'
  6842. 'pause'
  6843. exit
  6844.  
  6845.  
  6846. ΓòÉΓòÉΓòÉ 12.6. Address Book Demo ΓòÉΓòÉΓòÉ
  6847.  
  6848.  The Address Book (ADDRBOOK.CMD) demo shows how RexxVIM can be used to open and 
  6849. read address books, like the primary directory.  Launching the demo below will 
  6850. allow each address book to be accessed and displayed. 
  6851.  
  6852.     Run ADDRBOOK.CMD 
  6853.  
  6854.  
  6855. ΓòÉΓòÉΓòÉ 12.6.1. ADDRBOOK.CMD Listing ΓòÉΓòÉΓòÉ
  6856.  
  6857. /** AddrBook.cmd **/
  6858. /**********************************************/
  6859. /*                                            */
  6860. /* Command line syntax:                       */
  6861. /*                                            */
  6862. /* AddrBook db_path user_password user_name   */
  6863. /*                                            */
  6864. /*                                            */
  6865. /**********************************************/
  6866. ARG db_path user_pw user_name
  6867. '@echo off'
  6868. '@cls'
  6869. Say 'RexxVIM Address Book Demonstration Program'
  6870. Say
  6871.  
  6872. /* Unload the function upon error */
  6873. SIGNAL ON ERROR NAME done
  6874.  
  6875. /* Prompt for the parameters if not passed on the */
  6876. /* command line                                   */
  6877. if LENGTH(STRIP(db_path)) = 0 then do
  6878.    Say 'Enter Postoffice Directory -'
  6879.    PARSE PULL db_path .
  6880.    Say
  6881.    Say 'Enter User Name -'
  6882.    PARSE PULL user_name
  6883.    Say 'Enter Password -'
  6884.    PARSE PULL user_pw
  6885. end  /* Do */
  6886.  
  6887.  
  6888. /* Load the RexxVIM extensions to Rexx */
  6889. rc = RxFuncAdd('RxVIMLoadFuncs', 'REXXVIM', 'RxVIMLoadFuncs')
  6890. if rc <> 0 then do
  6891.    Say
  6892.    Say 'RexxVIM failed to load, return code' rc
  6893.    Say
  6894.    Say 'Functions have been released.  Retry program.'
  6895.    signal done
  6896. end  /* Do */
  6897. call RxVIMLoadFuncs
  6898. Say 'Functions are now loaded'
  6899. Say
  6900.  
  6901.  
  6902. /* Initialize the VIM subsystem */
  6903. rc = RxVIMInitialize()
  6904. if (rc > 0) then call vimerr
  6905.  
  6906. /* Open a session with the postoffice using the parameters */
  6907. /* provided by the user                                    */
  6908. rc = RxVIMOpenSession(db_path,user_name,user_pw,Session)
  6909. if (rc > 0) then call vimerr
  6910.  
  6911.  
  6912.      /* Enumerate the addressbooks */
  6913.      pos = ''                           /* Start at the beginning */
  6914.      skipcnt = 1                        /* Move forward one at a time */
  6915.      acount  = 1                        /* Retrieve 1 addressbook for each call */
  6916.      more    = ''                       /* Set the value of more to nul */
  6917.      action  = 'N'                      /* Set the value of repeat loop indicator to N */
  6918.  
  6919.      AttrDesc.0 = 2                               /* Retrieve 2 attributes for each addressbook */
  6920.      AttrDesc.1.Selector = 'VIMSEL_NAME'          /* 1st attribute is the addressbook name */
  6921.      AttrDesc.1.Buffer   = 'AddrName'             /* store results in this stem variable */
  6922.      AttrDesc.2.Selector = 'VIMSEL_TOTAL_ENTRIES' /* 2nd attribute is total entries */
  6923.      AttrDesc.2.Buffer   = 'AddrTotal'            /* store results in this stem variable */
  6924.  
  6925.      do until TRANSLATE(SUBSTR(action,1,1)) = 'X'
  6926.  
  6927.           /* Continue retrieving addressbook info until user enters N */
  6928.  
  6929.           rc = RxVIMEnumerateAddressBooks(Session,'pos',skipcnt,'AttrDesc','acount','more')
  6930.           if (rc > 0) then call vimerr
  6931.  
  6932.           /* Display results */
  6933.          'cls'
  6934.           Say 'RexxVIM - (c) Innovative Business Technologies, Inc'
  6935.           Say
  6936.           Say 'Address Book Demo'
  6937.           Say
  6938.           Say '--------------------------------------------------------'
  6939.           Say '    Address Book Name =' AddrName.1
  6940.           Say '    Total Entries     =' AddrTotal.1
  6941.           Say '--------------------------------------------------------'
  6942.           Say
  6943.           Say
  6944.           Say 'Select an action for this message'
  6945.           Say
  6946.           Say '   N - Go to next Address Book'
  6947.           Say '   D - Display each of the Address Book entries'
  6948.           Say '   G - Get the current subtree name'
  6949.           Say '   X - Exit demo now'
  6950.           Say
  6951.           Say 'Enter your selection below-'
  6952.           PULL action
  6953.  
  6954.           /* Process the selection entered.  X will fall through the select statement */
  6955.           select
  6956.              when TRANSLATE(SUBSTR(action,1,1)) = 'N' then do
  6957.                 /* Go to the next address book */
  6958.                 /* Nothing to do.....loop will pull next address book */
  6959.              end  /* Do */
  6960.              when TRANSLATE(SUBSTR(action,1,1)) = 'G' then do
  6961.  
  6962.                 /* Open the current address book */
  6963.                 rc = RxVIMOpenAddressBook(Session,AddrName.1,'AddrBkPtr')
  6964.                 if (rc > 0) then call vimerr
  6965.  
  6966.                 /* Get the subtree of the address book */
  6967.                 Subtree = ''
  6968.                 SubRefNo = ''
  6969.  
  6970.                 rc = RxVIMGetCurrentSubtree(AddrBkPtr,'SubRefNo','Subtree')
  6971.                 if (rc > 0) then call vimerr
  6972.  
  6973.                 /* Close the  address book */
  6974.                 rc = RxVIMCloseAddressBook(AddrBkPtr)
  6975.                 if (rc > 0) then call vimerr
  6976.  
  6977.                 Say '--------------------------------------------------------'
  6978.                 Say '    Current Subtree  =' Subtree
  6979.                 Say '--------------------------------------------------------'
  6980.                 'pause'
  6981.  
  6982.              end  /* Do */
  6983.              when TRANSLATE(SUBSTR(action,1,1)) = 'D' then do
  6984.  
  6985.                 /* Open the current address book */
  6986.                 rc = RxVIMOpenAddressBook(Session,AddrName.1,'AddrBkPtr')
  6987.                 if (rc > 0) then call vimerr
  6988.  
  6989.                 /* Enumerate the addressbook entries */
  6990.                 epos = ''                           /* Start at the beginning */
  6991.                 eskipcnt = 1                        /* Move forward one at a time */
  6992.                 eacount  = 1                        /* Retrieve 1 addressbook for each call */
  6993.                 efilter  = 'VIMSEL_NO_FILTER'       /* no filtering */
  6994.                 efdata   = ''                       /* no filter data */
  6995.                 emore    = ''                       /* Set the value of more to nul */
  6996.                 eaction  = 'N'                      /* Set the value of repeat loop indicator to N */
  6997.  
  6998.                 ItemDesc.0 = 3                               /* Retrieve 3 attributes for each entry */
  6999.                 ItemDesc.1.Selector = 'VIMSEL_REF'           /* 1st attribute is the reference number */
  7000.                 ItemDesc.1.Buffer   = 'ABE_Ref'              /* store results in this stem variable */
  7001.                 ItemDesc.2.Selector = 'VIMSEL_NAME'          /* 2nd attribute is entry name */
  7002.                 ItemDesc.2.Buffer   = 'ABE_Name'             /* store results in this stem variable */
  7003.                 ItemDesc.3.Selector = 'VIMSEL_ADDRESS'       /* 3rd attribute is entry address */
  7004.                 ItemDesc.3.Buffer   = 'ABE_Address'          /* store results in this stem variable */
  7005.  
  7006.                 do until TRANSLATE(SUBSTR(eaction,1,1)) = 'X'
  7007.  
  7008.                      /* Continue retrieving addressbook info until user enters X */
  7009.  
  7010.                      rc = RxVIMEnumerateAddressBookEntries(AddrBkPtr,'epos',eskipcnt,,
  7011.                                            'ItemDesc','eacount',efilter,efdata,'emore')
  7012.                      if (rc > 0) then call vimerr
  7013.  
  7014.                      /* Display results */
  7015.                     'cls'
  7016.                      Say 'RexxVIM - (c) Innovative Business Technologies, Inc'
  7017.                      Say
  7018.                      Say 'Address Book Demo with entry information'
  7019.                      Say
  7020.                      Say '--------------------------------------------------------'
  7021.                      Say '    Address Book Name =' AddrName.1
  7022.                      Say '    Total Entries     =' AddrTotal.1
  7023.                      Say '--------------------------------------------------------'
  7024.                      Say '    Name =   ' ABE_Name.1
  7025.                      Say '    Address =' ABE_Address.1
  7026.                      Say '    Ref No  =' ABE_Ref.1
  7027.                      Say '--------------------------------------------------------'
  7028.                      Say
  7029.                      Say
  7030.                      Say 'Select an action for this message'
  7031.                      Say
  7032.                      Say '   N - Go to next Address Book entry'
  7033.                      Say '   X - Exit to the main screen'
  7034.                      Say
  7035.                      Say 'Enter your selection below-'
  7036.                      PULL eaction
  7037.  
  7038.                      select
  7039.                         when TRANSLATE(SUBSTR(eaction,1,1)) = 'N' then do
  7040.                            /* Go to the next address book entry */
  7041.                            /* Nothing to do.....will loop to the next entry */
  7042.                         end  /* Do */
  7043.                      otherwise
  7044.                      end  /* select */
  7045.  
  7046.                      /* End the loop if no more entries */
  7047.                      if emore = 'False' then do
  7048.                         Say 'All entries for this address book have been retrieved'
  7049.                         eaction = 'X'
  7050.                      end  /* Do */
  7051.  
  7052.                 end /* Do */
  7053.  
  7054.                 /* Close the  address book */
  7055.                 rc = RxVIMCloseAddressBook(AddrBkPtr)
  7056.                 if (rc > 0) then call vimerr
  7057.  
  7058.              end  /* Do */
  7059.           otherwise
  7060.           end  /* select */
  7061.  
  7062.           if more = 'False' then do
  7063.              Say 'All Address Books have been retrieved'
  7064.              action = 'X'
  7065.           end  /* Do */
  7066.  
  7067.      end /* do */
  7068.  
  7069. /* Close the session with the postoffice */
  7070. rc = RxVIMCloseSession(Session)
  7071. if (rc > 0) then call vimerr
  7072.  
  7073.  
  7074. /* Terminate the active VIM subsystem connection */
  7075. rc = RxVIMTerminate()
  7076. if (rc > 0) then call vimerr
  7077. signal done
  7078.  
  7079.  
  7080. /***** VIMErr *******/
  7081.  
  7082. /* If an error occurs, this function will return the text */
  7083. /* associated with the error.  Extended text may be       */
  7084. /* displayed if it exists for the specified error.        */
  7085.  
  7086. VIMERR:
  7087.  
  7088. erc = RxVIMStatusText(Session,rc,'Status')
  7089. Say
  7090. Say '|-Error Information ------------------------------------|'
  7091. Say '  Error Text -' status.1
  7092. Say
  7093. Say '  Ext Status -' status.2
  7094. rc = RxVIMTerminate()
  7095. signal done
  7096.  
  7097.  
  7098. /* The done section will unload the RexxVIM extensions */
  7099. /* and exit the program                                */
  7100. DONE:
  7101. /*** Drop all of the external functions ***/
  7102. call RxVIMDropFuncs
  7103. Say '|-------------------------------------------------------|'
  7104. Say 'Demo Complete.  All functions released'
  7105. 'pause'
  7106. exit
  7107.  
  7108.  
  7109. ΓòÉΓòÉΓòÉ 12.7. Address Book Entries Demo ΓòÉΓòÉΓòÉ
  7110.  
  7111.  The Address Book Entries (ABEDEMO.CMD) demo shows how RexxVIM can be used to 
  7112. open and read addressbook entries.  Launching the demo below will allow 
  7113. individual entries in the address books to be reviewed, added, changed and 
  7114. removed. 
  7115.  
  7116.     Run ABEDEMO.CMD 
  7117.  
  7118.  
  7119. ΓòÉΓòÉΓòÉ 12.7.1. ABEDEMO.CMD Listing ΓòÉΓòÉΓòÉ
  7120.  
  7121. /** ABEDemo.cmd **/
  7122. /**********************************************/
  7123. /*                                            */
  7124. /* Command line syntax:                       */
  7125. /*                                            */
  7126. /* ABEDemo  db_path user_password user_name   */
  7127. /*                                            */
  7128. /*                                            */
  7129. /**********************************************/
  7130. ARG db_path user_pw user_name
  7131. '@echo off'
  7132. '@cls'
  7133. Say 'RexxVIM Address Book Entry Demonstration Program'
  7134. Say
  7135.  
  7136. /* Unload the function upon error */
  7137. SIGNAL ON ERROR NAME done
  7138.  
  7139. /* Prompt for the parameters if not passed on the */
  7140. /* command line                                   */
  7141. if LENGTH(STRIP(db_path)) = 0 then do
  7142.    Say 'Enter Postoffice Directory -'
  7143.    PARSE PULL db_path .
  7144.    Say
  7145.    Say 'Enter User Name -'
  7146.    PARSE PULL user_name
  7147.    Say 'Enter Password -'
  7148.    PARSE PULL user_pw
  7149. end  /* Do */
  7150.  
  7151.  
  7152. /* Load the RexxVIM extensions to Rexx */
  7153. rc = RxFuncAdd('RxVIMLoadFuncs', 'REXXVIM', 'RxVIMLoadFuncs')
  7154. if rc <> 0 then do
  7155.    Say
  7156.    Say 'RexxVIM failed to load, return code' rc
  7157.    Say
  7158.    Say 'Functions have been released.  Retry program.'
  7159.    signal done
  7160. end  /* Do */
  7161. call RxVIMLoadFuncs
  7162. Say 'Functions are now loaded'
  7163. Say
  7164.  
  7165.  
  7166. /* Initialize the VIM subsystem */
  7167. rc = RxVIMInitialize()
  7168. if (rc > 0) then call vimerr
  7169.  
  7170. /* Open a session with the postoffice using the parameters */
  7171. /* provided by the user                                    */
  7172. rc = RxVIMOpenSession(db_path,user_name,user_pw,Session)
  7173. if (rc > 0) then call vimerr
  7174.  
  7175.  
  7176.      /* Enumerate the addressbooks */
  7177.      pos = ''                           /* Start at the beginning */
  7178.      skipcnt = 1                        /* Move forward one at a time */
  7179.      acount  = 1                        /* Retrieve 1 addressbook for each call */
  7180.      more    = ''                       /* Set the value of more to nul */
  7181.      action  = 'N'                      /* Set the value of repeat loop indicator to N */
  7182.  
  7183.      AttrDesc.0 = 2                               /* Retrieve 2 attributes for each addressbook */
  7184.      AttrDesc.1.Selector = 'VIMSEL_NAME'          /* 1st attribute is the addressbook name */
  7185.      AttrDesc.1.Buffer   = 'AddrName'             /* store results in this stem variable */
  7186.      AttrDesc.2.Selector = 'VIMSEL_TOTAL_ENTRIES' /* 2nd attribute is total entries */
  7187.      AttrDesc.2.Buffer   = 'AddrTotal'            /* store results in this stem variable */
  7188.  
  7189.      /* Continue retrieving addressbook info until user enters X */
  7190.  
  7191.      rc = RxVIMEnumerateAddressBooks(Session,'pos',skipcnt,'AttrDesc','acount','more')
  7192.      if (rc > 0) then call vimerr
  7193.  
  7194.      do until TRANSLATE(SUBSTR(action,1,1)) = 'X'
  7195.  
  7196.           /* Display results */
  7197.          'cls'
  7198.           Say 'RexxVIM - (c) Innovative Business Technologies, Inc'
  7199.           Say
  7200.           Say 'Address Book Demo'
  7201.           Say
  7202.           Say '--------------------------------------------------------'
  7203.           Say '    Address Book Name =' AddrName.1
  7204.           Say '    Total Entries     =' AddrTotal.1
  7205.           Say '--------------------------------------------------------'
  7206.           Say
  7207.           Say
  7208.           Say 'Select an action for this message'
  7209.           Say
  7210.           Say '   N - Go to next Address Book'
  7211.           Say '   C - Create a new entry'
  7212.           Say '   S - Search for an entry'
  7213.           Say '   L - Change the location of an entry'
  7214.           Say '   F - Create a new group'
  7215.           Say '   G - Display all members of a group'
  7216.           Say '   X - Exit demo now'
  7217.           Say
  7218.           Say 'Enter your selection below-'
  7219.           PULL action
  7220.  
  7221.           /* Process the selection entered.  X will fall through the select statement */
  7222.           select
  7223.              when TRANSLATE(SUBSTR(action,1,1)) = 'N' then do
  7224.                 /* Go to the next address book */
  7225.  
  7226.                 rc = RxVIMEnumerateAddressBooks(Session,'pos',skipcnt,'AttrDesc','acount','more')
  7227.                 if (rc > 0) then call vimerr
  7228.  
  7229.              end  /* Do */
  7230.              when TRANSLATE(SUBSTR(action,1,1)) = 'C' then do
  7231.                 /* Create a new entry in this address book */
  7232.  
  7233.                 Say '--------------------------------------------------------'
  7234.                 Say 'Enter the name'
  7235.                 Pull ename
  7236.                 Say 'Enter a comment'
  7237.                 Pull ecomment
  7238.                 Say
  7239.                 Say 'Adding' ename 'to the addressbook'
  7240.                 Say '--------------------------------------------------------'
  7241.  
  7242.                 /* Open the addressbook */
  7243.                 rc = RxVIMOpenAddressBook(Session,AddrName.1,'AddrBkPtr')
  7244.                 if (rc > 0) then call vimerr
  7245.  
  7246.                 /* Create the description stem for the create */
  7247.                 attrItem.0 = 3
  7248.                 attrItem.1.Selector = 'VIMSEL_NAME'
  7249.                 attrItem.1.Value    = ename
  7250.                 attrItem.2.Selector = 'VIMSEL_COMMENTS'
  7251.                 attrItem.2.Value    = ecomment
  7252.                 attrItem.3.Selector = 'VIMSEL_LOCATION'
  7253.                 attrItem.3.Value    = 'VIMSEL_REMOTE'
  7254.  
  7255.                 /* Add the entry to the address book */
  7256.                 rc = RxVIMCreateAddressBookEntry(AddrBkPtr,'VIMSEL_ENTITY','attrItem')
  7257.                 if (rc > 0) then call vimerr
  7258.  
  7259.                 /* Close the address book */
  7260.                 rc = RxVIMCloseAddressBook(addrBkPtr)
  7261.                 if (rc > 0) then call vimerr
  7262.  
  7263.              end  /* Do */
  7264.              when TRANSLATE(SUBSTR(action,1,1)) = 'S' then do
  7265.                 /* Search for an entry in this address book */
  7266.  
  7267.                 Say '--------------------------------------------------------'
  7268.                 Say 'Enter the name for the search'
  7269.                 Pull ename
  7270.                 Say
  7271.                 Say 'Searching for' ename 'in the addressbook'
  7272.  
  7273.                 /* Open the addressbook */
  7274.                 rc = RxVIMOpenAddressBook(Session,AddrName.1,'AddrBkPtr')
  7275.                 if (rc > 0) then call vimerr
  7276.  
  7277.                 /* Create the description stem for the create */
  7278.                 searchon = 'VIMSEL_NAME'
  7279.                 epos     = ''
  7280.                 matchby  = 'VIMSEL_FULL'
  7281.                 enumb    = ''
  7282.  
  7283.                 /* Search for the entry in the address book */
  7284.                 rc = RxVIMMatchAddressBook(AddrBkPtr,searchon,ename,matchby,'epos','enumb')
  7285.                 if (rc > 0) then do
  7286.                     /* Entry not found */
  7287.                     Say '--------------------------------------------------------'
  7288.                     Say '  Entry not found in the addressbook'
  7289.                     Say '--------------------------------------------------------'
  7290.                 end  /* Do */
  7291.                 else do
  7292.  
  7293.                     /* Get additional info about specific entry */
  7294.                     itemdesc.0 = 3
  7295.                     itemdesc.1.selector = 'VIMSEL_LOCATION'
  7296.                     itemdesc.1.buffer   = 'location'
  7297.                     itemdesc.2.selector = 'VIMSEL_ADDRESS'
  7298.                     itemdesc.2.buffer   = 'address'
  7299.                     itemdesc.3.selector = 'VIMSEL_TYPE'
  7300.                     itemdesc.3.buffer   = 'typebuf'
  7301.  
  7302.                     rc = RxVIMGetABEntryAttributes(addrBkPtr,epos,'','itemdesc')
  7303.                     if (rc > 0) then call vimerr
  7304.  
  7305.                     Say '--------------------------------------------------------'
  7306.                     Say '  Name     -' ename
  7307.                     Say '  Ref No   -' epos
  7308.                     Say
  7309.                     Say '  Address  -' address
  7310.                     Say '  Type     -' typebuf
  7311.                     Say '  Location -' location
  7312.                     Say '--------------------------------------------------------'
  7313.                 end  /* Do */
  7314.                 'pause'
  7315.  
  7316.                 /* Close the address book */
  7317.                 rc = RxVIMCloseAddressBook(addrBkPtr)
  7318.                 if (rc > 0) then call vimerr
  7319.  
  7320.              end  /* Do */
  7321.              when TRANSLATE(SUBSTR(action,1,1)) = 'G' then do
  7322.  
  7323.                 /* Retrieve the name of the group to display */
  7324.                 Say 'Enter the name of the group to display'
  7325.                 PULL gname
  7326.  
  7327.                 /* Open the current address book */
  7328.                 rc = RxVIMOpenAddressBook(Session,AddrName.1,'AddrBkPtr')
  7329.                 if (rc > 0) then call vimerr
  7330.  
  7331.                 /* Enumerate the group member entries */
  7332.                 epos = ''                           /* Start at the beginning */
  7333.                 eskipcnt = 1                        /* Move forward one at a time */
  7334.                 eacount  = 1                        /* Retrieve 1 group member for each call */
  7335.                 emore    = ''                       /* Set the value of more to nul */
  7336.                 eaction  = 'N'                      /* Set the value of repeat loop indicator to N */
  7337.  
  7338.                 ItemDesc.0 = 3                               /* Retrieve 3 attributes for each entry */
  7339.                 ItemDesc.1.Selector = 'VIMSEL_REF'           /* 1st attribute is the reference number */
  7340.                 ItemDesc.1.Buffer   = 'ABE_Ref'              /* store results in this stem variable */
  7341.                 ItemDesc.2.Selector = 'VIMSEL_NAME'          /* 2nd attribute is the entry name */
  7342.                 ItemDesc.2.Buffer   = 'ABE_Name'             /* store results in this stem variable */
  7343.                 ItemDesc.3.Selector = 'VIMSEL_ADDRESS'       /* 3rd attribute is entry address */
  7344.                 ItemDesc.3.Buffer   = 'ABE_Address'          /* store results in this stem variable */
  7345.  
  7346.                 do until TRANSLATE(SUBSTR(eaction,1,1)) = 'X'
  7347.  
  7348.                      /* Continue retrieving group member info until user enters X */
  7349.  
  7350.                      rc = RxVIMEnumerateGroupMembers(AddrBkPtr,'',gname,'epos',eskipcnt,,
  7351.                                            'ItemDesc','eacount','emore')
  7352.                      if (rc > 0) then call vimerr
  7353.  
  7354.                      /* Display results */
  7355.                     'cls'
  7356.                      Say 'RexxVIM - (c) Innovative Business Technologies, Inc'
  7357.                      Say
  7358.                      Say 'Group Member Information'
  7359.                      Say
  7360.                      Say '--------------------------------------------------------'
  7361.                      Say '    Group Name =' gname
  7362.                      Say '--------------------------------------------------------'
  7363.                      Say '    Name =   ' ABE_Name.1
  7364.                      Say '    Address =' ABE_Address.1
  7365.                      Say '    Ref No  =' ABE_Ref.1
  7366.                      Say '--------------------------------------------------------'
  7367.                      Say
  7368.                      Say
  7369.                      Say 'Select an action for this message'
  7370.                      Say
  7371.                      Say '   N - Go to next Group Member entry'
  7372.                      Say '   A - Add a new entry to the group'
  7373.                      Say '   D - Delete this entry from the group'
  7374.                      Say '   X - Exit to the main screen'
  7375.                      Say
  7376.                      Say 'Enter your selection below-'
  7377.                      PULL eaction
  7378.  
  7379.                      select
  7380.                         when TRANSLATE(SUBSTR(eaction,1,1)) = 'N' then do
  7381.                            /* Go to the next group member entry */
  7382.                            /* Nothing to do.....will loop to the next entry */
  7383.                         end  /* Do */
  7384.                         when TRANSLATE(SUBSTR(eaction,1,1)) = 'D' then do
  7385.                            /* Delete the current entry from the group */
  7386.                            rc = RxVIMRemoveGroupMember(AddrBkPtr,'',gname,ABE_Name.1)
  7387.                            if (rc > 0) then call vimerr
  7388.                         end  /* Do */
  7389.                         when TRANSLATE(SUBSTR(eaction,1,1)) = 'A' then do
  7390.                            /* Add a new entry to the group */
  7391.                            Say 'Enter the new name to add'
  7392.                            PULL new_name
  7393.  
  7394.                            rc = RxVIMAddGroupMember(AddrBkPtr,'',gname,new_name)
  7395.                            if (rc > 0) then call vimerr
  7396.                         end  /* Do */
  7397.                      otherwise
  7398.                      end  /* select */
  7399.  
  7400.                      /* End the loop if no more entries */
  7401.                      if emore = 'False' then do
  7402.                         Say 'All entries for this group have been retrieved'
  7403.                         eaction = 'X'
  7404.                      end  /* Do */
  7405.  
  7406.                 end /* Do */
  7407.  
  7408.                 /* Close the  address book */
  7409.                 rc = RxVIMCloseAddressBook(AddrBkPtr)
  7410.                 if (rc > 0) then call vimerr
  7411.  
  7412.              end  /* Do */
  7413.              when TRANSLATE(SUBSTR(action,1,1)) = 'F' then do
  7414.                 /* Create a new group entry in this address book */
  7415.  
  7416.                 Say '--------------------------------------------------------'
  7417.                 Say 'Enter the group name'
  7418.                 Pull gname
  7419.                 Say
  7420.                 Say 'Adding' gname 'to the addressbook'
  7421.                 Say '--------------------------------------------------------'
  7422.  
  7423.                 /* Open the addressbook */
  7424.                 rc = RxVIMOpenAddressBook(Session,AddrName.1,'AddrBkPtr')
  7425.                 if (rc > 0) then call vimerr
  7426.  
  7427.                 /* Create the description stem for the create */
  7428.                 attrItem.0 = 1
  7429.                 attrItem.1.Selector = 'VIMSEL_NAME'
  7430.                 attrItem.1.Value    = gname
  7431.  
  7432.                 /* Add the entry to the address book */
  7433.                 rc = RxVIMCreateAddressBookEntry(AddrBkPtr,'VIMSEL_GROUP','attrItem')
  7434.                 if (rc > 0) then call vimerr
  7435.  
  7436.                 /* Close the address book */
  7437.                 rc = RxVIMCloseAddressBook(addrBkPtr)
  7438.                 if (rc > 0) then call vimerr
  7439.  
  7440.              end  /* Do */
  7441.              when TRANSLATE(SUBSTR(action,1,1)) = 'L' then do
  7442.                 /* Search for an entry in this address book */
  7443.  
  7444.                 Say '--------------------------------------------------------'
  7445.                 Say 'Enter the name to change location'
  7446.                 Pull ename
  7447.                 Say
  7448.                 Say 'Searching for' ename 'in the addressbook'
  7449.  
  7450.                 /* Open the addressbook */
  7451.                 rc = RxVIMOpenAddressBook(Session,AddrName.1,'AddrBkPtr')
  7452.                 if (rc > 0) then call vimerr
  7453.  
  7454.                 /* Create the description stem for the create */
  7455.                 searchon = 'VIMSEL_NAME'
  7456.                 epos     = ''
  7457.                 matchby  = 'VIMSEL_FULL'
  7458.                 enumb    = ''
  7459.  
  7460.                 /* Search for the entry in the address book */
  7461.                 rc = RxVIMMatchAddressBook(AddrBkPtr,searchon,ename,matchby,'epos','enumb')
  7462.                 if (rc > 0) then do
  7463.                     /* Entry not found */
  7464.                     Say '--------------------------------------------------------'
  7465.                     Say '  Entry not found in the addressbook'
  7466.                     Say '--------------------------------------------------------'
  7467.                 end  /* Do */
  7468.                 else do
  7469.  
  7470.                     /* Get additional info about specific entry */
  7471.                     itemdesc.0 = 3
  7472.                     itemdesc.1.selector = 'VIMSEL_LOCATION'
  7473.                     itemdesc.1.buffer   = 'location'
  7474.                     itemdesc.2.selector = 'VIMSEL_ADDRESS'
  7475.                     itemdesc.2.buffer   = 'address'
  7476.                     itemdesc.3.selector = 'VIMSEL_TYPE'
  7477.                     itemdesc.3.buffer   = 'typebuf'
  7478.  
  7479.                     rc = RxVIMGetABEntryAttributes(addrBkPtr,epos,'','itemdesc')
  7480.                     if (rc > 0) then call vimerr
  7481.  
  7482.                     Say '--------------------------------------------------------'
  7483.                     Say '  Name     -' ename
  7484.                     Say '  Ref No   -' epos
  7485.                     Say
  7486.                     Say '  Address  -' address
  7487.                     Say '  Type     -' typebuf
  7488.                     Say '  Location -' location
  7489.                     Say '--------------------------------------------------------'
  7490.                 end  /* Do */
  7491.                 Say 'Enter new location - (L)ocal, (R)emote, (M)obile or enter for no change'
  7492.                 PULL nlocation
  7493.  
  7494.                 if LENGTH(STRIP(nlocation)) > 0 then do
  7495.  
  7496.                     itemdesc.0 = 1
  7497.                     itemdesc.1.selector = 'VIMSEL_LOCATION'
  7498.  
  7499.                     /* Set value of new location from input */
  7500.                     Select
  7501.                        when TRANSLATE(SUBSTR(nlocation,1,1)) = 'L' then
  7502.                          itemdesc.1.value = 'VIMSEL_LOCAL'
  7503.                        when TRANSLATE(SUBSTR(nlocation,1,1)) = 'R' then
  7504.                          itemdesc.1.value = 'VIMSEL_REMOTE'
  7505.                        when TRANSLATE(SUBSTR(nlocation,1,1)) = 'M' then
  7506.                          itemdesc.1.value = 'VIMSEL_DIALIN'
  7507.                     otherwise
  7508.                          itemdesc.1.value = location
  7509.                     end  /* select */
  7510.                     itemdesc.1.buffer   = 'location'
  7511.  
  7512.                     /* Call function to set location */
  7513.                     rc = RxVIMSetABEntryAttributes(addrBkPtr,epos,'','itemdesc')
  7514.                     if (rc > 0) then call vimerr
  7515.  
  7516.                 end  /* Do */
  7517.  
  7518.                 /* Close the address book */
  7519.                 rc = RxVIMCloseAddressBook(addrBkPtr)
  7520.                 if (rc > 0) then call vimerr
  7521.  
  7522.              end  /* Do */
  7523.           otherwise
  7524.           end  /* select */
  7525.  
  7526.           if more = 'False' then do
  7527.              Say 'All Address Books have been retrieved'
  7528.              action = 'X'
  7529.           end  /* Do */
  7530.  
  7531.      end /* do */
  7532.  
  7533. /* Close the session with the postoffice */
  7534. rc = RxVIMCloseSession(Session)
  7535. if (rc > 0) then call vimerr
  7536.  
  7537.  
  7538. /* Terminate the active VIM subsystem connection */
  7539. rc = RxVIMTerminate()
  7540. if (rc > 0) then call vimerr
  7541. signal done
  7542.  
  7543.  
  7544. /***** VIMErr *******/
  7545.  
  7546. /* If an error occurs, this function will return the text */
  7547. /* associated with the error.  Extended text may be       */
  7548. /* displayed if it exists for the specified error.        */
  7549.  
  7550. VIMERR:
  7551.  
  7552. erc = RxVIMStatusText(Session,rc,'Status')
  7553. Say
  7554. Say '|-Error Information ------------------------------------|'
  7555. Say '  Error Text -' status.1
  7556. Say
  7557. Say '  Ext Status -' status.2
  7558. rc = RxVIMTerminate()
  7559. signal done
  7560.  
  7561.  
  7562. /* The done section will unload the RexxVIM extensions */
  7563. /* and exit the program                                */
  7564. DONE:
  7565. /*** Drop all of the external functions ***/
  7566. call RxVIMDropFuncs
  7567. Say '|-------------------------------------------------------|'
  7568. Say 'Demo Complete.  All functions released'
  7569. 'pause'
  7570. exit
  7571.