dpSetUnit()

Sets the unit of a DP element.

Synopsis

int dpSetUnit(string dp, langString dpUnit);

Parameters

Parameter Meaning
dp Data point
dpUnit Unit (for example, kg) in one or several languages.

Return Value

If OK the value is 0, in the event of an error -1.

Errors

Errors can be retrieved with getLastError(). An error message is issued in the event of incorrect DPs or missing arguments!

Description

The unit can be modified using the CTRL function dpSetUnit().

Example

Sets the unit m².

main()
{
  dpSetUnit("mld_float.", "m²");
}

Example

Sets two different units EUR and USD for two different languages German and English.

main()
{
  langString c;

  setLangString(c,0,"EUR");
  setLangString(c,1,"USD");

  dpSetUnit("integer_1.",c);
}

Assignment

Data point function

Availability

CTRL