|
From: | Paul Kienzle |
Subject: | Re: improved compatibility |
Date: | Wed, 09 Jul 2003 21:20:32 -0400 |
User-agent: | Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.3) Gecko/20030312 |
John W. Eaton wrote:
So far, we only have a few variables that control some common warnings. Maybe we need a better way of registering them so they can be controlled without having to add individual variables for each one. The mechanism would need to work for warnings that are found .m files too. Matlab apparently already has this by allowing warning ('message_id', 'message'); to register 'message_id' string with the warning handler so individial warnings can be turned off using the message id: warning ('off', 'message_id') Implementing this will require a bit of work, but it should not be too difficult. If we do it, then perhaps we should then eliminate all the individual warn_* variables.
Okay, but we may still want to save-set-restore the warning value inside a script that would produce a warning in the usual case. The easiest solution is to have warning(value, id) return the previous value. That gives us the equivalent of what we've got now, so I don't see it reducing the use of unwind_protect blocks in our code. Maybe if we could shut off warnings just for the current function? Sometimes I implement the equivalent of warning('once','message_id') when I only want one warning during the session. Paul Kienzle address@hidden
[Prev in Thread] | Current Thread | [Next in Thread] |