dynAppendConst()

The functions is comparable to the function dynAppend() but will not change the source variable that is appended.

Synopsis

int dynAppendConst(<dyn_type> &x, <type> &y );

int dynAppendConst(<dyn_type> &x, <dyn_type> &y );

Parameters

Parameter Meaning
x Field to which y is appended
y Const Value or dynamic field that is appended

Return Value

dynAppendConst() returns the length of the extended field x, -1 in the event of errors.

Errors

A message is issued in the event of missing or incorrect arguments or incorrect variable types.

Description

Appends y or all elements of y, provided that y is a dynamic field, to the field x. y may also be a dynamic field.

The data type of y must match that of x if y is a dynamic field. If y is not a dynamic type, i.e. a simple value, y is converted automatically to the data type of x. Compared to dynAppend() the variable that is appended is not changed.

Example

main()
{
  const dyn_string constDynString = makeDynString("x", "y");
  dyn_string result;
  const mapping constMapping = makeMapping("myKey", constDynString);
  dynAppendConst(result, constMapping["myKey"]);
}

Example

Assignment

Dynamic fields

Availability

CTRL