ssGetStringDataTypeMaxLength
Get maximum length of string data type
Syntax
size_t ssGetStringDataTypeMaxLength(SimStruct *S,int dataType)
Arguments
-
S
-
SimStruct representing an S-Function block.
-
dataType
-
数据类型的ID。
Returns
A value of type
size_T
, indicating the maximum length of the string.0
, if the string has no maximum length.
Description
ssGetStringDataTypeMaxLength
determines the maximum length (size_t
) of a string. The string has no maximum length ifssGetStringDataTypeMaxLength
is0
.
Limitations
Non-inlined S-functions that contain string SimStruct functions do not run with rapid accelerator mode.
Languages
C, C++
Example
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))); } ...
See Also
ssGetInputStringLength
,ssIsStringDataType
,ssReadInputString
,ssRegisterStringDataType
,ssWriteOutputString