Using conversion specifications – Echelon NodeBuilder Resource Editor User Manual

Page 68

Advertising
background image

<text format list>

= <text format list> ',' <text format>

= <text format>

<text format>

= '(' <condition> '?' <text format group> ':'

<text format group> ')'
= '(' <text format string> ',' <field spec list> ')'
= 'time' '(' < field spec string > ',' < field spec string >
[',' < field spec string >]
[',' < field spec string >] ')'
= 'date' '(' <field spec string> ',' <field spec string> ','
<field spec string> ')'

<condition>

= '(' <field spec string> <conditional

operator> <decimal const> ')'

<conditional operator> = '=='

= '!='

<field spec list>

= <field spec list> ',' <field spec with

modifiers>
= <field spec with modifiers>

<field spec with modifiers> = <field spec with multiplier and

adder> <string resource reference>
= <field spec with multiplier and adder>

<field spec with multiplier and adder>

= <field spec string>

<multiplier> <adder>
= <multiplier><adder>
= <field spec string>

<field spec string>

= <field spec string> '.' <field name>

= <field name>

<string resource reference> = '(' <mode> ':' <index> ')'

Using Conversion Specifications

You can use a conversion specification within a format string to specify how the value of a
field should be formatted. To format a field, append the field name in the text format list

after the format string. Include one field name for each conversion specification in the
list. The conversion specifications are applied to the field names from left to right. You

can specify the following conversion specifications

%c

A single character. The base type in Neuron C must be char, int, or enum.

%d

A signed or unsigned decimal number (based on the signedness defined in the
type file). The base type must be a Neuron C char, int, long, bitfield, or enum.

%f

A floating point number. The base type must be a Neuron C char, int, long,
float, or enum.

%m

An enumeration. The base type must be an enumerated list. If an
enumeration does not exist for the value, the format string is processed as if

it were %d.

%s

A null-terminated string. The base type must be an array of 8-bit data.
String data must be null terminated.

%x

An unsigned hexadecimal integer. The size is determined from the type file.

The data are always treated as unsigned. The base type must be char, int,

60

Creating and Modifying Resources

Advertising