Re: Para1 THRU Para2
From: James J. Gavan (jjgavan_at_shaw.ca)
Date: 11/21/04
- Next message: Lueko Willms: "Re: Non-Cobol person getting error code"
- Previous message: Robert Wagner: "Re: OT: demise of COBOL WAS: Infinite Loops and Explicit Exits"
- In reply to: Frank Swarbrick: "Re: Para1 THRU Para2"
- Next in thread: Pete Dashwood: "Re: Para1 THRU Para2"
- Reply: Pete Dashwood: "Re: Para1 THRU Para2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 20 Nov 2004 23:40:26 GMT
Frank Swarbrick wrote:
>Is THROW and TRY/CATCH part of COBOL 2002? I've seen this a bit in Java,
>but I've never done enough to really take advantage of it. It certainly
>looks nice!
>
>
>
Frank,
At this point in time no, not a part of COBOL. I'm not sure but it might
be a part of Fujitsu dotNet and the following structure is part of Net
Express dotNet - so either way both are currently extensions.
The M/F version reads (and I'm quoting from a Will Price book on M/F and
dotNet) :-
TRY
CATCH
END-TRY
His book, because he uses Visual Studio and the 'other' language is
Visual Basic, lists the following VB format for comparison :-
TRY
Code to be tested for exception occurrence during its execution
CATCH
Code that is executed only if an exception occurs in the TRY block
FINALLY
Code that is executed whether or not the CATCH block is executed
END-TRY
But the above is very much oriented towards handling objects, (that's
not intended as a back-to-front pun), e.g., instead of telling the
object 'Entry Field" "setContents" using this string/text you
inadvertently tell the object Radio Button "setContents" using .....
At the moment COBOL 2002 does have Exception Handling, very much
oriented to using Declaratives Section, plus there is a whole slew of
Exception-Names in an attempt, within COBOL, to cover both Procedural
and OO type errors. Haven't yet seen an example, but something like the
following :-
ON EXCEPTION
RAISE EC-NON-NUMERIC
Interestingly in comp.obj - somebody did suggest don't use overkill on
Exceptions, keep them manageable. The above format shown for M/F and
dotNet is designed to handle roughly three categories (a) Validation
Errors (b) DataBase - file-status or SQLCODE and (c) Some System Errors
that you can trap.
I think there's some merit in the comp.object observation. Validation
checks - we've been handling them for decades in straight procedural,
which has now been enhanced by the new VALIDATE verb - but that too
hasn't yet been introduced by anybody, to the best of my knowledge.
If Lueko is thinking of jumping in and commenting on this one - please
don't - because I'm drafting something at the moment to quizz you about
Exception Handling in other languages, in a new thread. :-). I know Pete
is interested, (Remember 'Grinder' - I'll see if I can dig out his
private e-mail address and see if he wants to chip in again), and Joe
can probably contribute from a Java angle - similarly Richard used the
phrase 'you can percolate the errors upwards' - and that's the bit which
is a real pain in the ***.
Jimmy
- Next message: Lueko Willms: "Re: Non-Cobol person getting error code"
- Previous message: Robert Wagner: "Re: OT: demise of COBOL WAS: Infinite Loops and Explicit Exits"
- In reply to: Frank Swarbrick: "Re: Para1 THRU Para2"
- Next in thread: Pete Dashwood: "Re: Para1 THRU Para2"
- Reply: Pete Dashwood: "Re: Para1 THRU Para2"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]