@msg() Function

Top  Previous  Next

@msg() function is used to create a message ADOM.

Syntax:

@msg(message-id, [message-parameters], [message-details], [unit-name])

 

message-id

The identity of a resource entity existing in the <unit-name>.res file or the text of the message itself. If no entry  is found in the resource file with the given identity the value of this parameter is used as the message text.

message-parameters

One or more message parameters. The values of message parameters are used to replace the symbols such as %0, %1 existing in the resource text.

message-details

More details for the message.

unit-name

The name of the resource file. See MoreMotion Resource Files
 

Example:

@msg('TABLE_NOT_FOUND',[tableName,dbName],

      'Very serious error! Please contact your system administrator.',

      'myunit')

@set(_maxcc,12) @// To force displaying the error page

 

 

myunit.res file

 

  <root>

    <item id="TABLO_NOT_FOUD">

      <en>Table "%0" is missing in database "%1"</en>

      <de>Tabel "%0" ist nicht verfügbar im datenbank "%1"</de>

    </item>

  </root>

 

 

The XML representation of the created message ADOM

 

  <myunit_messages>

    <message id="TABLO_NOT_FOUND">

      <text>Table "products" is missing in database "b2b_catalog"</text>

      <unitname>myunit</unitname>

      <details>Very serious error! Please contact your system administrator.

      </details>

    </message>

  </myunit_messages>

 

 

Note: The elements under the library branch "mor > Error" are compliant to the XML structure of the message ADOM.

 

 

See @res()