Re: Problem with multiple function calling from a novice...

• To: mathgroup at smc.vnet.net
• Subject: [mg58602] Re: [mg58586] Problem with multiple function calling from a novice...
• From: klamser <klamser at t-online.de>
• Date: Sat, 9 Jul 2005 04:08:02 -0400 (EDT)
• References: <200507080446.AAA18354@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,

1:

a[x_]:=Module[{},Print[{"a is evaluated...",x,x^2}];x^2]
b[x_]:=Module[{},Print[{"b is evaluated...",x,x^3}];x^3]
c[x_]:=Module[{},Print[{"c is evaluated...",x,x^4}];x^4]

f[x_]:=Module[{},a[x]+b[x]+c[x]]

2:

Do not use If, use Which or Switch. Just use the Help system (press the
F1 key) to look, how they work...

Regards,

Peter Klamser

sami schrieb:

>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
>
>
>
>
>

```

• Prev by Date: Re: Problem with multiple function calling from a novice...
• Next by Date: Re: Problem with multiple function calling from a novice...
• Previous by thread: Re: Problem with multiple function calling from a novice...
• Next by thread: Re: Problem with multiple function calling from a novice...