Description

Method for compiling entities of a given type (stored procedures, events, datasets, or windows) into an executable form.

Syntax

retval = Repository("COMPILE"entID, parameter1, parameter2, parameter3)

The arguments in parameter1, parameter2, and parameter3 vary depending on entity type.

Parameters

The COMPILE method has the following parameters

ParameterDescription
MessageCOMPILE
entIDentID consists of four elements, which are '*' (asterisk) delimited:
 
  • Application name
  • Type ID
  • Class ID
  • Entity name
 Methods are executed as follows: if class specific, execute at the class level; if type specific, execute at the type level; otherwise, execute the method.
parameter1a boolean indicating whether or not the entity should be compiled if it has not been changed since the last compilation
parameter2for windows, a boolean indicating whether cleanup of orphan entities should be done. Ignored for other entity types
parameter3For stored procedures, a boolean value indicating whether or not linemarks should be kept. When True$, the linemarks are stripped. When False$, the linemarks are kept. The default is False$.

Returns

null = Compilation failed. Use Get_Status() to test for error return.

1 = Compilation not needed.

2 = Compilation successful. Field 2 returns the date and time of compilation.

Note: Always call the Get_Status function after calling Repository().

See also

Repository() functionTCompile methodGet_Repos_Entities().

Example

/* Compile the source code of the CENTERWINDOW stored procedure */
Declare Function Repository, Get_Status
AppID = @APPID<1>  ;* current application
TypeID = "STPROC"  ;* OpenInsight stored procedures
ClassID = ""  ;* Not Applicable
Stored_Proc_Name = 'CENTERWINDOW'
recompile_if_unchanged = ''
cleanup_orphan_entities = ''
creserve_linemarks = ''
entid = AppID : '*' : TypeID : '*' : ClassID : '*' : Stored_Proc_Name
result = Repository("COMPILE", entid, recompile_if_unchanged, cleanup_orphan_entities, preserve_linemarks)
*  test result
begin case
   case result = ''
     If Get_Status(ErrCode) then
        call msg(@window, 'Error Message returned: ' : ErrCode)
     end
   case result = 1
        call msg(@window, 'Compilation not needed')
   case result<1> = 2
        call msg(@window, 'Compilation successful, compiled at ' : result<2>)
end case
  • No labels