Content deleted Content added
m Signing comment by 192.91.171.42 - "→Else in C++: " |
→PL/I: new section |
||
(18 intermediate revisions by 15 users not shown) | |||
Line 1:
{{WikiProject banner shell|class=|
{{WikiProject Computing}}
}}
== BASIC code example ==
Shouldn't proper BASIC error handling code always use the RESUME statement?
:I’m not sure about BASIC, but Visual Basic certainly should. The presented code (trying to emulate stuctured error handling with a lot of boilerplate code) just isn’t the VB way of doing it. What about the following? —[[User:Rathgemz|Rathgemz]] ([[User talk:Rathgemz|talk]]) 16:43, 4 October 2010 (UTC)
<syntaxhighlight lang="vb">
Const My_Error = vbObjectError + 132 ' It's the programmer's obligation to keep the error numbers unique
Function f(x as Integer) as Integer
' Idiom 1: Ignore errors or test explicitly after each statement
On Error Resume Next
Do_Something ' Exceptions from Do_Something are ignored, execution just continues with Do_Something_Else
Do_Something_Else
If Err.Number <> 0 Then
' handle errors in Do_Something_Else
End If
' Idiom 2: Error Handlers
On Error Goto Handler
...
Err.Raise My_Error ' Raising an exception
...
Good_Restart_Point:
...
Exit Function
Handler:
Select Case Err.Number
Case My_Error
' in case of My_Error, do something here
Resume Good_Restart_Point ' then continue with an appropriate statement
Case 58 ' File already exists
' delete file
Resume ' then restart the statement that failed
Case 6 ' Overflow
Result = &H7FFFFFFF ' set to maximum
Resume Next ' then continue with next statement
Case Else
' Propagate other errors to caller
Err.Raise Err.Number
End Select
End Function</syntaxhighlight>
:
== ''Else'' in C++ ==
Line 36 ⟶ 78:
Hello. I just tagged this page with {{tlx|Unreferenced}}. It doesn't seem to fit the model of an Encyclopaedia article; maybe it should be moved to WikiBooks? <small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:AlastairIrvine|AlastairIrvine]] ([[User talk:AlastairIrvine|talk]] • [[Special:Contributions/AlastairIrvine|contribs]]) 07:53, 18 January 2010 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
:There's some truth and logic in that, but we tend to make an exception for articles on programming language and OS commands (e.g. [[chmod]]). Actually this is kind of in the nature of a list article. <b>[[User:Tisane|<span style="color:#008000;">Tisane</span>]]</b> <sup>[[User talk:Tisane|talk]]</sup>/<sub>[[Special:Contributions/Tisane|stalk]]</sub> 02:42, 29 June 2010 (UTC)
== Throw command ==
What about the [http://php.net/manual/en/internals2.opcodes.throw.php throw] command in PHP? Would it be appropriate to list that here? <b>[[User:Tisane|<span style="color:#008000;">Tisane</span>]]</b> <sup>[[User talk:Tisane|talk]]</sup>/<sub>[[Special:Contributions/Tisane|stalk]]</sub> 02:40, 29 June 2010 (UTC)
== Finally ==
There are a few cases where "Finally" is said to always be called. This is not true; it is only called if the thread continues to execute. Killing a process or a thread within it will not result in the finally clause being called. [[Special:Contributions/84.12.212.235|84.12.212.235]] ([[User talk:84.12.212.235|talk]]) 16:29, 5 December 2012 (UTC)
== Requested move 22 May 2016 ==
<div class="boilerplate" style="background-color: #efe; margin: 2em 0 0 0; padding: 0 10px 0 10px; border: 1px dotted #aaa;"><!-- Template:RM top -->
:''The following is a closed discussion of a [[WP:requested moves|requested move]]. <span style="color:red">'''Please do not modify it.'''</span> Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a [[Wikipedia:move review|move review]]. No further edits should be made to this section. ''
The result of the move request was: '''No consensus''' to move the article has been established within the RM time period and thus defaulting to not moved. {{RMpmc}} <span style="font-family:sans-serif; color:red">— <span style="font-weight:bold">[[User:Music1201|<span style="color:green"> Music1201</span>]] <sup>[[User talk:Music1201|<span style="color:red">talk</span>]]</sup></span></span> 02:23, 11 June 2016 (UTC)
----
[[:Exception handling syntax]] → {{no redirect|Comparison of programming languages (exceptions)}} – Consistent names in [[:Category:Programming language comparisons]] [[Special:Contributions/128.70.197.164|128.70.197.164]] ([[User talk:128.70.197.164|talk]]) 22:58, 21 May 2016 (UTC)<small>--'''Relisted.''' <span style="font-family:monospace;background:lightgrey;border:solid 1px;border-radius:5px;"> '''''[[User:Insertcleverphrasehere|Insert]][[Special:Contributions/Insertcleverphrasehere|CleverPhrase]][[User talk:Insertcleverphrasehere|Here]]''''' </span> 06:03, 29 May 2016 (UTC)</small>
[[:Exception handling syntax]] → {{no redirect|Comparison of programming languages (exceptions)}} – Consistent naming in [[:Category:Programming languages by language concept]] [[User:Ushkin N|Ushkin N]] ([[User talk:Ushkin N|talk]]) 09:32, 22 May 2016 (UTC)
It was used before:
* [[Comparison of programming languages (list comprehension)]]
* [[Comparison of programming languages (mapping)]]
[[User:Ushkin N|Ushkin N]] ([[User talk:Ushkin N|talk]]) 09:32, 22 May 2016 (UTC)
* '''Oppose''' and fix those other odd backward-disambig-like titles. [[User:Dicklyon|Dicklyon]] ([[User talk:Dicklyon|talk]]) 05:16, 30 May 2016 (UTC)
----
:''The above discussion is preserved as an archive of a [[Wikipedia:Requested moves|requested move]]. <span style="color:red">'''Please do not modify it.'''</span> Subsequent comments should be made in a new section on this talk page or in a [[Wikipedia:Move review|move review]]. No further edits should be made to this section.''</div><!-- Template:RM bottom -->
== SPIE ==
I was trying to find somewhere in Wikipedia mention of IBMs OS/360 and successor SPIE (Specify Program Interrupt Exit). This is the user-mode way to get control for hardware exceptions. I think it is close to this article, but isn't mentioned. Also, possibly unlike some others, it allows one to return to where one came from, possibly after fixing things up. For example, in overflow one might stuff in the largest possible value and continue on. Otherwise, it looks like the article has much Unix specific notation. [[User:Gah4|Gah4]] ([[User talk:Gah4|talk]]) 14:04, 13 June 2019 (UTC)
== Propose to cover EH langs with resumes: PL/I Mesa Mythril ==
'''EH with resumes''' adds a critical feature of '''resumes from exception handling code to continue execution''' like there was no an exception. '''=>''' the ''Exception handling syntax'' '''should demo it for all this langs'''.
Sorry I can't include the additions since have not found the appropriate code examples ''':'''(... The topic looks like out of general discussion for unknown to me reason. [[User:Pavel Senatorov|Pavel Senatorov]] ([[User talk:Pavel Senatorov#top|talk]] • [[Special:Contributions/Pavel Senatorov|contribs]]) 22:16, 27 November 2019 (UTC)
== PL/I ==
Why is there not PL/I here? As well as I know, it is earlier than all the languages listed, and might be the model for many of them. [[User:Gah4|Gah4]] ([[User talk:Gah4|talk]]) 12:21, 19 April 2025 (UTC)
|