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

Recommended Answers

All 5 Replies

'Halt ' command = exit the main program :)

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

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.

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.