Open topic with navigation

TIBCO Rendezvous® 8.7.0

# Message.AddField

Method

## Visual Basic

    Overloads Public Sub AddField(
        ByVal messageField As MessageField)
    Overloads Public Sub AddField(
        ByVal fieldName As String,
        ByVal fieldValue As value_type)
    Overloads Public Sub AddField(
        ByVal messageField As MessageField,
        ByVal fieldValue As value_type,
        ByVal fieldId As UInt16)

## C#

    public void AddField(MessageField messageField);
    public void AddField(
        string fieldName,
        value_type  fieldValue);
    public void AddField(
        string fieldName,
        value_type  fieldValue,
        ushort fieldId);

## Purpose

Add a field to a message.

## Overloading

This method has many overloads. Message.add Overloads by Category classifies them into three main categories (based on the number of parameters). Message.add Homologous Types documents the automatic conversion from types in Visual Basic and C# to homologous types within the resulting field in Rendezvous wire format.

Message.add Overloads by Category

Signature | Description
`messageField` | The parameter is a message field object, which fully specifies the field—including its name, type, value, and field identifier; see MessageField.
`fieldName,``fieldValue` | Overloads with two parameters add fields without identifiers. The first parameter specifies the name of the new field. Fields without identifiers must have non-null names. The second parameter specifies both the type of the field and its data; see also Message.add Homologous Types.
`fieldName,``fieldValue,``fieldId` | Overloads with three parameters add fields with identifiers. The first parameter specifies the name of the new field. A field with an identifier may have a null name. The second parameter specifies both the type of the field and its data; see also Message.add Homologous Types. The third parameter specifies the field identifier. All field identifiers must be unique within each message. Integers in the range [`1`, `65535`] are valid arguments for this parameter.

Message.add Homologous Types

Visual Basic Value Type | C# Value Type | Rendezvous Wire Format Type
Message | Message | `TIBRVMSG_``MSG`
`Date` | `DateTime` | `TIBRVMSG_``DATETIME`
Opaque | Opaque | `TIBRVMSG_``OPAQUE`
`String` | `string` | `TIBRVMSG_``STRING`
`XmlDocument` | `XmlDocument` | `TIBRVMSG_``XML`
## Scalar Types
`Boolean` | `bool` | `TIBRVMSG_``BOOL`
`SByte` | `sbyte` | `TIBRVMSG_``I8`
`Byte` | `byte` | `TIBRVMSG_``U8`
`Short` | `short` | `TIBRVMSG_``I16`
`UInt16` | `ushort` | `TIBRVMSG_``U16`
`Integer` | `int` | `TIBRVMSG_``I32`
`UInt32` | `uint` | `TIBRVMSG_``U32`
`Long` | `long` | `TIBRVMSG_``I64`
`UInt64` | `ulong` | `TIBRVMSG_``U64`
`Single` | `float` | `TIBRVMSG_``F32`
`Double` | `double` | `TIBRVMSG_``F64`
IPPort | IPPort | `TIBRVMSG_``IPPORT16`
`IPAddress` | `IPAddress` | `TIBRVMSG_``IPADDR32`
## Array Types The `add` method copies the array into the field.
`SByte()` | `sbyte` | `TIBRVMSG_``I8ARRAY`
`Byte()` | `byte[]` | `TIBRVMSG_``U8ARRAY`
`Short()` | `short[]` | `TIBRVMSG_``I16ARRAY`
`UInt16()` | `ushort[]` | `TIBRVMSG_``U16ARRAY`
`Integer()` | `int[]` | `TIBRVMSG_``I32ARRAY`
`UInt32()` | `uint[]` | `TIBRVMSG_``U32ARRAY`
`Long()` | `long[]` | `TIBRVMSG_``I64ARRAY`
`UInt64()` | `ulong[]` | `TIBRVMSG_``U64ARRAY`
`Single()` | `float[]` | `TIBRVMSG_``F32ARRAY`
`Double()` | `double[]` | `TIBRVMSG_``F64ARRAY`
`Message()` | `Message[]` | `TIBRVMSG_``MESSAGEARRAY`
`String()` | `String[]` | `TIBRVMSG_``STRINGARRAY`

## Field Name Length

The the longest possible field name is 127 bytes.

## Nested Message

When the `fieldValue` argument (that is, the second parameter) is a message object, this method adds only the data portion of the nested message; it does not include any address information or certified delivery information.

## Date & Time Representations

Rendezvous software represents time values in two ways—one within programs, and a more compact wire format within messages. In both representations, zero denotes the epoch, 12:00 midnight, January 1st, 1970.

Rendezvous wire format represents time as a two-part value—seconds as a 40-bit signed integer, plus microseconds as a 24-bit unsigned integer. This representation yields the effective range detailed in Date and Time Ranges in Rendezvous Wire Format. Range limits denote the extreme value on either side of zero (the epoch). Bold type indicates the primary unit of measurement.

Date and Time Ranges in Rendezvous Wire Format

range in years | `17,432`
range in seconds | ``549,755,813,887``
range in milliseconds | `549,755,813,887,000`

## See Also

Message.AddStringAsXml

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.