954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Halt in Pascal

iv seen the line 'halt' in some pascal programs after readkey or readln. what does halt do exactly?

killhha
Light Poster
26 posts since Mar 2009
Reputation Points: 10
Solved Threads: 1
 

'Halt ' command = exit the main program :)

FlamingClaw
Posting Pro
559 posts since Feb 2009
Reputation Points: 132
Solved Threads: 138
 

but cant you just use the command 'exit'? why are there 2 commands which do the same thing?

killhha
Light Poster
26 posts since Mar 2009
Reputation Points: 10
Solved Threads: 1
 

Halt = stop the main program
Exit = just going out from a block,if the main program is the only one block then 'exit' will accomplish the main program.

FlamingClaw
Posting Pro
559 posts since Feb 2009
Reputation Points: 132
Solved Threads: 138
 

Don't forget "Break", to get out of a for i:=... loop.

m610
Light Poster
41 posts since Oct 2008
Reputation Points: 10
Solved Threads: 1
 

how would one stop the main program in Java? Would you use the break statement?

Turtle85
Newbie Poster
6 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You