TipcMsgSetCurrent set the current field of a message
msg
message to set current field for
field_num
field number (0
indicates the first field)
TRUE
if the current field was successfully set for the message, FALSE
otherwise.
If TipcMsgSetCurrent fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcMsgSetCurrent sets the current field of a message. TipcMsgSetCurrent does not change the number of fields in the message. Any new fields are still appended to the message.
None
TipcMsgGetDeliveryMode, TipcMsgGetNumFields, TipcMsgSetNumFields, TipcMsgTraverse
This example creates a message, appends fields, reads the fields, sets the current field to the first field, and reads the fields again:
T_IPC_MT mt; T_IPC_MSG msg; T_STR str; T_REAL8 real8; mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); if (mt == NULL) {return
; /* error */
} msg = TipcMsgCreate(mt); if (msg == NULL) {return
; /* error */
} if (!TipcMsgAppendStrReal8(msg, "speed_limit", 65.0)) {return
; /* error */
} if (!TipcMsgNextStrReal8(msg, &str, &real8)) {return
; /* error */
} TutOut("str = %s, real8 = %s.\n", str, TutRealToStr(real8)); if (!TipcMsgSetCurrent(msg, 0)) {return
; /* error */
} if (!TipcMsgNextStrReal8(msg, &str, &real8)) {return
; /* error */
} TutOut("str = %s, real8 = %s.\n", str, TutRealToStr(real8));
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |