PutOption

Sets the value for the given name in the "option" properties. If there is an existing value present for the entity identified by the name, it is replaced. Option properties are the service-specific run-time options.

Syntax

ASCII Version
int putOption(Message* message,const char* name,
const char* value) 
Unicode Version
int putOption(Message* message,const UChar* name,
const UChar* value) 

Parameters

  • Message - the message to which this function applies
  • Name - with which the specified value is to be associated.
  • Value - to be associated with the specified name.

Results

Returns 0 (if successful) or error code.

Example

ASCII Version
int nRet;
Message* message = createMessage();
nRet = putOption( message, "OutputCasing", "M"); 
Unicode Version
int nRet; 
Message* message; 
// construct 16-bit string 
UChar option[32]; 
char* optionString="OutputCasing"; 

UChar optionValue[32]; 
char* optionValueString="M"; 

u_charsToUChars(optionString,	option,	strlen(optionString)); 
option[ strlen(optionString)]=0; 

u_charsToUChars(optionValueString,	optionValue, 
strlen(optionValueString)); 
optionValue [ strlen(optionValueString)]=0;	

message = createMessage(); 
nRet = putOption( message,	option, optionValue);