string

Syntax

s := string(a<,i_width><,s_fill><,i_prec><,s_format>)

Creates a string type.

How the string is created depends on the arguments provided. In general, the first parameter a will be converted to a string.

If i_width is provided, the string will be at least that many characters in length. If negative, the value is left-aligned. The string will be padded with spaces unless s_fill is provided, in which case it will be padded with that character.

If the type uses floating point formatting (float or vector), then i_prec and s_format will be active as well.
  • i_prec controls the digits of precision.

  • s_format controls the floating point formation. This defaults to ‘g’, meaning lower case optimal. The options are ‘G’, ‘f’ or ‘F’ for floating point formation or ‘e’ or ‘E’ for exponential notation.

Vector types will be converted into the format (x,y) or (x,y,z), where each component will use the floating point format specified.

Returns:

s - A new string type

Arguments:

a - A type to convert to a string i_width - width of the string created. If negative, the value is left-aligned. The default value is 0, indicating minimum necessary size. s_fill - pad character. Defaults to space. i_prec - digits of precision for output. Used only for float types. The default value is the current system precision (see the model precision command). s_format - floating point format. Used only for float types.