Program termination

Revision as of 05:18, 21 April 2008 by rosettacode>Mwn3d (Created task with Java and BASIC)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Show the syntax for a complete stoppage of a program inside a conditional. This includes all threads/processes running under your program.

Task
Program termination
You are encouraged to solve this task according to the task description, using any language you may know.

BASIC

Works with: QuickBasic version 4.5

<qbasic>if problem = 1 then

  end

end if</qbasic>

Java

<java>if(problem){

  System.exit(integerErrorCode); //conventionally, error code 0 is the code for "OK", while anything else is an actual problem
  //optionally: Runtime.getRuntime().exit(integerErrorCode);

}</java>