Global variables


The global_variable_decl is optional in the global declaration. The purpose of the global_variable_decl is to define global variables for the mapping schema, i.e. like global variables in a programming language. The global_variable_decl has the same SYNTAX as the local_variable declaration in the Express language.
The scope of the identifier that identifies a global variable is the mapping schema in which the global variable declaration occurs, i.e. the global scope of an EDMexpressX mapping schema.
Unless a global variable is initialized by an initializer in the declaration, it will remain indeterminate (question) until it is set by an executable statement.
Example:
SCHEMA_MAP AP214ARM_TO_AP214AIM; – Start of mapping schema
 
GLOBAL
 (*
  The following declaration defines the name of the source model to
  be arm and the name of the source schema is AP214ARM.  *)
   DECLARE arm INSTANCE OF SOURCE_SCHEMA AP214ARM;
 (*
  The following declaration defines the name of the target model to
  be aim and the name of the target EXPRESS schema is AP214AIM.
 *)
   DECLARE aim INSTANCE_OF TARGET_SCHEMA AP214AIM;
 (* Declaration of named instances. *)
   #JonSmith  = aim::Male(?Jon Smith?, 42, #CathySmith);
   #CathySmith = aim::Female(?Cathy Smith?, 35, #JohnSmith);
   #AasgardSidClass = aim::information_content_class()
          || aim::Thing(ACTUAL,'5/6/97', ?)
          || aim::Object()
          || aim::Class_Object();
   #AasgardSidText = aim::Name('Aasgard SID')
          || aim::Thing(actual, '5/6/97', ?)
          || aim::Object()
          || aim::Instance_Object()
          || aim::Information_content()
          || aim::Specific_Information_Content();
 (* Other global variables *)
   aGlobalInt     : INTEGER;
   errorDuringMapping  : BOOLEAN;
   myInstance     : GENERIC;
aMale       : aim:Male;
END_GLOBAL; -- end of global declaration
 
(* REST OF MAPPING SCHEMA *)
 
END_SCHEMA_MAP; – end of mapping schema