EDM Pragma directives
Pragmas are used in EXPRESS/EXPRESS-X source code to modify default behaviour of the EDM system. Syntax pattern is usually:
--$EDM{pragma "<group>.<name>.<item>"="<value>"}
Unless otherwise specified:
- You cannot turn pragmas on and off or change pragma value within the same code unit (file)
- If they are supplied AFTER the code itself they cannot be trusted to have the desired effect
Hence always place pragmas in the beginning of the source file.
EDM Compiler pragmas
EDM Compiler - change error severity
pattern = COMPILER.ERROR_SEVERITY.C<nnnn>=<value>
Set the error severity for the compiler error nnnn to one of the following values:
- "non" or "ignore"
- "msg" or "message"Â
- "wrn" or "warning"Â
- "err" or "error"
Value is not case sensitive, so WRN works as well as "wrn"
Example:
--$EDM{pragma "COMPILER.ERROR_SEVERITY.C3174"="wrn"}
This refers to compiler error C3174: Type label for GENERIC_ENTITY is not handled. Default severity is ERROR which will prevent storage of the schema. The example sets severity to WARNING and the compiler will store the schema in EDM database as a dictionary model in the normal way.
EDMVM pragmas
Passing aggregates by reference
Pragma directive in EDMquerySchema, EDMruleSchema and EDMmapSchema (EDMschemaMap) to enable "passing aggregates by reference" instead of "passing aggregate by value". In EDMexpressX, the default way of "passing aggregates" is "by value". This means that (almost) each time an aggregate is stored or used as a parameter in a  function/procedure call, a copy of the actual aggregate is made, and the aggregateID of the new aggregate is stored or passed to the called function/procedure. This "method" is a performance killer and a large "virtual memory consumer". Hence, this should be avoided whenever possible. When using "pass aggregate by reference", only the aggregateID is stored or passed to the called function/procedure. Until now, the option "PASS_AGGREGATES_BY_REFERENCE" in the relevant EDMinterface operations or in the relevant EDMsupervisor commands, had to be used to enable the "pass aggregates by reference" method. A pragma directive is introduced in all kinds of EDMexpressX schemata to enable (and disable) "PASS_AGGREGATES_BY_REFERENCE". The format of the pragma is :
--$EPP{pragma "VM.pass_aggregates_by_reference"="true"}
note that
- All "elements" in the Pragma directive are case insensitive.
- The actual value must be either true or false.
- The Pragma directive must be within (between) Â the actual SCHEMA - END_SCHEMA tokens.
It is recommended as good practise  to place the Pragma directive as the first after the actual SCHEMA token. No warning/error message is produced when more than one "VM.pass_aggregates_by_reference" pragma is specified in the same schema. In such cases, the last one will be the only giving an effect at run-time. Hence, it is just confusing to have more than one "VM.pass_aggregates_by_reference" pragma in the same schema. The "old way" of specifying "PASS_AGGREGATES_BY_REFERENCE" is still available, but it is recommended to use the Pragma directive instead of the "old way" because the way of "passing aggregates" is an attribute of the actual schema, decided at schema design time, and not an option that can/should be enabled/disabled at run-time.