Main Content

Maximum identifier length

Specify maximum number of characters in identifiers

Model Configuration Pane: Code Generation / Identifiers

Description

Specify maximum number of characters in generated function, type definition, variable names.

Settings

31 (default) | integer

Minimum: 31
Maximum: 256

You can use this parameter to limit the number of characters in function, type definition, and variable names.

Tips

  • Consider increasing identifier length for models having a deep hierarchical structure.

  • When generating code from a model that uses model referencing, the Maximum identifier length must be large enough to accommodate the root model name, and possibly, the name-mangling text. A code generation error occurs if Maximum identifier length is too small.

  • This parameter must be the same for both top-level and referenced models.

  • When a name conflict occurs between a symbol within the scope of a higher level model and a symbol within the scope of a referenced model, the symbol from the referenced model is preserved. Name mangling is performed on the symbol from the higher level model.

Recommended Settings

ApplicationSetting
DebuggingValid value
Traceability>30
EfficiencyNo impact
Safety precaution>30

Programmatic Use

Parameter: MaxIdLength
Type: integer
Value: valid value
Default: 31

Version History

Introduced before R2006a