MathGroup Archive 2003

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

Search the Archive

RE: To print and not to print

  • To: mathgroup at smc.vnet.net
  • Subject: [mg39351] RE: [mg39320] To print and not to print
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 12 Feb 2003 03:52:46 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Emilio,

I'm sure you will get a number of suggestions on this. Here is one method.

subroutine[range_, fprint_] :=
  Module[{print = fprint, f, x},
    f = x^2 - 2x + Sin[x];
    print[SequenceForm["Function is ", f]];
    Plot[f, {x, 0, range}];
    ]

subroutine[10, Print]

subroutine[10, Identity]

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


From: Emilio Martin-Serrano [mailto:EMartinSerrano at houston.sns.slb.com]
To: mathgroup at smc.vnet.net

Group,

I have a  program with a lot of  *Print["Something"] *  calls imbedded.
This calls are there for intermediate computation tracing purposes; in
other words, I want this in case I need to trace some points in some
instances of some computations, as a (standard) service of my program. But
I would like to be able to disable this printing facility by using some
standard Mathematica variable/option like *DisplayFunction -> Identitiy* if
available. Any clue?

Best regards.

E. Martin-Serrano




  • Prev by Date: Re: Input output disappear
  • Next by Date: Signals and Systems package
  • Previous by thread: RE: To print and not to print
  • Next by thread: Limits: Is there something I'm missing Here?