| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions >====== HALT (exit program) ====== | [[getstate return current state of data file .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[help help window access .htm|{{btn_next_n.gif|Next page}}]] | | || ** ** **HALT(**[//errorlevel//] [,//message//]**)** {{blk2blue.jpg|blk2blue.jpg}} | **HALT** | Immediately terminates the program. | | //errorlevel// | A positive integer constant or variable which is the exit code to pass to DOS, setting the DOS ERRORLEVEL. If omitted, the default is zero. | | //message// | A string constant or variable which is typed on the screen after program termination. | The **HALT** statement immediately returns to the operating system, setting the //errorlevel// and optionally displaying a //message// after the program terminates. All standard runtime library procedures for application closedown are performed (all open windows and files are closed and flushed and all allocated memory is returned to the operating system) without executing any further Clarion code in the application. **HALT** should not be used in multi-DLL applications, and should only be used as a debugging technique. **Example:** **PasswordProc PROCEDURE** **Password  STRING(10)** **Window WINDOW,CENTER** **        ENTRY(@s10),AT(5,5),USE(Password),HIDE** **       END** ** CODE** ** OPEN(Window)** ** ACCEPT** **  CASE ACCEPTED()** **  OF ?Password)** **   IF Password <;> 'Pay$MeMoRe'** **   ****HALT****(0,'Incorrect Password entered.')** **   END** **  END** ** END** **See Also:** [[stop suspend program execution .htm|STOP]]