Open topic with navigation

TIBCO Rendezvous® 8.7.0

# Add Scalar

Convenience Functions

## Declaration

    tibrv_status
    tibrvMsg_AddScalar_type(
       tibrvMsg       message,
       const char*    fieldName,
       scalar_type     value);
    tibrv_status
    tibrvMsg_AddScalar_typeEx(
       tibrvMsg       message,
       const char*    fieldName,
       scalar_type     value,
       tibrv_i16      fieldId);

## Purpose

Add a field containing a scalar value.

Function Name | Field Value Type | Type Description
`tibrvMsg_Add` `Bool` | `tibrv_``bool` | boolean
`tibrvMsg_Add` `F32` | `tibrv_``f32` | 32-bit floating point
`tibrvMsg_Add` `F64` | `tibrv_``f64` | 64-bit floating point
`tibrvMsg_Add` `I8` | `tibrv_``i8` | 8-bit integer
`tibrvMsg_Add` `I16` | `tibrv_``i16` | 16-bit integer
`tibrvMsg_Add` `I32` | `tibrv_``i32` | 32-bit integer
`tibrvMsg_Add` `I64` | `tibrv_``i64` | 64-bit integer
`tibrvMsg_Add` `U8` | `tibrv_``u8` | 8-bit unsigned integer
`tibrvMsg_Add` `U16` | `tibrv_``u16` | 16-bit unsigned integer
`tibrvMsg_Add` `U32` | `tibrv_``u32` | 32-bit unsigned integer
`tibrvMsg_Add` `U64` | `tibrv_``u64` | 64-bit unsigned integer
`tibrvMsg_Add` `IPAddr32` | `tibrv_``ipaddr32` | 4-byte IP address
`tibrvMsg_Add` `IPPort16` | `tibrv_``ipport16` | 2-byte IP port

Parameter | Description
`message` | Add the new field to this message.
`fieldName` | Create the new field with this name.
`value` | Add a new field with this value (which may be a literal or stored in a variable). The convenience function must correspond to the datatype of this value. We recommend casting the data to match the convenience function. The function copies the value into the new message field.
`fieldId` | Create the new field with this identifier. Zero is a special value that signifies no field identifier. All non-zero field identifiers must be unique within each message. It is illegal to add a field that has both a `NULL` field name, and a non-zero field identifier.

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.