structured_20exception_20handling
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
structured_20exception_20handling [2018/04/17 19:00] – Added syntax highlighting tbest3112 | structured_20exception_20handling [2024/01/05 00:21] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 12: | Line 12: | ||
} | } | ||
</ | </ | ||
- | The **try** clause contains the code you want to execute, which may consist of any number of statements and may optionally call subroutines. This is the code that you anticipate //might// result in an error being generated. The **catch** clause contains the code you want to be executed if an error occurs whilst executing the **try** clause. Whether or not an error occurs, execution continues normally after the **catch** clause.\\ \\ BBC BASIC does not natively provide such a facility, but in //BBC BASIC for Windows// you can emulate the behaviour quite easily as follows:\\ \\ | + | The **try** clause contains the code you want to execute, which may consist of any number of statements and may optionally call subroutines. This is the code that you anticipate //might// result in an error being generated. The **catch** clause contains the code you want to be executed if an error occurs whilst executing the **try** clause. Whether or not an error occurs, execution continues normally after the **catch** clause.\\ \\ BBC BASIC does not natively provide such a facility, but in //BBC BASIC for Windows// and //BBC BASIC for SDL 2.0// you can emulate the behaviour quite easily as follows:\\ \\ |
<code bb4w> | <code bb4w> | ||
ON ERROR LOCAL IF FALSE THEN | ON ERROR LOCAL IF FALSE THEN |
structured_20exception_20handling.1523991633.txt.gz · Last modified: 2024/01/05 00:16 (external edit)