Function _storc() Foundation

Assigns a character string as the new value of a parameter.

Syntax
BOOL _storc(CHAR *cString,
            XppParamList pList, ULONG ulIndex, ...);
Parameters
CHAR *cString
NULL terminated C string which is copied into the parameter container.
XppParamList pList
Pointer to the Xbase++ parameter list, which is used to provide access to the parameter.
ULONG ulIndex
Position of the parameter which is to be changed (first parameter is 1).
...
The remaining arguments are only considered when the specified parameter is an array. They must be of ULONG type. To select an element of the array, an index is specified each array dimension. If the array value itself should be replaced, NULL must be specified as the first value. Note:The end of the array index list must be indicated by incorporating a NULL as the last value in the list.
Return

If the string could be copied successfully into the parameter, the function returns TRUE. If the return value is FALSE, not enough memory is available for the string to be copied.

Description

_storc() is used to assign a string as an Xbase++ character string to a parameter. The string is copied up to the first NULL character. This is normally used along with parameters passed by reference to return multiple values to the calling function. However, the changed parameters can also be checked again within the C function.

Examples
/* 
Assigns a string to the second parameter 
*/ 
#include <xpppar.h> 

if ( XPP_IS_ARRAY( _partype(<pList>, 1) ) ) 
/* 
   To overwrite an array value a NULL index must be indicated for the 
   array. 
*/ 
_storc("New Value", <pList>, 1, 0); 
else 
/* 
   Parameter is not an array, so the indication of a NULL index is 
   unnecessary. 
*/ 
_storc("New Value", <pList>, 1); 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.