MathGroup Archive 2009

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

Search the Archive

Re: How to print/display symbolic expressions from inside a Module

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104322] Re: How to print/display symbolic expressions from inside a Module
  • From: Norbert Marxer <marxer at mec.li>
  • Date: Tue, 27 Oct 2009 05:00:58 -0500 (EST)
  • References: <hbr599$rh2$1@smc.vnet.net> <hbu7q7$7hh$1@smc.vnet.net>

On Oct 25, 6:25 am, "Nasser M. Abbasi" <n... at 12000.org> wrote:
> "Norbert Marxer" <mar... at mec.li> wrote in message
>
> news:hbu7q7$7hh$1 at smc.vnet.net...
>
>
>
> > Hello
>
> > Use Block (instead of Module).
>
> > Best Regards
> > Norbert Marxer
>
> Humm, how can this work?
>
> Again, no global symbols can be used.
>
> Foo[]:=Module[{},.....]
>
> Everything has to go inside the module above.  So Block[] can't help. any
> symbol used must have the Module Context and below it.  i.e. can't write
> x=2 if x is not allready a local symbol.
>
> But may be if you show me an example that would help.
>
> thanks,
> --Nasser

Hello

Wasn't that what you wanted?

(*Definition*)

Clear[x, F00, f00];
f00[] := Block[{x, y, expr},
   expr = x^2 + y;
   Print[" expression now is ",
    ToString[expr, FormatType -> TraditionalForm]]];
F00[] := Module[{}, f00[]];

(*Call*)

F00[]

(*gives*)

 expression now is x^2+y

Best Regards
Norbert Marxer


  • Prev by Date: Re: Using "/@" Effectively
  • Next by Date: Re: How to format Superscript and Subscript for a symbol to the same
  • Previous by thread: Re: How to print/display symbolic expressions from inside a Module
  • Next by thread: About using hyperlinks in notebook, couple of questions