Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   . . .
   Introduction to EEL
      Epsilon Extension Language Features
      EEL Tutorial
   Epsilon Extension Language
      . . .
      Expressions
      Constant Expressions
      Global Definitions
         Key Tables
         Color Classes
         Function Definitions
      Differences Between EEL And C
      Syntax Summary
   Primitives and EEL Subroutines
      Buffer Primitives
      Display Primitives
      File Primitives
      . . .
      Defining Language Modes
   . . .

Previous   Up    Next
Constant Expressions  Epsilon Extension Language   Key Tables


Epsilon User's Manual and Reference > Epsilon Extension Language >

Global Definitions

program:
        global-definition
        global-definition program

global-definition:
        function-definition
        global-variable-definition
        keytable-definition
        typedef-definition
        color-class-definition

Each file of EEL code consists of a series of definitions for global variables and functions. Global variable definitions have the same format as local variable definitions. The first definition of a global variable Epsilon receives determines the initial value of the variable, and later initializations have no effect, unless you use the volatile keyword when defining the variable (see Initialization). If the first definition provides no explicit initialization, the variable is filled with zeros or null pointers as appropriate, depending on its type.

You can declare any global variable (except a key table or color class) to be buffer-specific by placing the keyword buffer before the type specifier. When the definition is first read in, its initializer determines the value of the variable for each buffer that then exists, and also the default value of the variable. Whenever you create a new buffer (and hence a new copy of the buffer-specific variable), the variable's value in that buffer is set to the default value.

Similarly, you can declare any global variable except a key table or color class to be window-specific by placing the keyword window before the type specifier. When the definition is first read in, its initializer determines the value of the variable for each window that then exists, and also the default value of the variable. Whenever you split a window in two, the new window inherits its initial value for the window-specific variable from the original window. Epsilon uses the default value of a window-specific variable when it creates the first tiled window while starting up, and when it creates pop-up windows.

Epsilon's write-state command writes a new state file containing all variables, EEL functions, macros, colors, and so forth that Epsilon knows about. The file includes the current values of all numeric variables, all global character array variables, and any structures or unions containing just these types. But Epsilon doesn't save the values of variables containing pointers or spots, and sets these to zero as it writes a state file. You can put the zeroed keyword before the definition of a variable of any type to tell Epsilon to zero that variable when it writes a state file.

In commands like set-variable, Epsilon distinguishes between user variables and system variables, and only shows the former in its list of variables you can set. By default, each global variable you define is a system variable that users will not see. Put the user keyword before a variable's definition to make the variable a user variable.



Previous   Up    Next
Constant Expressions  Epsilon Extension Language   Key Tables


Lugaru Copyright (C) 1984, 2012 Lugaru Software Ltd. All Rights Reserved.