GetMessage Method  
 

The GetMessage method retrieves a specific message prompt and response from the client history using a message identifier.

Syntax

object.GetMessage( MessageId, [Prompt], [Response], [Timestamp] )

Parameters

MessageId
An Integer value which identifies a specific message and response. This value must be greater than zero.
Prompt
An optional String passed by reference. When the method returns, this parameter will contain the message prompt for the specified message in the conversation history. If this parameter is omitted, the method will not return the message prompt text. You cannot omit both this parameter and the Response parameter.
Response
An optional String passed by reference. When the method returns, this parameter will contain the response for the specified message in the conversation history. If this parameter is omitted, the method will not return the response text. You cannot omit both this parameter and the Prompt parameter.
Timestamp
An optional String or Date parameter passed by reference. When the method returns, this parameter will contain the local date and time the response was returned by the server. If this parameter is a String, the timestamp is returned as a local date and time formatted for the current user's locale. If the parameter is a Date, the value is returned as a local date and time. If no timestamp is available, a String parameter receives an empty string and a Date parameter receives a value of zero. If this information is not required, this parameter can be omitted.

Return Value

A value of True is returned if the method succeeds. If the method fails, it will return False and the LastError property will contain the error code.

Remarks

The GetMessage method retrieves a specific message prompt and its associated response from the client session history. This method can be used when an application has stored a message identifier or has obtained one using methods such as FindMessage. Message identifiers are returned when sending requests using the SendMessage method.

If message history has been disabled, the control does not retain previous messages. However, the most recent prompt and response are still available and may be retrieved specifying its message identifier. Applications that need to preserve this information should make a copy of the data before issuing another request.

Message identifiers are unique only within the client session that created them. They are not guaranteed to be unique across different client sessions, processes, or future executions of the application. Applications should treat message identifiers as opaque values and should not make assumptions about how they are assigned internally. It is guaranteed, however, that newer messages will always be assigned larger message identifier values than older messages within the same session.

If the specified message identifier does not match a message currently stored in the client history, the method fails. This can occur if the message has been removed because the history was cleared or trimmed.

See the Response property for additional information about text formatting and Unicode handling for model responses.

See Also

Prompt Property, Response Property, FindMessage Method, GetFirstMessage Method, GetNextMessage Method, SendMessage Method