5781
|
1 Summary of changes for version 3.0: |
2452
|
2 ---------------------------------- |
|
3 |
5781
|
4 * Previous versions of Octave had a number of built-in variables to |
|
5 control warnings (for example, warn_divide_by_zero). These |
|
6 variables have been replaced by warning identifiers that are used |
|
7 with the warning function to control the state of warnings. Now, |
|
8 instead of writing |
2511
|
9 |
5781
|
10 warn_divide_by_zero = false; |
2452
|
11 |
5781
|
12 to disable divide-by-zero warnings, you should write |
2452
|
13 |
5781
|
14 warning ("off", "Octave:divide-by-zero"); |
2452
|
15 |
5781
|
16 You may use the same technique in your own code to control |
|
17 warnings. For example, you can use |
2452
|
18 |
5781
|
19 warning ("My-package:phase-of-the-moon", |
|
20 "the phase of the moon could cause trouble today"); |
2452
|
21 |
5781
|
22 to allow users to control this warning using the |
|
23 "My-package:phase-of-the-moon" warning identifier. |
2452
|
24 |
5781
|
25 You may also enable or disable all warnings, or turn them into |
|
26 errors: |
2452
|
27 |
5781
|
28 warning ("on", "all"); |
|
29 warning ("off", "all"); |
|
30 warning ("error", "Octave:divide-by-zero"); |
|
31 warning ("error", "all"); |
2452
|
32 |
5781
|
33 You can query the state of current warnings using |
2452
|
34 |
5781
|
35 warning ("query", ID) |
|
36 warning ("query") |
2452
|
37 |
5781
|
38 (only those warning IDs which have been explicitly set are |
|
39 returned). |
2459
|
40 |
5781
|
41 A partial list and description of warning identifiers is available |
|
42 using |
2452
|
43 |
5781
|
44 help warning_ids |
2452
|
45 |
|
46 |
5781
|
47 See NEWS.2 for old news. |