Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
10
Task/Program-termination/Ada/program-termination-1.adb
Normal file
10
Task/Program-termination/Ada/program-termination-1.adb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
with Ada.Task_Identification; use Ada.Task_Identification;
|
||||
|
||||
procedure Main is
|
||||
-- Create as many task objects as your program needs
|
||||
begin
|
||||
-- whatever logic is required in your Main procedure
|
||||
if some_condition then
|
||||
Abort_Task (Current_Task);
|
||||
end if;
|
||||
end Main;
|
||||
11
Task/Program-termination/Ada/program-termination-2.adb
Normal file
11
Task/Program-termination/Ada/program-termination-2.adb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
procedure Main is
|
||||
-- Create as many task objects as your program needs
|
||||
begin
|
||||
-- whatever logic is required in your Main procedure
|
||||
if some_condition then
|
||||
-- for each task created by the Main procedure
|
||||
The_task.Stop;
|
||||
-- end the Main procedure
|
||||
return; -- actually, this is not needed
|
||||
end if;
|
||||
end Main;
|
||||
14
Task/Program-termination/Ada/program-termination-3.adb
Normal file
14
Task/Program-termination/Ada/program-termination-3.adb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
task body Some_Task is
|
||||
begin
|
||||
loop
|
||||
select
|
||||
-- Some alternatives
|
||||
...
|
||||
or accept Stop do
|
||||
-- Some cleanup while holding the caller is here
|
||||
end Stop;
|
||||
-- A cleanup asynchronous to the caller is here
|
||||
exit; -- We are through
|
||||
end select
|
||||
end loop;
|
||||
end Some_Task;
|
||||
10
Task/Program-termination/Ada/program-termination-4.adb
Normal file
10
Task/Program-termination/Ada/program-termination-4.adb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
task body Some_Task is
|
||||
begin
|
||||
loop
|
||||
select
|
||||
-- Some alternatives
|
||||
...
|
||||
or terminate; -- We are through
|
||||
end select
|
||||
end loop;
|
||||
end Some_Task;
|
||||
3
Task/Program-termination/AutoIt/program-termination.au3
Normal file
3
Task/Program-termination/AutoIt/program-termination.au3
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
If problem Then
|
||||
Exit
|
||||
Endif
|
||||
3
Task/Program-termination/COBOL/program-termination-1.cob
Normal file
3
Task/Program-termination/COBOL/program-termination-1.cob
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
IF problem
|
||||
STOP RUN
|
||||
END-IF
|
||||
3
Task/Program-termination/COBOL/program-termination-2.cob
Normal file
3
Task/Program-termination/COBOL/program-termination-2.cob
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
IF problem
|
||||
GOBACK
|
||||
END-IF
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(when something
|
||||
(kill-emacs))
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
If 1 = 1 Then
|
||||
Program.End()
|
||||
EndIf
|
||||
4
Task/Program-termination/Pluto/program-termination.pluto
Normal file
4
Task/Program-termination/Pluto/program-termination.pluto
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
local condition = true
|
||||
local code = false
|
||||
|
||||
if condition then os.exit(code, true) end
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
if (somecondition) {
|
||||
exit
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
if error? try [6 / 0] [quit]
|
||||
|
|
@ -0,0 +1 @@
|
|||
if error? try [dangerous-operation] [quit/return -12]
|
||||
|
|
@ -0,0 +1 @@
|
|||
if error? try [something-silly] [q/return -12]
|
||||
|
|
@ -0,0 +1 @@
|
|||
view layout [button "stopme" [halt]]
|
||||
1
Task/Program-termination/Uiua/program-termination.uiua
Normal file
1
Task/Program-termination/Uiua/program-termination.uiua
Normal file
|
|
@ -0,0 +1 @@
|
|||
⍣(°1|&exit1) 0
|
||||
11
Task/Program-termination/VBScript/program-termination.vbs
Normal file
11
Task/Program-termination/VBScript/program-termination.vbs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
dim i, j
|
||||
j = 0
|
||||
do
|
||||
for i = 1 to 100
|
||||
while j < i
|
||||
if i = 3 then
|
||||
wscript.quit
|
||||
end if
|
||||
wend
|
||||
next
|
||||
loop
|
||||
Loading…
Add table
Add a link
Reference in a new issue