PMDF Programmer's Reference Manual


Previous Next Contents Index


PMDFwriteText

Write a line of text to a message being enqueued.

PASCAL

status = PMDF_write_text (nq_context, text)

argument information
Argument Data type Access Mechanism
nq_context context pointer read/write reference
text descriptor read reference

C

status = PMDFwriteText (nq_context, text, text_len)

argument information


int PMDFwriteText(PMDF_nq **nq_context, 
                  char     *text, 
                  int       text_len) 


Arguments

nq_context

A message enqueue context created with PMDFstartMessageEnvelope.

text

String of text to write to the message. Can not exceed a length of 65,535 bytes.

text_len

Length in bytes of text.

Description

Text can be written to a message using PMDFwriteText or PMDFwriteLine. The only difference between these two routines is that PMDFwriteLine always appends a record terminator, line feed, to the end of each line it outputs. PMDFwriteText does not: it is left to callers of PMDFwriteText to include record terminators, where appropriate, in their text. This gives slightly more flexibility than PMDFwriteLine in that a single call can output multiple lines or multiple calls can output a single line. Note that each distinct line (record) in a message must be terminated with a line feed. If this terminator is omitted then, in the message being composed, the subsequent line will be appended directly to the end the line lacking a terminator. While this is merely a nuisance in a message body, it can introduce serious errors into the message header. Programs which loop reading lines from a queued message and writing them to a new message should use PMDFreadText and PMDFwriteText in their loop. This is more efficient than PMDFreadLine and PMDFwriteLine which will needlessly strip away and then re-append a record terminator for each line read and written.

Return Values

PMDF__OK Normal, successful completion.
PMDF__BADCONTEXT Illegal or corrupt context. Text not written.
PMDF__INVSTRDES Invalid string descriptor for text: descriptor has an invalid value in its DSC$B_CLASS field. Text not written.


Previous Next Contents Index