Announcement

Collapse
No announcement yet.

Try Catch Finally

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Try Catch Finally

    With the advent of PbWin901 today, I thought now is as good a time as ever to try out different programming styles than what I am used to. One concept is Try Catch Finally.

    Since GetLastError <> ERR then I have questions as to how Try Catch Finally would work with calling Windows Api??? (Docs only show use of ERR, so I suspect only PB errors are valid in a Try/Catch/Finally format???)

    Also is Try/Catch/Finally only valid for errors? (or could it sometimes be used in place of "Select Case" if looking for an error? aka raise an error if value not found, or call the catch case if not found???)
    Engineer's Motto: If it aint broke take it apart and fix it

    "If at 1st you don't succeed... call it version 1.0"

    "Half of Programming is coding"....."The other 90% is DEBUGGING"

    "Document my code????" .... "WHYYY??? do you think they call it CODE? "

  • #2
    Also is Try/Catch/Finally only valid for errors? (or could it sometimes be used in place of "Select Case" if looking for an error? aka raise an error if value not found, or call the catch case if not found???)
    There is a another current thread on this right now. http://www.powerbasic.com/support/pb...ad.php?t=40027

    However, 'CASE ELSE' would seem a little more straightforward in your particular scenario.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment

    Working...
    X