31 record

By means of the record objects, any structure can be built in the rules.

These record objects can be defined directly as children of the dialog (globally available) or as children of arbitrary other objects.

record objects can also be defined for models and are passed on to instances.

A record can contain user-defined attributes as well as subrecords.

Definition

{ export | reexport } { model } record <Identifier>
{
  <hierarchy attributes>
  <object-specific attributes>
  [ <definition of user-defined attribute> ; ]
  [ { export | reexport } record <Identifier> <record definition> ]
}

Events

none

Children

document

record

transformer

Parent

all objects

Menu

none

31.1 Attributes

Attribute

RSD

PSD

Properties

Short Description

.class

class

class

-,G/-/-

object class

.configurable

boolean

boolean

S,G/D/C

configurability via profile

.control

identifier

instance

-,G/-/-

control the object currently belongs to

.dialog

identifier

instance

-,G/-/-

object dialog

.document[integer]

object document S,G/-/-

accesses the I-th XML Document

.external

boolean

boolean

-,G/-/-

returns if the object class is an USW class

.external[integer]

class

class

-,G/-/-

returns the I-th registered USW class

.firstrecord

object

record

S,G/-/C

accesses the first record of an object

.groupbox

identifier

instance

-,G/-/-

groupbox the object currently belongs to

.index

integer

integer

-,G/-/-

current index of object in child list of its parent

.itemorder

string

string

-,G/-/-

order of child records and attributes

.label

string

string

S,G/D/C

name (identifier) of object

.lastrecord

object

record

S,G/-/C

accesses the last record of an object

.layoutbox

object

object

-,G/-/-

layoutbox of object

.member[integer]

attribute

attribute

-,G/-/-

i-th user-defined attribute of object

.membercount

integer

integer

-,G/-/-

number of user-defined attributes

.model

identifier

instance

S,G/D/C

model belonging to object

.notepage

identifier

instance

-,G/-/-

notepage the object currently belongs to

.parent

identifier

instance

S,G/-/-

parent of object

.record[integer]

object

record

S,G/-/C

accesses the I-th record of an object

.recordcount

integer

integer

-,G/-/-

queries the number of child records

.scope

integer
(1, 2, 3)

scope

-,G/-/-

queries the object type (Default, Model or instance)

.toolbar

object

object

-,G/-/-

toolbar of object

.window

identifier

instance

-,G/-/-

window the object currently belongs to

31.2 Specific Attributes

With the attribute .configurable you can define whether a record can be configured, i.e. whether it can be set in the configuration file loaded with DM_LoadProfile().

By using the attribute .itemorder the order of definitions for attributes and records may be queried within records. In the string there will be deposited an A for each attribute and an R for each child record at the corresponding position.

31.3 Example

record Person

{

  string Name;

  string FirstName;

  string PlaceofResidence;

}

function c void PutPerson (integer, record Person input);

function c void GetPerson (integer, record Person output);

In doing so, you can define a structure consisting of three elements and two functions which get this record as parameter.

Record with child record:

record Data

{

  string   Name;

  integer  State;

 

  record Startvalues

  {

    integer  Position;

    integer  Alphavalue;

  }

  record Endresult

  {

    boolean  OK;

    integer  Betavalue;

    integer  Gammavalue;

  }

}

Querying the definition order in a record:

record R

{

  string Name;

  record Child1

  {

    integer Number;

    boolean On;

  }

  boolean Off;

}

 

print R.itemorder  // => "ARA";

31.4 Integrating Records in Application

C modules generated by DM have to be compiled and linked to be able to provide functions for dialogs with records with an application.

These modules are generated by calling the simulation with the option +writetrampolin:

idm +writetrampolin <outfile> <dialogscript>

This statement generates the necessary modules for the call of the functions from a dialog file. According to the type of the functions which use such records, the corresponding header files (C and/or COBOL) are generated.

If such structures are used in the DM object "application", i.e. if the Distributed Dialog Manager is used, you additionally have to indicate the application for which the files are generated.

idm  +writetrampolin <contfile>

  +application <ApplicationName>

  <dialogscript>