qie.createTextMessage¶
Signature: qie.createTextMessage(value*, encoding*)
Returns: Text Message message - the newly created message object
Replace the current message with an empty Plain Text formatted message.
Note
The return value MUST ALWAYS be assigned to the bound-in message object.
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| String or byte[] | value* | (optional) the initial message value as a string or byte array | null |
| String | encoding* | (optional) the character encoding for this message | Source Node encoding |
Example¶
// createTextMessage examples:
// Example: value as String
message = qie.createTextMessage(
"I like simple text messages.",
"UTF-8"
);
// Example: value as byte[]
var textBytes = [
72,101,108,108,111,32,84,101,120,116,32,77,101,115,115,97,103,101
]; // "Hello Text Message"
message = qie.createTextMessage(
textBytes,
"UTF-8"
);
// Example: no value provided
message = qie.createTextMessage();