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