Determining Whether a Compilation Was Successful

You can use any of several methods to determine programmatically whether a particular compilation uncovered syntax errors in the source program.

For a compilation initiated from WFL, the task state expression can be used to determine whether the compilation was successful. To use this expression, a task variable must first be associated with the compilation in the COMPILE statement. The following is an example:

COMPILE OBJECT/PROG WITH ALGOL [COMPILETASK] LIBRARY;
IF COMPILETASK IS COMPILEDOK THEN
   RUN SYSTEM/XREFANALYZER (0);

Another way to determine whether the compilation was successful is to interrogate the HISTORYTYPE task attribute of the compilation. A value of NORMALEOTV means that the compilation was successful, but a value of SYNTAXERRORV means that syntax errors were found.

Another method that can be used is to interrogate the TASKVALUE task attribute. TASKVALUE has a value of zero if the compilation was successful or one if syntax errors were found.