Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client C API Programmer's Guide | Creating and Initializing Events | Regular Data Fields | Setting Regular Data Fields
 
Setting Regular Data Fields
Several functions are provided for setting a regular data field, based on it's type. These functions are described in awSet<type>Field. The source value for the field being set depends on the field's type, as shown below.
Function Name
Value Type
BrokerBoolean
char
char
BrokerDate
double
float
long
BrokerLong
short
char *
charUC
charUC *
The following example contains an excerpt from the publish1.c sample application that shows the use of the awSetIntegerField function. The function takes the following parameters:
*A BrokerEvent reference.
*The name of the event field to be set.
*The value for the field.
long count;
. . .
count = 1;
err = awSetIntegerField(e, "count", count);
if (err != AW_NO_ERROR) {
printf("Error on setting event field\n%s\n",
awErrorToString(err));
return 0;
}
If you attempt to set a field with a value that does not match its defined type, an error may be returned. Type checking will not occur if the event whose field is being set was created without a Broker client context, as described on Field Type Checking.