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 |
5794
|
7 with the warning function to control the state of warnings. |
|
8 |
|
9 For example, instead of writing |
2511
|
10 |
5781
|
11 warn_divide_by_zero = false; |
2452
|
12 |
5781
|
13 to disable divide-by-zero warnings, you should write |
2452
|
14 |
5781
|
15 warning ("off", "Octave:divide-by-zero"); |
2452
|
16 |
5781
|
17 You may use the same technique in your own code to control |
|
18 warnings. For example, you can use |
2452
|
19 |
5781
|
20 warning ("My-package:phase-of-the-moon", |
|
21 "the phase of the moon could cause trouble today"); |
2452
|
22 |
5781
|
23 to allow users to control this warning using the |
|
24 "My-package:phase-of-the-moon" warning identifier. |
2452
|
25 |
5781
|
26 You may also enable or disable all warnings, or turn them into |
|
27 errors: |
2452
|
28 |
5781
|
29 warning ("on", "all"); |
|
30 warning ("off", "all"); |
|
31 warning ("error", "Octave:divide-by-zero"); |
|
32 warning ("error", "all"); |
2452
|
33 |
5781
|
34 You can query the state of current warnings using |
2452
|
35 |
5781
|
36 warning ("query", ID) |
|
37 warning ("query") |
2452
|
38 |
5781
|
39 (only those warning IDs which have been explicitly set are |
|
40 returned). |
2459
|
41 |
5781
|
42 A partial list and description of warning identifiers is available |
|
43 using |
2452
|
44 |
5781
|
45 help warning_ids |
2452
|
46 |
|
47 |
5794
|
48 * All built-in variables have been converted to functions. This |
|
49 change simplifies the interpreter and allows a consistent |
|
50 interface to internal variables for user-defined packages and the |
|
51 core functions distributed with Octave. In most cases, code that |
|
52 simply accesses internal variables does not need to change. Code |
|
53 that sets internal variables will change. For example, instead of |
|
54 writing |
|
55 |
|
56 PS1 = ">> "; |
|
57 |
|
58 you will need to write |
|
59 |
|
60 PS1 (">> "); |
|
61 |
|
62 |
|
63 |
5781
|
64 See NEWS.2 for old news. |