Mercurial > hg > octave-jordi
view NEWS @ 5808:a18d85bdff31
[project @ 2006-05-11 03:11:03 by jwe]
author | jwe |
---|---|
date | Thu, 11 May 2006 03:11:08 +0000 |
parents | 7e7ed81f5566 |
children | 67bf9b4f2ae2 |
line wrap: on
line source
Summary of changes for version 3.0: ---------------------------------- * Previous versions of Octave had a number of built-in variables to control warnings (for example, warn_divide_by_zero). These variables have been replaced by warning identifiers that are used with the warning function to control the state of warnings. For example, instead of writing warn_divide_by_zero = false; to disable divide-by-zero warnings, you should write warning ("off", "Octave:divide-by-zero"); You may use the same technique in your own code to control warnings. For example, you can use warning ("My-package:phase-of-the-moon", "the phase of the moon could cause trouble today"); to allow users to control this warning using the "My-package:phase-of-the-moon" warning identifier. You may also enable or disable all warnings, or turn them into errors: warning ("on", "all"); warning ("off", "all"); warning ("error", "Octave:divide-by-zero"); warning ("error", "all"); You can query the state of current warnings using warning ("query", ID) warning ("query") (only those warning IDs which have been explicitly set are returned). A partial list and description of warning identifiers is available using help warning_ids * All built-in variables have been converted to functions. This change simplifies the interpreter and allows a consistent interface to internal variables for user-defined packages and the core functions distributed with Octave. In most cases, code that simply accesses internal variables does not need to change. Code that sets internal variables will change. For example, instead of writing PS1 = ">> "; you will need to write PS1 (">> "); If you need write code that will run in both old and new versions of Octave, you can use something like if (exist ("OCTAVE_VERSION") == 5) ## New: PS1 (">> "); else ## Old: PS1 = ">> "; endif See NEWS.2 for old news.