## Return Codes

The return codes of the program are also called completion codes and returned at program termination. This content is printed on the screen with the built-in function ERRORS.

0
  command line, command syntax, mapping, execution and finish of the command was successful
1
  command line, command syntax, mapping, execution and finish of the command was successful but a warning can be found in the log
2
  command line, command syntax, mapping, execution was successful but cleanup of the command failed (may not happened)
4
  command line, command syntax and mapping was successful but execution of the command returned with a warning
8
  command line, command syntax and mapping was successful but execution of the command returned with an error
12
  command line and command syntax was OK but mapping of the parameter for command execution failed
16
  command line was OK but command syntax was wrong (error from command line parser)
20
  command string was wrong (please use built-in function "SYNTAX" for more information)
24
  initialization of the parameter structure for the command failed (may not happened)
28
  configuration is wrong (determination of configuration data failed, configuration file might be damaged)
32
  table error (something within the predefined tables is wrong (internal error))
36
  system error (e.g. load of environment or open of file failed)
40
  access control or license error
44
  interface error (e.g. parameter pointer equals NULL (only at call of subprogram interface))
48
  memory allocation failed (e.g. dynamic string handling)
64
  fatal error (basic things are damaged)
>64
  special condition codes from the command for job control

The command line is interpreted by CLE the command string by CLP. For example:

     :> flcl conv "read.file='test.txt' write.flam(file='test.adc')"
        |    |     |-- the command string is compiled by CLP
        |    |     |   and might result in a syntax error
        |    |-- conv is part of the command line
        |-- flcl is part of the command line

     :> flcl conv=para.txt
        |    |    |-- para.txt is part of the command line, but the content
        |    |        of para.txt might contain a CLP syntax error
        |    |-- conv is part of the command line
        |-- flcl is part of the command line

A command execution (run) will return 0 or 1 on success, 4 if a warning occurs (only some of the files converted), 8 in case of an error or special condition codes greater then 64 can be returned.

If the command execution was successful (return code 0) but a relevant warnings was logged then the return code is 1 (anything was fine, but please have a look in the log (e.g. a key is close to expire)). A return code of 2 indicates that a call to the finish function failed. Such a fail of the finish function is not recognizable if the run function (command execution) returns with a warning or an error. On the other side, if the finish failed then an additional warning in the log cannot determined because the condition code is still 2. All completion codes bigger than 8 and smaller or equal to 64 indicate an error in front of the command execution.

A relevant warning is a warning written to the log by a used component. Warnings written by components which are removed from procession because the format does not fit or something else, are still in the log but not relevant for the completion code 1.