help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new "warning" behavior


From: John W. Eaton
Subject: new "warning" behavior
Date: Wed, 21 Mar 2007 14:30:41 -0400

On 16-Mar-2007, Joshua Rigler wrote:

| I tried using nabble, but found no detailed discussions beyond 
| "warning's behavior has changed in 2.9.x".  So, will someone tell me 
| where I can find the code that implements warning as a built-in function 
| in 2.9.9?

In the top-level directory of the Octave sources:

  find . -type f | xargs grep DEFUN | grep warning

| Or if you're feeling really generous, you might explain the 
| basic logic of the algorithm.
| 
| My problem is that I would like to turn off all warnings temporarily, 
| then return to the initial warning state, which by default has several 
| identifiers turned 'off', but the 'all' identifier turned 'on' (btw, is 
| there a set of precedence rules invoked here or what?  My first thought 
| is that if 'all' is 'on', then everything else should be 'off').

Think of the setting for "all" as the default state and the other
specific settings as overriding the default.

| Anyway, I have tried the following:
| 
| 
|    ws=warning;
|    warning('off');
|    <do stuff>
|    warning(ws) ...or... warning(ws.state, ws.identifier)
| 
| 
| Both forms just result in the identifier 'all' being turned on, which is 
| clearly not what the state was to begin with.  I suppose I could loop 
| over each element of ws, but this seems rather ugly.  Even if this is a 
| feature that has been fixed/improved in CVS, I'd appreciate a pointer to 
| the source code, for future reference.

The code in CVS has been fixed so the following should work:

  ws = warning ('off', 'all');
  <do stuff>
  warning (ws);


It's best to report bugs to the address@hidden list.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]