Local

A definition without either the EXPORT or SHARED keywords is available only to subsequent definitions, until the end of the next EXPORT or SHARED definition. This makes them private definitions used only within the scope of that one EXPORT or SHARED definition, which allows you to keep private any definitions that are only needed to implement internal functionality. Local definitions definitions are used to support the EXPORT or SHARED definition in whose file they reside. Local definitions are referenced by their definition name alone; no qualification is needed.

//then inside the Definition4.ecl file (in the same folder as Definition2) you have:
IMPORT $;  
   //makes definitions from the current module available to this code, as needed

LocalDef := 5;
  //local -- available through the end of Definition4's definition, only

EXPORT Definition4 := LocalDef + 5;
//EXPORT terminates scope for LocalDef

LocalDef2 := Definition4 + LocalDef;
  //INVALID SYNTAX -- LocalDef is out of scope here
  //and any local definitions following the EXPORT
  //or SHARED definition in the file are meaningless 
  //since they can never be used by anything

The LOCAL keyword is valid for use within any nested structure, but most useful within a FUNCTIONMACRO structure to clearly identify that the scope of a definition is limited to the code generated within the FUNCTIONMACRO.

AddOne(num) := FUNCTIONMACRO
  LOCAL numPlus := num + 1;
  RETURN numPlus;
ENDMACRO;

numPlus := 'this is a syntax error without LOCAL in the FUNCTIONMACRO';
numPlus;
AddOne(5);

See Also: IMPORT, EXPORT, SHARED, MODULE, FUNCTIONMACRO