home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / database / powerbase / docs / impulse < prev    next >
Encoding:
Text File  |  1995-08-21  |  4.9 KB  |  117 lines

  1. Appendix A − Powerbase as an Impulse server
  2.  
  3. The following is a description of the Impulse “methods” understood by
  4. Powerbase, given in the standard format recommended by Computer Concepts.
  5. Users wishing to write their own Impulse tasks to communicate with Powerbase
  6. will need this information. They will also need details of the SWIs to which
  7. Impulse will respond, and this information is obtainable from Computer
  8. Concepts.    
  9.  
  10.         {methods:       GetPathname 
  11.  
  12.                 Selection <string>
  13.  
  14.                 ParseQuery <string>
  15.  
  16.                 GetField <tag>
  17.  
  18.                 GetRecord
  19.  
  20.                 PutFile
  21.  
  22.                 ExpandCode <string>
  23.  
  24.                 GetExpanded <string>
  25.  
  26.                 NextMatch
  27.  
  28. Description:
  29.  
  30. GetPathname specifies an “object” i.e. a Powerbase database. If Powerbase
  31. has the required database open it replies with the full pathname of the
  32. object, otherwise it returns an error message. Example of use:−
  33.  
  34. :Powerbase !Elements GetPathname  (returns pathname of !Elements)
  35.  
  36. R6 points to pathname when calling task is decoding reply.
  37.  
  38. Selection <string> tells Powerbase about a field, or group of fields, in
  39. which the caller is interested. The fields are specified as a list of tags,
  40. separated by any suitable character (e.g. “/” or “,”). The same separator
  41. must appear at the very end of the tag-list.  Powerbase replies with the
  42. maximum data-length of the combined fields in the selection. Example of
  43. use:−
  44.  
  45.   :Powerbase Selection NAME/SYM/Z/
  46.  
  47. R6 points to a string which gives data-length.
  48.  
  49. ParseQuery <string> informs Powerbase of the criteria to be used in
  50. selecting records to transmit to the caller.  The parameter is a standard
  51. Powerbase search formula and Powerbase replies with the title which would
  52. normally appear at the head of one of its printed lists. Example of use:−
  53.  
  54. :Powerbase ParseQuery GP=T
  55.  
  56. R6 points to returned title.
  57.  
  58. GetField <tag> requests from Powerbase the data in the specified field of
  59. the next record which matches the preceding ParseQuery command.  When
  60. Powerbase replies to the GetField command the calling task should respond
  61. with an Impulse_FetchData, specifying the address and length of the buffer
  62. to be used, and then wait for an Impulse_receive event (reason code &204)
  63. before reading the buffer.  Example of use:−
  64.  
  65. :Powerbase GetField NAME
  66.  
  67. GetRecord [<key>] (The square brackets signify that the key is optional:
  68. they are not part of the command.) Sent without a key it requests from
  69. Powerbase the next record which matches the preceding ParseQuery command. If
  70. the primary key of a record in the database is appended then Powerbase will
  71. return the record corresponding to that key. The key must be separated from
  72. the GetRecord by a space. The calling task must follow the procedure
  73. described above for GetField.  Powerbase will transmit the fields specified
  74. in the Selection command, using the same separator as was used in that
  75. command. Receipt of data may be followed by another GetRecord command,
  76. returning the next matching record and so on, a zero-length response
  77. signifying that there are no more matching records. If using keys to request
  78. specific records you should end by sending *** as a key to tell Powerbase
  79. that the dialogue is finished.  This command and the one below operate only
  80. on Subfile 0 of the Powerbase database. Example of use:−
  81.  
  82. :Powerbase GetRecord ACTI
  83.  
  84. PutRecord informs Powerbase that the caller wishes to write a record to the
  85. current Powerbase database. It should be sent as message type &200. A
  86. Selection command should have been previously sent to tell Powerbase what
  87. fields to expect and what separator is to be used. Powerbase will then reply
  88. with a GetRecord command (reason code &201) which the caller should
  89. acknowledge with message type &202, specifying the maximum length of the
  90. data which will be sent. Wait for event &203 which is a request by Powerbase
  91. for the caller to transmit the data. The caller should then do so with
  92. Impulse_TransmitData, specifying the buffer address and the length of data
  93. being sent. This may be immediately followed by  another PutRecord.
  94.  
  95. ExpandCode <string> requests the expanded form of a code used in a field
  96. linked to a validation table. The parameter string consists of the code
  97. itself, then a space, then the name of the validation table with the column
  98. number appended. Example of use:−
  99.  
  100. :Powerbase ExpandCode T Group0
  101.  
  102. GetExpanded <string> combines the functions of GetField and ExpandCode, i.e.
  103. it requests the expanded form of the contents of a specified field. The
  104. parameter string is similar to that for ExpandCode, except that the field
  105. tag is substituted for the code. Example of use:−
  106.  
  107. :Powerbase GetExpanded GP Group0
  108.  
  109. NextMatch is designed to remove the restriction whereby only the data from a
  110. single record can be merged into a given document.  All it does is tell
  111. Powerbase to access the next record matching the search formula in the Merge
  112. window and interpret subsequent Merge commands by taking data from that
  113. record.
  114.  
  115. }
  116.  
  117.