Progress
Language Reference


COMPILER System Handle

Interfaces
OS
SpeedScript
All
All
Yes

A handle to information on a preceding COMPILE statement.

SYNTAX

COMPILER [ :attribute ] 

attribute

Specifies an attribute of the COMPILER handle. All the attributes are read-only. This table lists the attributes.

Attribute
Type
Description
LOGICAL
Set to TRUE if a compile error occurred.
INTEGER
Set to the column number where the first compile error occurred.
INTEGER
Set to the line number where the first compile error occurred.
CHARACTER
Set to the name of the file compiled.
INTEGER
Set the character offset within the file where a compile error occurred.
LOGICAL
Indicates whether compilation was stopped before completing.
CHARACTER
Set to the COMPILER handle widget type.
LOGICAL
Indicates whether the compilation produced any warning messages.

EXAMPLE

The input for example procedure is as input a comma-separated list of source files. It compiles each of these procedures. If a compilation error occurs, an appropriate message is written to the compile.msgs file.

r-cmpchk.p
/* Compile a series of source files passed 
   in a comma separated list.              */
   
DEFINE INPUT PARAMETER sources AS CHARACTER.

DEFINE VARIABLE entry-num AS INTEGER.

/* If the output file already exists, delete it.
   (If this results in an error, ignore the error.) */
OS-DELETE "compile.msgs".

DO entry-num = 1 TO NUM-ENTRIES(sources):
   COMPILE VALUE(ENTRY(entry-num, sources)) SAVE.
   IF COMPILER:ERROR
   THEN DO:
    OUTPUT TO "compile.msgs" APPEND.
    MESSAGE "Compilation error in" COMPILER:FILENAME "at line"
       COMPILER:ERROR-ROW "column" COMPILER:ERROR-COL.
    OUTPUT CLOSE.
   END.
END. 

NOTES

SEE ALSO

COMPILE Statement


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095