CATEGORY:INCLUDES
path: NUWIKI > CHRISTIAN EYERMAN > CATEGORY:INCLUDES

Nucleus INCLUDES

Programs written to take advantage of the Nucleus framework utilize INCLUDE items found in either of two libraries:

  • SBP,INCLUDES
    • Includes that DO NOT address the local COMMON block but DO address the Nucleus named GLOBAL COMMON
  • IBP,INCLUDES
    • Includes that reference the Nucleus rule set local COMMON block as well as the NUCLEUS GLOBAL COMMON block.

Using Nucleus Includes

There are actually only four main includes that programmer need be concerned about when writing a routine from scratch.

  1. SBP,INCLUDES CONSTANTS
    • This includes all the base EQUates, PORTINFO (USER/ACCOUNT/PORT) and TERMINALS.FILE.
    • This can be included by a PROGRAM or a SUBROUTINE
    • note:files opened in CONSTANTS or COMMONS are opened only once per login session.
  2. SBP,INCLUDES SHELLFILES
    • This opens to the GLOBAL table all Nucleus referenced files including the work file (NULISTS,port), the SHUSERS file, CONFIGURATION, etc.
    • This can be included by a PROGRAM or a SUBROUTINE
    • Used in conjunction with SBP,INCLUDES CONSTANTS
  3. IBP,INCLUDES INITIALIZE
    • This is the main include that any initializing program uses to hook into the base framework for Nucleus rule sets. It initializes compatible EQUs, PORTINFO, INPUTOPENS, etc.
    • It is possible for SCR. type subroutines to be called and rule sets utilized in special or auxiliary UI drivers.
    • Initializes the LOCAL COMMON block used by the rule sets
    • This can ONLY be included by a PROGRAM
  4. IBP.INCLUDES COMMONS
    • This is the standard include for all subroutines called from a Nucleus rule set or from any PROGRAM using IBP,INCLUDES INITIALIZE
    • This is automatically included when a SUBS. type program is created within a rule set.
    • This can only be included by a SUBROUTINE

SYSTYPE-based NUCLEUS INCLUDES

The NUCLEUS precompiler parses $INCLUDE statements and looks for an instance of the INCLUDE name stored as SYSTYPE.includeName where,

SYSTYPE is the system type UV for Universe, UD for Unidata, QM or D3

  • The actual INCLUDE references compiled in expanded code on Universe.
    1. SBP,INCLUDES UV.CONSTANTS
    2. IBP,INCLUDES UV.COMMONS

A word about COMMON blocks

Nucleus makes use of BASIC variable space in three ways.

  • Local private variables
    • These are variables local to any program or subroutine
    • Both SBP and IBP programs use local variables
    • The SBP (Shell) INCLUDE references GLOBAL COMMONS only.
    • Variable values must be passed via argument list to subroutines or in
  • LOCAL COMMON
    • Each NUCLEUS rule set addresses the LOCAL COMMON block.
    • This allows rule sets to execute rule sets within the interactive environment without stepping on each others shared (current execute level) variable space
  • GLOBAL (NAMED) COMMON
    • Both SBP and IBP based programs reference the NUCLEUS NAMED COMMON block
    • FOR INTERNAL NUCLEUS USE ONLY
    • If session persistence of data is required then user programs should include and maintain their own NAMED COMMONS block

See also