Statement ANNOUNCE Foundation

Declares a module identifier for a PRG file.

Syntax
ANNOUNCE <ModuleName>
Parameters
<ModuleName>
<ModuleName> designates the name for a program module or a PRG file.
Description

The ANNOUNCE statement declares a symbolic name for an entire program module or PRG file, making the symbol available to the linker. The reference to the name is later deleted by the linker. Only one ANNOUNCE statement may appear in a PRG file, and it must occur prior to the first executable statement at the beginning of the source code file. <ModuleName> must be unique among module and user-defined function names.

ANNOUNCE is used with REQUEST in order to manage source code files.

Examples
ANNOUNCE usage
// The example illustrates the use of ANNOUNCE and REQUEST. 
// Two files are shown: ANNOUNCE is used in DATADICT.PRG and 
// REQUEST is used in TEST.PRG. 

********************* 
** File: TEST.PRG  ** 
********************* 
PROCEDURE Main 

   REQUEST DataDictionary           // Request module for linker 

   DeclareDbf() 
   OpenDataBase() 

RETURN 
////// 
// EOF 
////// 

************************* 
** File: DATADICT.PRG  ** 
************************* 
ANNOUNCE DataDictionary             // Declare module for linker 

STATIC  saDbfFiles := {} 

PROCEDURE OpenDataBase() 
   LOCAL n, nMax 

   nMax := Len( saDbfFiles ) 
   FOR n:=1 TO nMax 
      SELECT (n) 
      USE (saDbfFiles[n,1]) ALIAS (saDbfFiles[n,2]) 
   NEXT 
RETURN 

PROCEDURE DeclareDbf() 
   IF Empty( saDbfFiles ) 
      AAdd( saDbfFiles , { "CUSTOMER.DBF", "CUST" } ) 
      AAdd( saDbfFiles , { "INVOICES.DBF", "INV" } ) 
      AAdd( saDbfFiles , { "ARTICLE.DBF", "ART"  } ) 
   ENDIF 
RETURN 
////// 
// EOF 
////// 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.