MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: almost ok

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19230] RE: [mg19216] almost ok
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Wed, 11 Aug 1999 02:06:46 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

antoine.zahnd at iprolink.ch  wrote:
-------------------------
I wish to define functions to switch between several output Format.
Everything is almost ok:

defaultFFelem[]:=(Format[FF[c_,p_][d_]]=.)

customFFelem[]:=(Format[FF[c_,p_][d_]]:=Subscripted[d[c]])

But executing defaultFFelem[] when the Format is already "cleared" ends
with the message

Unset::"norep": 
    "Assignment on \!\(FF\) for \!\(MakeBoxes[\(\(\(FF[\(c_, \
p_\)]\)[d_]\), FormatType_\)]\) not found."

Is there a test to avoid this message, or an alternative way?

---------------------

I have three ways to avoid the message.


The "Format definition" is stored in FormatValues[FF].
The next line will clear the definition, but it also 
gets rid off any other definitions for 
  Format[FF[....]]


In[1]:=
FormatValues[FF]={};
------------

Instead you could turn off the annoying message before clearing the
definition as I do below.  Then you might want to turn the message back on
after clearing the definition, but how do you know the message wasn't turned
off in the first place?  I wanted to do that at one time.  I checked with
tech support and there is no built-in mechanism to see if a message has been
turned off via  Off[symb::tag].

In[2]:=
Off[Unset::norep];
Format[FF[c_,p_][d_]]=. ;

--------------------

The best solution may be to temporarily clear the meaning of "Message" using
Block as I do below.  That way the message will still be on *If And Only If*
it was on before clearing the Format definition.

In[4]:=
Block[{Message},
 (Format[FF[c_,p_][d_]]=.)];


-------------
Regards,
Ted Ersek



  • Prev by Date: Importing graphics into mathematica
  • Next by Date: Re: Always "Untitled-1"?
  • Previous by thread: almost ok
  • Next by thread: MathLink speed issues