Programming Guide



sm_append_bundle_data

Sends data to a bundle item

int sm_append_bundle_data(char *bundle_name, int item_no, char *data);

bundle_name
The name of the bundle to get data. Supply NULL or an empty string to specify the unnamed bundle.

item_no
The bundle offset of the item to get data. You add data items to a bundle through successive calls to sm_append_bundle_item; each data item is identified by its offset in the bundle, where the first data item has an offset value of 1. If item_no already contains data, Panther appends data as the item's latest occurrence.

data
A single occurrence of data to append to item_no.

Returns

Description

sm_append_bundle_data sends a single occurrence of data to the specified data item in bundle_name. A bundle contains sequentially numbered data items, where each data item can hold one or more occurrences of send data for later access by sm_get_bundle_data. If the source data contains multiple occurrences, Panther ends each occurrence with a null string terminator.

This function assumes the existence of the specified bundle and item. Before calling this function, create the target bundle and its items with calls to sm_create_bundle and sm_append_bundle_item, respectively.

Example

/* Iterate over all fields on current screen and
* send data to bundle
*/
void sendScreenDataToBundle(int numFields)
{
int ret, i, item;
ret = sm_create_bundle("myBundle");
if (ret == 0)
{
sm_append_bundle_item("myBundle");
item = sm_bundle_item_count("myBundle");
for (i = 1; i <= numFields; i++)
{
sm_append_bundle_data("myBundle",
item, sm_i_fptr("mySend", i));
}
}
return 0;
}

See Also

sm_append_bundle_item