3.66 DM_SetValueIndex

With this function attributes of the tablefield object can be changed. The function can work with two indexes.

For the attributes valid for the relevant object type, please refer to the “Object Reference”.

DM_Boolean DML_default DM_EXPORT DM_SetValueIndex
(
  DM_ID objectID,
  DM_Attribute attr,
  DM_Value *index,
  DM_Value *data,
  DM_Options options;
)

Parameters

-> DM_ID objectID

Describes the object the attribute of which you want to change.

-> DM_Attribute attr

Describes the attribute to be changed. All valid attributes are defined in IDMuser.h

-> DM_Value *index

Specifies the data type of the index (enum, index) and its value.

-> DM_Value *data

In this parameter the value to be accepted by the attribute is to be transferred. You have to take care, however, to assign the correct element in this union. For information on the data type of the individual attributes, please refer to the “Attribute Reference”.

-> DM_Options options

Using this parameter you can control whether DM is to trigger the rule processing by setting the attribute successfully.

Option

Meaning

DMF_Inhibit

This option means that the function call is not to trigger any internal events. If this flag is set, you can achieve a better performance in case a lot of attribute changes have been made by the application.

DMF_ShipEvent

This option means that the function call is to trigger internal events. Then rules are triggered which have been defined for this object and which react to the changing of the specified attribute.

DMF_XlateString

The specified string is to be translated in the currently used language. This is of course only possible if the text already exists internally and if also a translation exists for it.

Return Value

TRUE

The attribute was set successfully.

FALSE

The attribute could not be set.

Example

A tablefield is to be filled row-wise by means of the function DM_SetValueIndex.

void DML_default DM_ENTRY SetTable __3(

  (DM_ID, tableID),

  (DM_Integer, Rows),

  (DM_Integer, Cols))

{

  DM_Value index,data;

  int row, column;

 

  index.type = DT_index;

  data.type = DT_string;

  data.value.string = "new string";

  for (row = 1; row <= (int) Rows; row++)

  {

    index.value.index.first = row;

    for (column = 1; column <= (int) Cols; column++)

    {

        index.value.index.second=column;

        DM_SetValueIndex(tableID, AT_content, &index, &data,

          DMF_Inhibit);

    }

  }

}