User Tools

Site Tools


member_identify_member_source_file_.htm
Navigation:  Language Reference > 2 - Program Source Code Format > Program Format >====== MEMBER (identify member source file) ====== Previous pageReturn to chapter overviewNext page
MEMBER( [ program ] )
[MAP
Prototypes
END ]
[label] local data
procedures

NewCNet.jpg

In Clarion#, you can add a default access modifier to the PROGRAM statement:

MEMBER[, PUBLIC|,INTERNAL]

All declarations without an explicit access modifier will have the default access modifier. The default for MEMBER is INTERNAL.

blk2blue.jpg

MEMBER The first statement in a source module that is not a PROGRAM source file. Required.
program A string constant containing the filename (without extension) of a PROGRAM source file. If omitted, the module is a “universal member module” that you can compile in any program by adding it to the project.
MAP Local procedure declarations. Any procedures declared here may be referenced by the procedures in the MEMBER module.
prototypes PROCEDURE declarations.
local data Declare Local Static data which may be referenced only by the procedures whose source code is in the MEMBER module.
procedures Source code for the procedures in the MEMBER module.

MEMBER is the first statement in a source module that is not a PROGRAM source file. It may only be preceded by source code comments. It is required at the beginning of any source file that contains PROCEDUREs that are used by a PROGRAM. The MEMBER statement identifies the program to which the source MODULE belongs.

A MEMBER module may have a local MAP structure (which may contain MODULE structures). The procedures prototyped in this MAP are available for use by the other procedures in the MEMBER module. The source code for the procedures declared in this MEMBER MAP may either be contained in the MEMBER source file, or another file (if prototyped in a MODULE structure within the MAP).

If the program parameter is omitted from the MEMBER statement, you must have a MAP structure that prototypes the procedures it contains. You also need to INCLUDE any standard EQUATEs files that are used in your source code.

If the source code for a PROCEDURE prototyped in a MEMBER module's MAP is in a separate file, the prototype must be in a MODULE structure within the MAP. The source file MEMBER module containing the PROCEDURE definition must also contain its own MAP which declares the same prototype (that is, the prototype must appear in at least two MAP structures–the source module containing it and the source module using it). Any PROCEDURE not declared in the Global (PROGRAM) MAP must be declared in a local MAP(s) in the MEMBER MODULE which contains its source code.

Data declared in the MEMBER module, after the keyword MEMBER and before the first PROCEDURE statement, is Member Local data that may only be accessed by PROCEDUREs within the module (unless passed as a parameter). Its memory allocation is Static.

Example:

!Source1 module contains:

MEMBER('OrderSys')            !Module belongs to the OrderSys program

 MAP                           !Declare local procedures

Func1 PROCEDURE(STRING),STRING  !Func1 is known only in both module

  MODULE('Source2.clw')

HistOrd2 PROCEDURE              !HistOrd2 is known only in both modules

  END

END

LocalData STRING(10)            !Declare data local to MEMBER module

HistOrd  PROCEDURE              !Declare order history procedure

HistData  STRING(10)            !Declare data local to PROCEDURE

CODE

LocalData = Func1(HistData)

Func1 PROCEDURE(RecField)       !Declare local procedure

CODE

 !Executable code statements

!Source2 module contains:

  MEMBER('OrderSys')           !Module belongs to the OrderSys program

 MAP                           !Declare local procedures

HistOrd2 PROCEDURE              !HistOrd2 is known only in both modules

  MODULE('Source1.clw')

Func1 PROCEDURE(STRING),STRING  !Func1 is known only in both module

  END

 END

LocalData STRING(10)            !Declare data local to MEMBER module

HistOrd2 PROCEDURE              !Declare second order history procedure

CODE

LocalData = Func1(LocalData)

See Also:

MAP

MODULE

PROCEDURE

CLASS

PUBLIC

INTERNAL

Data Declarations and Memory Allocation

member_identify_member_source_file_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)