TipcMsgNextStrReal8


Name

TipcMsgNextStrReal8 — get a STR field and a REAL8 field from a message

Synopsis

T_BOOL TipcMsgNextStrReal8(msg, str_return, real8_return) 
T_IPC_MSG msg; 
T_STR *str_return; 
T_REAL8 *real8_return; 

Arguments

msg — message to get fields from

str_return — storage for STR value from field

real8_return — storage for REAL8 value from field

Return Values

TRUE if the fields were successfully retrieved from the message, FALSE otherwise.

Diagnostics

If TipcMsgNextStrReal8 fails, it returns FALSE and sets the global SmartSockets error number to one of:

Description

TipcMsgNextStrReal8 is a convenience function that retrieves both a STR field and a REAL8 field from a message. TipcMsgNextStrReal8 is useful for accessing NUMERIC_DATA messages. The NUMERIC_DATA message type is often the most frequently used message type in SmartSockets.

TipcMsgNextStrReal8 converts the field into the data formats used by this process if necessary.

Caution

If TipcMsgNextStrReal8 returns FALSE, it does not store values in str_return and real8_return.

Do not modify the value stored in str_return. It points directly into an internal data structure.

See Also

TipcMsgAppendStrReal8

Examples

This example creates a message, appends STR and REAL8 fields, and reads the fields back from the message:

T_IPC_MT mt; 
T_IPC_MSG msg; 
T_STR str_val; 
T_REAL8 real8_val; 
 
mt = TipcMtLookupByNum(T_MT_NUMERIC_DATA); 
if (mt == NULL) { 
  return;  /* error */ 
}  
msg = TipcMsgCreate(mt); 
if (msg == NULL) { 
  return;  /* error */ 
}  
 
if (!TipcMsgAppendStrReal8(msg, "speed_limit", 55.0)) { 
  return;  /* error */ 
}  
if (!TipcMsgSetCurrent(msg, 0)) { 
  return;  /* error */ 
}  
if (!TipcMsgNextStrReal8(msg, &str_val, &real8_val)) { 
  return;  /* error */ 
}  
TutOut("str_val = %s, real8_val = %s\n", 
       str_val, TutRealToStr(real8_val)); 

TIBCO SmartSockets™ Application Programming Interface
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com