TipcMsgNextReal4


Name

TipcMsgNextReal4 — get a REAL4 field from a message

Synopsis

T_BOOL TipcMsgNextReal4(msg, real4_return) 
T_IPC_MSG msg; 
T_REAL4 *real4_return; 

Arguments

msg — message to get field from

real4_return — storage for REAL4 value from field

Return Values

TRUE if the field was successfully retrieved from the message, FALSE otherwise.

Diagnostics

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

Description

TipcMsgNextReal4 retrieves the value of the current field of a message, which must be a REAL4 (four-byte real number) field. If TipcMsgNextReal4 succeeds, it advances the current field to the next field in the message.

Caution

If TipcMsgNextReal4 returns FALSE, it does not store a value in real4_return.

TipcMsgNextReal4 converts the field into the data format used by this process if necessary.

See Also

TipcMsgAppendReal4

Examples

This example creates a message, appends a REAL4 field, and reads the field back from the message:

T_IPC_MT mt; 
T_IPC_MSG msg; 
T_REAL4 real4_val; 
 
#define USER_MT_REAL4_TEST 100 
mt = TipcMtCreate("real4_test", USER_MT_REAL4_TEST, "real4"); 
if (mt == NULL) { 
  return;  /* error */ 
} 
 
msg = TipcMsgCreate(mt); 
if (msg == NULL) { 
  return;  /* error */ 
} 
 
if (!TipcMsgAppendReal4(msg, 42.0)) { 
  return;  /* error */ 
}  
if (!TipcMsgSetCurrent(msg, 0)) { 
  return;  /* error */ 
}  
if (!TipcMsgNextReal4(msg, &real4_val)) { 
  return;  /* error */ 
}  
TutOut("real4_val = %s\n", TutRealToStr(real4_val)); 

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