| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== RUNCODE (return program exit code) ====== | [[run execute command .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[select select next control to process .htm|{{btn_next_n.gif|Next page}}]] | | || **RUNCODE( )** {{blk2blue.jpg|blk2blue.jpg}} The **RUNCODE** procedure returns the exit code passed to the operating system from the command executed by the RUN statement. This is the exit code passed by the HALT statement in Clarion programs and is the same as the DOS ERRORLEVEL. RUNCODE returns a LONG integer which may be any value that is returned to DOS as an exit code by the child program. The child program may only supply a BYTE value as an exit code, therefore negative values are not possible as exit codes. This fact allows RUNCODE to reserve these values to handle situations in which an exit code is not available: **  0 normal termination** ** -1 program terminated with Ctrl-C** ** -2 program terminated with Critical error** ** -3 TSR exit** ** -4 program did not run (check ERROR())** **Return Data Type:     **LONG **Example:** **RUN('Nextprog.exe')                !Run next program** **IF RUNCODE() = -4** ** IF ERROR() = 'Not Enough Memory'  !If program didn't run for lack of memory** **  MESSAGE('Insufficient memory')   !display a message** **  RETURN                           !and terminate the procedure** ** ELSE** **  STOP(ERROR())                    !terminate program** ** END** **END** **See Also:** [[run execute command .htm|RUN]] [[halt exit program .htm|HALT]]