Field-Map Scripting

2.5.6 Global scripts

Global scripts


Global scripts are scripts which are not bound to a single attribute or even a single layer. They are associated with events which extend beyond layer level.

Global variables can pass values from Field-Map to script and/or pass values from script to Field-Map. Global variables are automatically introduced for particular scripts.


The following global script categories are available:



See the complete list of global events.


Example :

var
  v: variant;
  ext_: string;

begin
  v := Project.LoadStringFromIniFile('LAYERS', 'EXTENSION', 'MISC.ini');

  if (v <> NULL) and (v <> '') then
    ext_ := format('_%s', [string(v)])
  else
    ext_ := '';

  Globals.SetGlobalVariable('TreeLayerName', 'Trees' + ext_);
  Globals.SetGlobalVariable('RegCirclesLayerName', 'RegCircles' + ext_);
  Globals.SetGlobalVariable('PhotosLayerName', 'Photos' + ext_);
end.


See also:                

Field-Map script types overview; On-Validate scripts; On-Change scripts; On-Demand scripts; Layer scripts; Global scripts; Field-Map script types; Writing scripts in Field-Map