help-octave
[Top][All Lists]
Advanced

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

Re: warning_ids


From: Peter Cloetens
Subject: Re: warning_ids
Date: Mon, 17 Sep 2007 22:56:33 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060909)



John W. Eaton wrote:
On 17-Sep-2007, Peter Cloetens wrote:

| Is there a way to get rid of the following type of warning:
| | PS1 is no longer a built-in variable; please read the NEWS file or type | `news' for details

Stop assigning values to PS1?

We have to keep the possibility to run both octave 2.1.73 and 2.9.13.
As suggested in the NEWS file we do several things along the line:

        if (exist ("OCTAVE_VERSION") == 5)
                ## New:
                PS1 (">> ");
        else
                ## Old:
                PS1 = ">> ";
        endif

The new octave version gives a warning even if it is not supposed to execute the old version of the code. The warning seems to be produced by the interpreter.


| I went through the warning_ids without much success.
| The only solution that worked, was:
| warning("off")
| but then all warnings are gone.
| Or with other words, is there somewhere a full list of warning identifiers?

I don't see a way to have a comprehensive list of all possible warning
identifiers.  The general method for finding out the warning
identifier associated with the most recent warning is

  PS1 = 1;  %% generate the warning message
  [msg, id] = lastwarn ()

jwe

Thanks,
        warning("off","Octave:built-in-variable-assignment")
does the job (getting rid of warnings for assignments that we never do).
Peter


reply via email to

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