Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1 +0,0 @@
|
|||
Foo_Error : exception;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
procedure Foo is
|
||||
begin
|
||||
raise Foo_Error;
|
||||
end Foo;
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
...
|
||||
exception
|
||||
when Foo_Error =>
|
||||
if ... then -- Alas, cannot handle it here,
|
||||
raise; -- continue propagation of
|
||||
end if;
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
procedure Call_Foo is
|
||||
begin
|
||||
Foo;
|
||||
exception
|
||||
when Foo_Error =>
|
||||
... -- do something
|
||||
when others =>
|
||||
... -- this catches all other exceptions
|
||||
end Call_Foo;
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
with Ada.Exceptions; use Ada.Exceptions;
|
||||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure Main is
|
||||
begin
|
||||
...
|
||||
Raise_Exception (Foo_Error'Identity, "This is the exception message");
|
||||
..
|
||||
exception
|
||||
when Error : others =>
|
||||
Put_Line ("Something is wrong here" & Exception_Information (Error));
|
||||
end Main;
|
||||
|
|
@ -1 +0,0 @@
|
|||
throw "Any error message."
|
||||
|
|
@ -1 +0,0 @@
|
|||
throw [System.IO.FileNotFoundException] ".\temp.txt not found."
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
try
|
||||
{
|
||||
Get-Content -Path .\temp.txt
|
||||
}
|
||||
catch [System.IO.FileNotFoundException]
|
||||
{
|
||||
Write-Host "File not found exception"
|
||||
}
|
||||
catch [System.Exception]
|
||||
{
|
||||
Write-Host "Other exception"
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
$Error[0] | Get-Member
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
/*REXX program demonstrates handling an exception (negative #); catching is via a label.*/
|
||||
do j=9 by -5
|
||||
say 'the square root of ' j " is " sqrt(j)
|
||||
end /*j*/
|
||||
exit /*stick a fork in it, we're all done. */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
sqrt: procedure; parse arg x; if x=0 then return 0; d=digits(); h=d+6; m.=9
|
||||
numeric digits; numeric form; if x<0 then signal .sqrtNeg
|
||||
parse value format(x, 2, 1, , 0) 'E0' with g 'E' _ .; g=g * .5'e'_ % 2
|
||||
do j=0 while h>9; m.j=h; h=h%2 + 1; end /*j*/
|
||||
do k=j+5 to 0 by -1; numeric digits m.k; g=(g+x/g) * .5; end /*k*/
|
||||
numeric digits d; return g/1
|
||||
.sqrtNeg: say 'illegal SQRT argument (argument is negative):' x; exit 13
|
||||
-- 12 Sep 2025
|
||||
include Setting
|
||||
|
||||
say 'EXCEPTIONS'
|
||||
say version
|
||||
say
|
||||
say 'Square root of 10 is' SqRt(10)/1
|
||||
say 'Square root of 0 is' SqRt(0)
|
||||
say 'Square root of -1 is' SqRt(-1)
|
||||
exit
|
||||
|
||||
include Math
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue