Get maximum length of string data type
size_t ssGetStringDataTypeMaxLength(SimStruct *S,int dataType)
S
SimStruct representing an S-Function block.
dataType
ID of data type.
A value of type size_T
, indicating the maximum length
of the string.
0
, if the string has no maximum length.
ssGetStringDataTypeMaxLength
determines the maximum length
(size_t
) of a string. The string has no maximum length if
ssGetStringDataTypeMaxLength
is 0
.
C, C++
This example gets the maximum length of a string.
... { if(ssGetStringDataTypeMaxLength(S, ssGetInputPortDataType(S, 0)) == 0) ssSetOutputPortDataType(S, 0, ssRegisterStringDataType(S, 0)); else ssSetOutputPortDataType(S, 0, ssRegisterStringDataType(S, ssGetStringDataTypeMaxLength(S, ssGetInputPortDataType(S, 0)) + mxGetN(INSSTR))); } ...
ssGetInputStringLength
, ssIsStringDataType
, ssReadInputString
, ssRegisterStringDataType
, ssWriteOutputString