Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client C API Programmer's Guide | API Reference | awSet | awSet<type>Field
 
awSet<type>Field
The awSet<type>Field functions have a general syntax:
BrokerError awSet<type>Field(
BrokerEvent event,
char *field_name,
<Field_Value_Type> value);
event
The event whose field is to be set.
field_name
Name of the destination event field to set.
value
The source value for the field. The field value is different depending on the function as follows:
*awSetBooleanField has a field value type of BrokerBoolean.
*awSetByteField has a field value type of char.
*awSetCharField has a field value type of char.
*awSetDateField has a field value type of BrokerDate.
*awSetDoubleField has a field value type of double.
*awSetFloatField has a field value type of float.
*awSetIntegerField has a field value type of int.
*awSetLongField has a field value type of BrokerLong.
*awSetLongFieldNative has a field value type of NativeLong. (Available only on platforms which support 64-bit integral representations.)
*awSetShortField has a field value type of short.
*awSetStringField has a field value type of char *.
*awSetUCCharField has a field value type of charUC.
*awSetUCStringField has a field value type of charUC *.
The awSet<type>Field function sets the destination event field field_name to the source value. Event field values may be set in any order. To set an entire sequence field in a single function call, use awSet<type>SeqField.
See Specifying Field Names for complete information on specifying field_name.
The following sample code sets two event fields, one with a float value and the other with a string value:
err = awSetFloatField (event, "xfield", x)
err = awSetStringField (event, "ssfield", "The value")
Note:
Attempting to set an event field with a type that does not match the event's definition will result in an error being returned. No error will be returned if awSetStringField is used to set a field whose type is FIELD_TYPE_UNICODE_STRING. In these cases, the ANSI string that is supplied to awSetStringField will automatically be converted to a unicode string.
Possible BrokerError major codes
Meaning
AW_ERROR_FIELD_NOT_FOUND
The event is associated with a Broker client and field_name does not exist in the event.
AW_ERROR_FIELD_TYPE_MISMATCH
The field's type does not match the type of value or the field_name incorrectly accesses a type, such as using a subscript on a non-sequence field.
AW_ERROR_INVALID_EVENT
The event is invalid.
AW_ERROR_INVALID_FIELD_NAME
The field_name is invalid.
AW_ERROR_NULL_PARAM
The parameter field_name is NULL.
See also: