Re: Problem with multiple function calling from a novice...
- To: mathgroup at smc.vnet.net
- Subject: [mg58588] Re: Problem with multiple function calling from a novice...
- From: dh <dh at metrohm.ch>
- Date: Sat, 9 Jul 2005 04:07:49 -0400 (EDT)
- References: <dal1tq$ibc$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Sami,
To show what a function evaluates to, simply wrap it in a "Print"
statement. But note that the Print statement returns "Null". Therefore,
if you need the return value, either assigne it before the Print or use
a temporary variable.
Example:
a[x_]:=2x;
fun[]=:Module[{},Print[a[2]]; ]
or
fun[]=:Module[{t},Print[t=a[2]]; ]
sincerely, Daniel
sami wrote:
> Hi all. I have a small problem, and I would like some help.
>
> Suppose I define a few functions, say a,b,c etc.
>
> Question 1: How can I call them from inside a program, so that they
> ALL
> show what they evaluate in turn? (Not just the last one, but each
> one.)
>
> Question 2: How can I modify an If...Then clause of the form:
>
> If[ <Condition> , a;b;c;...etc.]
>
> or a While loop:
>
> While[ <Condition> , a;b;c;...etc.]
>
> so that, again, they ALL show what they evaluate in turn? (Again, not
> just
> the
> last one like in this case).
>
> Thank you
>
> Sami
>